Skip to content

PythonQt.QtGui.QItemSelectionModel

QItemSelectionModel

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A QItemSelectionModel keeps track of the selected items in a view, or in several views onto the same model. It also keeps track of the currently selected item in a view.

The QItemSelectionModel class is one of the Model/View Classes and is part of Qt's model/view framework.

The selected items are stored using ranges. Whenever you want to modify the selected items use select() and provide either a QItemSelection, or a QModelIndex and a QItemSelectionModel::SelectionFlag.

The QItemSelectionModel takes a two layer approach to selection management, dealing with both selected items that have been committed and items that are part of the current selection. The current selected items are part of the current interactive selection (for example with rubber-band selection or keyboard-shift selections).

To update the currently selected items, use the bitwise OR of QItemSelectionModel::Current and any of the other SelectionFlags. If you omit the QItemSelectionModel::Current command, a new current selection will be created, and the previous one added to the whole selection. All functions operate on both layers; for example, selecteditems() will return items from both layers.

Note: Since 5.5, model, hasSelection, and currentIndex are meta-object properties.

Source: https://doc.qt.io/archives/qt-5.15/qitemselectionmodel.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
Clear attribute Any
ClearAndSelect attribute Any
Columns attribute Any
Current attribute Any
Deselect attribute Any
NoUpdate attribute Any
Rows attribute Any
Select attribute Any
SelectCurrent attribute Any
SelectionFlag attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
SelectionFlags attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
Toggle attribute Any
ToggleCurrent attribute Any
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
blockSignals function (self, b: Any) -> bool X.blockSignals(b) -> bool (shared captured text)
childEvent function (self, event: Any) -> Any (shared captured text)
children function (self) -> tuple X.children() -> tuple (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clear function (self) -> None Clears the selection model.
clearCurrentIndex function (self) -> None Clears the current index.
clearSelection function (self) -> None Clears the selection in the selection model.
columnIntersectsSelection function (self, column: int, parent: Any) -> bool X.columnIntersectsSelection(column, parent) -> bool
connect function (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool X.connect(signal, receiver, slot, type) -> bool (shared captured text)
currentChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.currentChanged; argument details are not documented.
currentColumnChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.currentColumnChanged; argument details are not documented.
currentIndex attribute QModelIndex Returns the model item index for the current item, or an invalid index if there is no current item.
currentRowChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.currentRowChanged; argument details are not documented.
customEvent function (self, event: Any) -> Any (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
deleteLater function (self) -> Any (shared captured text)
destroyed function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.destroyed; argument details are not documented.
disconnect function (self, signal: Any, receiver: Any, slot: Any) -> bool X.disconnect(signal, receiver, slot) -> bool (shared captured text)
dumpObjectInfo function (self) -> Any (shared captured text)
dumpObjectTree function (self) -> Any (shared captured text)
dynamicPropertyNames function (self) -> Any (shared captured text)
emitSelectionChanged function (self, newSelection: Any, oldSelection: Any) -> None X.emitSelectionChanged(newSelection, oldSelection)
event function (self, event: Any) -> bool X.event(event) -> bool (shared captured text)
eventFilter function (self, watched: Any, event: Any) -> bool X.eventFilter(watched, event) -> bool (shared captured text)
findChild function (self, type: Any, name: Any) -> Any X.findChild(type, name) -> PythonQt.private.QObject (shared captured text)
findChildren function (self, type: Any, name: Any) -> tuple X.findChildren(type, name) -> tuple (shared captured text)
hasSelection attribute bool Returns true if the selection model contains any selection ranges; otherwise returns false.
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
installEventFilter function (self, filterObj: Any) -> Any (shared captured text)
isColumnSelected function (self, column: int, parent: Any) -> bool X.isColumnSelected(column, parent) -> bool
isRowSelected function (self, row: int, parent: Any) -> bool X.isRowSelected(row, parent) -> bool
isSelected function (self, index: Any) -> bool X.isSelected(index) -> bool
isSignalConnected function (self, signal: Any) -> bool X.isSignalConnected(signal) -> bool (shared captured text)
isWidgetType function (self) -> bool X.isWidgetType() -> bool (shared captured text)
isWindowType function (self) -> bool X.isWindowType() -> bool (shared captured text)
killTimer function (self, id: Any) -> Any (shared captured text)
metaObject function (self) -> Any X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text)
model attribute QAbstractItemModel Returns the item model operated on by the selection model.
modelChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.modelChanged; argument details are not documented.
moveToThread function (self, thread: Any) -> Any (shared captured text)
objectName attribute Any (shared captured text)
objectNameChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.objectNameChanged; argument details are not documented.
parent function (self) -> Any X.parent() -> PythonQt.private.QObject (shared captured text)
property function (self, name: Any) -> Any X.property(name) -> object (shared captured text)
removeEventFilter function (self, obj: Any) -> Any (shared captured text)
reset function (self) -> None Clears the selection model.
rowIntersectsSelection function (self, row: int, parent: Any) -> bool X.rowIntersectsSelection(row, parent) -> bool
select function (self, selection: Any, command: Any) -> None X.select(selection, command)
selectedColumns function (self, row: int) -> tuple X.selectedColumns(row) -> tuple
selectedIndexes attribute Any This property was introduced in Qt 5.5.
selectedRows function (self, column: int) -> tuple X.selectedRows(column) -> tuple
selection attribute QItemSelection Returns the selection ranges stored in the selection model.
selectionChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.QtGui.QItemSelectionModel.selectionChanged; argument details are not documented.
sender function (self) -> Any X.sender() -> PythonQt.private.QObject (shared captured text)
senderSignalIndex function (self) -> int X.senderSignalIndex() -> int (shared captured text)
setCurrentIndex function (self, index: Any, command: Any) -> None X.setCurrentIndex(index, command)
setModel function (self, model: Any) -> None Sets the model to model.
setObjectName function (self, name: Any) -> Any (shared captured text)
setParent function (self, parent: Any) -> Any (shared captured text)
setProperty function (self, name: Any, value: Any) -> bool X.setProperty(name, value) -> bool (shared captured text)
signalsBlocked function (self) -> bool X.signalsBlocked() -> bool (shared captured text)
startTimer function (self, interval: Any, timerType: Any) -> int X.startTimer(interval, timerType) -> int (shared captured text)
thread function (self) -> Any (shared captured text)
timerEvent function (self, event: Any) -> Any (shared captured text)
tr function (self, text: Any, ambig: Any, n: Any) -> str X.tr(text, ambig, n) -> str (shared captured text)