Package schrodinger :: Package application :: Package msv :: Package gui :: Module viewmodel :: Class ReorderingProxyModel
[hide private]
[frames] | no frames]

Class ReorderingProxyModel

                                                 object --+        
                                                          |        
ui.qt.table_speed_up.MultipleRolesRoleProxyPassthroughMixin --+    
                                                              |    
                                                     ProxyMixin --+
                                                                  |
                                 object --+                       |
                                          |                       |
                          sip.simplewrapper --+                   |
                                              |                   |
                                    sip.wrapper --+               |
                                                  |               |
                               PyQt5.QtCore.QObject --+           |
                                                      |           |
                        PyQt5.QtCore.QAbstractItemModel --+       |
                                                          |       |
                           PyQt5.QtCore.QAbstractProxyModel --+   |
                                                              |   |
                                                 NonNestedProxy --+
                                                                  |
                                                                 ReorderingProxyModel

A proxy for reordering rows in response to either sorting or drag and drop actions.

Nested Classes [hide private]

Inherited from ProxyMixin: __metaclass__

Inherited from PyQt5.QtCore.QAbstractItemModel: LayoutChangeHint

Instance Methods [hide private]
 
orderingChanged(...)
A signal emitted when the row ordering changes.
 
__init__(self, parent=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
setSourceModel(self, model)
 
_initializeReordering(self)
Populate self._to_source and self._from_source so that this proxy doesn't change the row ordering.
 
sortBy(self, sort_by, order=0)
Sort the table by the specified criteria.
 
_sort(self)
Sort the table by the current sort settings.
 
_sortWithSignals(self)
Sort the table by the current sort settings.
 
reorderRow(self, from_row, to_row)
Reorder a row in response to a drag and drop.
 
_updateFromSource(self, during_row_move=False)
Update self._from_source so it matches self._to_source.
 
mapFromSource(self, source_index)
 
mapToSource(self, proxy_index)
 
rowCount(self, parent=None)
 
columnCount(self, parent=None)
RowOrder
currentOrdering(self)
Returns the current row ordering
 
setOrdering(self, ordering)
Set current row ordering
 
setOrderingFromRowNums(self, row_nums)
Set the row ordering.
 
_modelDataChanged(self, top_left, bottom_right)
Respond to the dataChanged signal from the model.
 
_rowsAboutToBeInserted(self, parent, start, end)
Respond to the rowsAboutToBeInserted signal from the model.
 
_rowsInserted(self)
Respond to the rowsInserted signal from the model.
 
_rowsAboutToBeRemoved(self, parent, start, end)
Respond to the rowsAboutToBeRemoved signal from the model.
 
_rowsRemoved(self, parent, start, end)
Respond to the rowsRemoved signal from the model.
 
_modelReset(self)
Respond to the modelReset signal from the model.

Inherited from ProxyMixin: emitResidueSelection, getResidueDisplayMode, residueFormatChanged, residuesSelected, sourceModel

Inherited from ui.qt.table_speed_up.MultipleRolesRoleProxyPassthroughMixin: data

Inherited from NonNestedProxy: index, parent, resetCountCache

Inherited from PyQt5.QtCore.QAbstractProxyModel: buddy, canDropMimeData, canFetchMore, dropMimeData, fetchMore, flags, hasChildren, headerData, itemData, mapSelectionFromSource, mapSelectionToSource, mimeData, mimeTypes, resetInternalData, revert, setData, setHeaderData, setItemData, sibling, sort, sourceModelChanged, span, submit, supportedDragActions, supportedDropActions

Inherited from PyQt5.QtCore.QAbstractItemModel: beginInsertColumns, beginInsertRows, beginMoveColumns, beginMoveRows, beginRemoveColumns, beginRemoveRows, beginResetModel, changePersistentIndex, changePersistentIndexList, columnsAboutToBeInserted, columnsAboutToBeMoved, columnsAboutToBeRemoved, columnsInserted, columnsMoved, columnsRemoved, createIndex, dataChanged, decodeData, encodeData, endInsertColumns, endInsertRows, endMoveColumns, endMoveRows, endRemoveColumns, endRemoveRows, endResetModel, hasIndex, headerDataChanged, insertColumn, insertColumns, insertRow, insertRows, layoutAboutToBeChanged, layoutChanged, match, modelAboutToBeReset, modelReset, moveColumn, moveColumns, moveRow, moveRows, persistentIndexList, removeColumn, removeColumns, removeRow, removeRows, roleNames, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved

Inherited from PyQt5.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isSignalConnected, isWidgetType, isWindowType, killTimer, metaObject, moveToThread, objectName, objectNameChanged, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from PyQt5.QtCore.QAbstractItemModel: HorizontalSortHint, NoLayoutChangeHint, VerticalSortHint

Inherited from PyQt5.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

orderingChanged(...)

 
A signal emitted when the row ordering changes. If drag-and-drop has been used to reorder rows, this signal will be emitted whenever a row has been inserted or removed. Emitted with a Boolean indicating whether they "type" or row ordering has changed (i.e., whether the menus need to be updated).

__init__(self, parent=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setSourceModel(self, model)

 
Overrides: PyQt5.QtCore.QAbstractProxyModel.setSourceModel

sortBy(self, sort_by, order=0)

 

Sort the table by the specified criteria.

Parameters:
  • sort_by (SortBy or NoneType) - The category to use for sorting. If None, the original input order will be used.
  • order (int) - Whether the data should be sorted in ascending (Qt.AscendingOrder) or descending (Qt.DescendingOrder) order.

_sort(self)

 

Sort the table by the current sort settings. Note that this method will not emit layoutAboutToBeChanged or layoutChanged.

_sortWithSignals(self)

 

Sort the table by the current sort settings. This method will emit layoutAboutToBeChanged and layoutChanged.

reorderRow(self, from_row, to_row)

 

Reorder a row in response to a drag and drop.

Parameters:
  • from_row (int) - The row number of the row to move.
  • to_row (int) - The row number of where the row should be moved to.

_updateFromSource(self, during_row_move=False)

 

Update self._from_source so it matches self._to_source. If this function is called while we are in the middle of moving a row, we need to make _from_source one element longer than _to_source, since the row that's being moved has already been removed from _to_source.

Parameters:
  • during_row_move (bool) - If True, _from_source will be one element longer than _to_source.

mapFromSource(self, source_index)

 
Overrides: PyQt5.QtCore.QAbstractProxyModel.mapFromSource

mapToSource(self, proxy_index)

 
Overrides: PyQt5.QtCore.QAbstractProxyModel.mapToSource

rowCount(self, parent=None)

 
Overrides: PyQt5.QtCore.QAbstractItemModel.rowCount

columnCount(self, parent=None)

 
Overrides: PyQt5.QtCore.QAbstractItemModel.columnCount

currentOrdering(self)

 

Returns the current row ordering

Returns: RowOrder
A RowOrder object describing the current row ordering

setOrdering(self, ordering)

 

Set current row ordering

Parameters:

setOrderingFromRowNums(self, row_nums)

 

Set the row ordering.

Parameters:
  • ordering (list) - A list of row numbers

_modelDataChanged(self, top_left, bottom_right)

 

Respond to the dataChanged signal from the model. See the QAbstractItemModel.dataChanged signal documentation for argument documentation.

_rowsAboutToBeInserted(self, parent, start, end)

 

Respond to the rowsAboutToBeInserted signal from the model. See the QAbstractItemModel.rowsAboutToBeInserted signal documentation for argument documentation.

_rowsAboutToBeRemoved(self, parent, start, end)

 

Respond to the rowsAboutToBeRemoved signal from the model. See the QAbstractItemModel.rowsAboutToBeRemoved signal documentation for argument documentation.

_rowsRemoved(self, parent, start, end)

 

Respond to the rowsRemoved signal from the model. See the QAbstractProxyModel.rowsRemoved signal documentation for argument documentation.