schrodinger.ui.qt.structtable module¶
This module provides classes that can be used to create Qt tables that show 2D structures in the cells.
This module was designed to be used with 2D Viewer and CombiGlide panels. Please notify the module developers if you plan to use it with your code, because the module behavior may change without notice.
Copyright Schrodinger, LLC. All rights reserved.
- schrodinger.ui.qt.structtable.draw_picture_into_rect(*args, **kwargs)¶
Draw a QPicture into a given rectangle.
This function has been moved to swidgets.draw_picture_into_rect.
- Parameters
painter (QtGui.QPainter object) – QPainter object that will do the drawing into the cell.
pic (QPicture) – the picture to be drawn into the rectangle
rect (QRect) – the rectangle that defines the drawing region
max_scale (int) – The maximum amount to scale the picture while attempting to make it fit into rect. This value is multipled by the scale factor required to fit a 150(wide) x 100 (high) picture to fit that picture into rect. The resulting product (max_scale * reference picture scale) is the true maximum scale factor allowed.
- class schrodinger.ui.qt.structtable.ViewerTable(tablemodel, parent=None)¶
Bases:
PyQt6.QtWidgets.QTableView
- __init__(tablemodel, parent=None)¶
- cellAspectRatio()¶
- setDelegate(d)¶
- delegate()¶
- setAutoResize(val)¶
- autoResize()¶
- resizeEvent(self, e: QResizeEvent)¶
- isScrolling()¶
- isActivelyScrolling()¶
- class schrodinger.ui.qt.structtable.ViewerModel(rowcount=0, columncount=4, unique=False)¶
Bases:
schrodinger.ui.qt.table.ViewerModel
This class has been moved to the new table module
- class schrodinger.ui.qt.structtable.StructureViewerDelegate(tableview, tablemodel, filename=None)¶
Bases:
schrodinger.ui.qt.structtable._GenericViewerDelegate
- __init__(tableview, tablemodel, filename=None)¶
- generatePicture(index)¶
Overwrite this method. It should return a QPicture object for item index.
- clearCache()¶
Will clear all QPictures that are cached.
- paintCell(painter, option, index, pic)¶
Overwrite this method for custom cell drawing
- class schrodinger.ui.qt.structtable.StructureReaderDelegate(tableview, tablemodel, filename=None)¶
Bases:
schrodinger.ui.qt.structtable.StructureViewerDelegate
- __init__(tableview, tablemodel, filename=None)¶
- generatePicture(index)¶
Overwrite this method. It should return a QPicture object for item index.
- setFile(filename=None)¶
- recalculateTableSize()¶
- appendFile(filename)¶