Package schrodinger :: Package application :: Package jaguar :: Package gui :: Package tabs :: Package sub_tab_widgets :: Module base_widgets :: Class SubTabTableView
[hide private]
[frames] | no frames]

Class SubTabTableView

PyQt4.QtGui.QTableView --+    
                         |    
   utils.ProjTableLikeView --+
                             |
                            SubTabTableView

A table view with a right click menu for removing selected rows. This class may be subclassed to configure delegates.

Instance Methods [hide private]
 
__init__(self, parent=None)
 
removeSelectedRows(self)
Remove the currently selected rows from the table
 
mouseReleaseEvent(self, event)
Create the popup menu when the user right clicks
dict
_getSampleData(self)
Combine _DEFAULT_SAMPLE_DATA and SAMPLE_DATA
 
setModel(self, model)
After setting the model, resize the columns using the sample data and the header data provided by the model
 
sizeHintForColumn(self, col_num)
Provide a size hint for the specified column using the sample data.
 
selectionChanged(self, new_sel, old_sel)
When the table selection changes, emit the appropriate signals to update marker highlighting.
 
_emitForSelection(self, sel, highlight)
Emit setMarkerHighlighting for all rows in the given table selection
 
_setHighlightingForAtoms(self, atoms, highlight)
Emit the setMarkerHighlighting signal to change the workspace marker highlighting for the specified atoms.

Inherited from utils.ProjTableLikeView: commitDataToSelected, selectionCommand, setItemDelegateForColumn

Class Variables [hide private]
type COLUMN = None
A class containing column constants for the table.
dict SAMPLE_DATA = {}
A dictionary of {column number: sample cell contents}.
dict _DEFAULT_SAMPLE_DATA = {"ID": "999", "TITLE": "This is a very ...
A dictionary of {column name (attribute in the COLUMN class variable): sample cell contents}.
int MARGIN = 20
The additional width to add to each column included in the sample data
  setMarkerHighlighting = QtCore.pyqtSignal(list, bool)
Method Details [hide private]

__init__(self, parent=None)
(Constructor)

 
Overrides: utils.ProjTableLikeView.__init__

_getSampleData(self)

 

Combine _DEFAULT_SAMPLE_DATA and SAMPLE_DATA

Returns: dict
The combined contents of _DEFAULT_SAMPLE_DATA and SAMPLE_DATA

setModel(self, model)

 

After setting the model, resize the columns using the sample data and the header data provided by the model

See Qt documentation for an explanation of arguments

sizeHintForColumn(self, col_num)

 

Provide a size hint for the specified column using the sample data. Note that this method does not take header width into account as the header width is already accounted for in resizeColumnToContents.

See Qt documentation for an explanation of arguments and return value

selectionChanged(self, new_sel, old_sel)

 

When the table selection changes, emit the appropriate signals to update marker highlighting.

Parameters:
  • new_sel (PyQt4.QtGui.QItemSelection) - The new table selection
  • old_sel (PyQt4.QtGui.QItemSelection) - The previous table selection

_emitForSelection(self, sel, highlight)

 

Emit setMarkerHighlighting for all rows in the given table selection

Parameters:
  • sel (PyQt4.QtGui.QItemSelection) - The table selection
  • highlight (bool) - Whether to highlight (True) or unhighlight (False) the specified marker

_setHighlightingForAtoms(self, atoms, highlight)

 

Emit the setMarkerHighlighting signal to change the workspace marker highlighting for the specified atoms. Subclasses should override this function instead of _emitForSelection whenever possible.

Parameters:

Class Variable Details [hide private]

SAMPLE_DATA

A dictionary of {column number: sample cell contents}. The sample cell contents are used to set column widths appropriately. Note that sample data for columns COLUMN.ID, COLUMN.TITLE, COLUMN.ATOM, and/or COLUMN.ATOMS will be added automatically if not explicitly included. Any other columns that are not included here will be set to their default width.
Type:
dict
Value:
{}

_DEFAULT_SAMPLE_DATA

A dictionary of {column name (attribute in the COLUMN class variable): sample cell contents}. The sample cell contents are used to set column widths appropriately. If no column of the specified name is found, the sample data will be ignored. Data found in SAMPLE_DATA takes precedence over data found in _DEFAULT_SAMPLE_DATA. Subclasses should alter SAMPLE_DATA rather than _DEFAULT_SAMPLE_DATA whenever possible (due to increased ease of debugging typos).
Type:
dict
Value:
{"ID": "999", "TITLE": "This is a very long entry title", "ATOM": "C99\
9", "ATOMS": "C99, C99, C99, C99"}