schrodinger.ui.qt.tablewidget module¶
This is a table whose cells contain Tkinter widgets such as Buttons and Checkbuttons. Take a look at prepwizard.py or vsw_gui.py for application example.
Simple example:
table = widgettable.TableWidget(parent, hull_width=200, hull_height=200, showtitlebar=True) table.pack(side=LEFT)
col1 = table.addColumn(columntitle=’On’, width=50) col2 = table.addColumn(columntitle=’Name’)
- for i in range(10):
row = table.insertRow() cell1 = row.cell[0] cell2 = row.cell[1] <modify cell1 or cell2 as necessary>
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.ui.qt.tablewidget.VerticalHeader(table, header)¶
Bases:
object
- __init__(table, header)¶
- setStretchLastSection(stretch)¶
- class schrodinger.ui.qt.tablewidget.HorizontalHeader(table, header)¶
Bases:
object
- __init__(table, header)¶
- setStretchLastSection(stretch)¶
- class schrodinger.ui.qt.tablewidget.Cell(table, rowi, coli)¶
Bases:
object
References to instances of this class should not be stored. They are designed to be created dynamically.
- __init__(table, rowi, coli)¶
- item()¶
Returns QTableWidgetItem instance for this cell
- property column¶
- property row¶
- isSelected()¶
- select()¶
- deselect()¶
- getText()¶
- text()¶
- setText(text)¶
- setTextAlignment(alignment)¶
- setData(role, value)¶
- setToolTip(text)¶
- checkState()¶
- setCheckState(state)¶
- setCheckable(checkable)¶
Whether to add a checkbutton to this cell.
- setSelectable(selectable)¶
- setEnabled(enabled)¶
Whether the user can interact with this cell.
- setEditable(editable)¶
- class schrodinger.ui.qt.tablewidget.Column(table, coli)¶
Bases:
object
References to instances of this class should not be stored. They are designed to be created dynamically.
- __init__(table, coli)¶
- setHeader(label)¶
- setHeaderToolTip(text)¶
- property cell¶
- remove()¶
- select()¶
- isHidden()¶
- resizeToContents()¶
- getWidth()¶
- setWidth(width)¶
- sortBy(ascending=True)¶
- class schrodinger.ui.qt.tablewidget.Row(table, rowi)¶
Bases:
object
References to instances of this class should not be stored. They are designed to be created dynamically.
- __init__(table, rowi)¶
- setHeader(label)¶
- property cell¶
- remove()¶
- select()¶
- deselect()¶
- selectOnly()¶
- isSelected()¶
- isHidden()¶
- hide()¶
- show()¶
- resizeToContents()¶
- getHeight()¶
- setHeight(height)¶
- class schrodinger.ui.qt.tablewidget.CellIterator(cells)¶
Bases:
object
column.cell row.cell Class for iterating over cells in a row or column and for getting a cell Cells are indexed starting with 0 Ex: cell = row.cell[0] or: cell = column.cell[0]
- __init__(cells)¶
- __len__()¶
- class schrodinger.ui.qt.tablewidget.RowIterator(table)¶
Bases:
object
table.row Class for iterating over rows and for getting a row object Rows are indexed starting with 0 Ex: row = table.row[rowi]
- __init__(table)¶
- __len__()¶
- class schrodinger.ui.qt.tablewidget.ColumnIterator(table)¶
Bases:
object
table.column Class for iterating over columns and getting a column Columns are indexed starting with 0 Ex: column = table.column[coli]
- __init__(table)¶
- __len__()¶
- class schrodinger.ui.qt.tablewidget.TableWidget(tablewidget, multiselect=False, cellselect=False, sortable=False, stretch_last=False)¶
Bases:
schrodinger.ui.qt.tablewidget._BaseTable
The table class with scroll bars
- __init__(tablewidget, multiselect=False, cellselect=False, sortable=False, stretch_last=False)¶
- class schrodinger.ui.qt.tablewidget.SelfContainedTable(parent=None)¶
Bases:
PyQt6.QtWidgets.QTableWidget
,schrodinger.ui.qt.tablewidget._BaseTable
- __init__(parent=None)¶
- schrodinger.ui.qt.tablewidget.main()¶