Skip to content

PythonQt.QtGui.QAbstractItemView · declarations 005

Back to PythonQt.QtGui.QAbstractItemView

selectionBehavior instance-attribute

selectionBehavior: Any

Qt 5 reference:

selectionBehavior : SelectionBehavior

This property holds which selection behavior the view uses

This property holds whether selections are done in terms of single items, rows or columns.

Access functions:

QAbstractItemView::SelectionBehavior selectionBehavior() const
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)

See also SelectionMode and SelectionBehavior.

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#selectionBehavior

selectionCommand

selectionCommand(index: Any, event: Any) -> Any

X.selectionCommand(index, event)

Supplemental documentation: Qt 5 reference:

[virtual protected] QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QModelIndex \&index, const QEvent *event \= nullptr) const

Returns the SelectionFlags to be used when updating a selection with to include the index specified. The event is a user input event, such as a mouse or keyboard event.

Reimplement this function to define your own selection behavior.

See also setSelection().

Upstream PySide2 reference signatures (binding differences may apply):

selectionCommand(self, index: PySide2.QtCore.QModelIndex, event: typing.Optional[PySide2.QtCore.QEvent]=...) -> PySide2.QtCore.QItemSelectionModel.SelectionFlags

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#selectionCommand

selectionMode instance-attribute

selectionMode: Any

Qt 5 reference:

selectionMode : SelectionMode

This property holds which selection mode the view operates in

This property controls whether the user can select one or many items and, in many-item selections, whether the selection must be a continuous range of items.

Access functions:

QAbstractItemView::SelectionMode selectionMode() const
void setSelectionMode(QAbstractItemView::SelectionMode mode)

See also SelectionMode and SelectionBehavior.

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#selectionMode

selectionModel

selectionModel() -> Any

X.selectionModel() -> PythonQt.QtGui.QItemSelectionModel

Supplemental documentation: Qt 5 reference:

QItemSelectionModel *QAbstractItemView::selectionModel() const

Returns the current selection model.

See also setSelectionModel() and selectedIndexes().

Upstream PySide2 reference signatures (binding differences may apply):

selectionModel(self) -> PySide2.QtCore.QItemSelectionModel

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#selectionModel

setAlternatingRowColors

setAlternatingRowColors(enable: bool) -> None

X.setAlternatingRowColors(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setAlternatingRowColors(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setAlternatingRowColors

setAutoScroll

setAutoScroll(enable: bool) -> None

X.setAutoScroll(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setAutoScroll(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setAutoScroll

setAutoScrollMargin

setAutoScrollMargin(margin: int) -> None

X.setAutoScrollMargin(margin)

Upstream PySide2 reference signatures (binding differences may apply):

setAutoScrollMargin(self, margin: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setAutoScrollMargin

setCornerWidget

setCornerWidget(widget: Any) -> Any

X.setCornerWidget(widget)

setCurrentIndex

setCurrentIndex(index: Any) -> None

X.setCurrentIndex(index)

Supplemental documentation: Qt 5 reference:

[slot] void QAbstractItemView::setCurrentIndex(const QModelIndex \&index)

Sets the current item to be the item at index.

Unless the current selection mode is NoSelection, the item is also selected. Note that this function also updates the starting position for any new selections the user performs.

To set an item as the current item without selecting it, call

selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);

See also currentIndex(), currentChanged(), and selectionMode.

Upstream PySide2 reference signatures (binding differences may apply):

setCurrentIndex(self, index: PySide2.QtCore.QModelIndex) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setCurrentIndex

setDefaultDropAction

setDefaultDropAction(dropAction: Any) -> None

X.setDefaultDropAction(dropAction)

Upstream PySide2 reference signatures (binding differences may apply):

setDefaultDropAction(self, dropAction: PySide2.QtCore.Qt.DropAction) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDefaultDropAction

setDirtyRegion

setDirtyRegion(region: Any) -> None

X.setDirtyRegion(region)

Supplemental documentation: Qt 5 reference:

[protected] void QAbstractItemView::setDirtyRegion(const QRegion \&region)

Marks the given region as dirty and schedules it to be updated. You only need to call this function if you are implementing your own view subclass.

This function was introduced in Qt 4.1.

See also scrollDirtyRegion() and dirtyRegionOffset().

Upstream PySide2 reference signatures (binding differences may apply):

setDirtyRegion(self, region: PySide2.QtGui.QRegion) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDirtyRegion

setDragDropMode

setDragDropMode(behavior: Any) -> None

X.setDragDropMode(behavior)

Upstream PySide2 reference signatures (binding differences may apply):

setDragDropMode(self, behavior: PySide2.QtWidgets.QAbstractItemView.DragDropMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDragDropMode

setDragDropOverwriteMode

setDragDropOverwriteMode(overwrite: bool) -> None

X.setDragDropOverwriteMode(overwrite)

Upstream PySide2 reference signatures (binding differences may apply):

setDragDropOverwriteMode(self, overwrite: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDragDropOverwriteMode

setDragEnabled

setDragEnabled(enable: bool) -> None

X.setDragEnabled(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setDragEnabled(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDragEnabled

setDropIndicatorShown

setDropIndicatorShown(enable: bool) -> None

X.setDropIndicatorShown(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setDropIndicatorShown(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setDropIndicatorShown

setEditTriggers

setEditTriggers(triggers: Any) -> None

X.setEditTriggers(triggers)

Upstream PySide2 reference signatures (binding differences may apply):

setEditTriggers(self, triggers: PySide2.QtWidgets.QAbstractItemView.EditTriggers) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setEditTriggers

setFrameRect

setFrameRect(arg__1: Any) -> Any

X.setFrameRect(arg__1)

setFrameShadow

setFrameShadow(arg__1: Any) -> Any

X.setFrameShadow(arg__1)

setFrameShape

setFrameShape(arg__1: Any) -> Any

X.setFrameShape(arg__1)

setFrameStyle

setFrameStyle(arg__1: Any) -> Any

X.setFrameStyle(arg__1)

setHorizontalScrollBar

setHorizontalScrollBar(scrollbar: Any) -> Any

X.setHorizontalScrollBar(scrollbar)

setHorizontalScrollBarPolicy

setHorizontalScrollBarPolicy(arg__1: Any) -> Any

X.setHorizontalScrollBarPolicy(arg__1)

setHorizontalScrollMode

setHorizontalScrollMode(mode: Any) -> None

X.setHorizontalScrollMode(mode)

Upstream PySide2 reference signatures (binding differences may apply):

setHorizontalScrollMode(self, mode: PySide2.QtWidgets.QAbstractItemView.ScrollMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setHorizontalScrollMode

setIconSize

setIconSize(size: Any) -> None

X.setIconSize(size)

Upstream PySide2 reference signatures (binding differences may apply):

setIconSize(self, size: PySide2.QtCore.QSize) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setIconSize

setIndexWidget

setIndexWidget(index: Any, widget: Any) -> None

X.setIndexWidget(index, widget)

Supplemental documentation: Qt 5 reference:

void QAbstractItemView::setIndexWidget(const QModelIndex \&index, QWidget *widget)

Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport.

If index is invalid (e.g., if you pass the root index), this function will do nothing.

The given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the item at the given index.

If index widget A is replaced with index widget B, index widget A will be deleted. For example, in the code snippet below, the QLineEdit object will be deleted.

setIndexWidget(index, new QLineEdit);
...
setIndexWidget(index, new QTextEdit);

This function should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass QStyledItemDelegate instead.

This function was introduced in Qt 4.1.

See also indexWidget() and Delegate Classes.

Upstream PySide2 reference signatures (binding differences may apply):

setIndexWidget(self, index: PySide2.QtCore.QModelIndex, widget: PySide2.QtWidgets.QWidget) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setIndexWidget

setItemDelegate

setItemDelegate(delegate: Any) -> None

X.setItemDelegate(delegate)

Supplemental documentation: Qt 5 reference:

void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)

Sets the item delegate for this view and its model to delegate. This is useful if you want complete control over the editing and display of items.

Any existing delegate will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

See also itemDelegate().

Upstream PySide2 reference signatures (binding differences may apply):

setItemDelegate(self, delegate: PySide2.QtWidgets.QAbstractItemDelegate) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setItemDelegate

setItemDelegateForColumn

setItemDelegateForColumn(column: int, delegate: Any) -> None

X.setItemDelegateForColumn(column, delegate)

Supplemental documentation: Qt 5 reference:

void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate)

Sets the given item delegate used by this view and model for the given column. All items on column will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Any existing column delegate for column will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Note: If a delegate has been assigned to both a row and a column, the row delegate will take precedence and manage the intersecting cell index.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

This function was introduced in Qt 4.2.

See also itemDelegateForColumn(), setItemDelegateForRow(), and itemDelegate().

Upstream PySide2 reference signatures (binding differences may apply):

setItemDelegateForColumn(self, column: int, delegate: PySide2.QtWidgets.QAbstractItemDelegate) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setItemDelegateForColumn

setItemDelegateForRow

setItemDelegateForRow(row: int, delegate: Any) -> None

X.setItemDelegateForRow(row, delegate)

Supplemental documentation: Qt 5 reference:

void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *delegate)

Sets the given item delegate used by this view and model for the given row. All items on row will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Any existing row delegate for row will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Note: If a delegate has been assigned to both a row and a column, the row delegate (i.e., this delegate) will take precedence and manage the intersecting cell index.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

This function was introduced in Qt 4.2.

See also itemDelegateForRow(), setItemDelegateForColumn(), and itemDelegate().

Upstream PySide2 reference signatures (binding differences may apply):

setItemDelegateForRow(self, row: int, delegate: PySide2.QtWidgets.QAbstractItemDelegate) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setItemDelegateForRow

setLineWidth

setLineWidth(arg__1: Any) -> Any

X.setLineWidth(arg__1)

setMidLineWidth

setMidLineWidth(arg__1: Any) -> Any

X.setMidLineWidth(arg__1)

setModel

setModel(model: Any) -> None

X.setModel(model)

Supplemental documentation: Qt 5 reference:

[virtual] void QAbstractItemView::setModel(QAbstractItemModel *model)

Sets the model for the view to present.

This function will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required. This is done with the following code:

QItemSelectionModel *m = view->selectionModel();
view->setModel(new model);
delete m;

If both the old model and the old selection model do not have parents, or if their parents are long-lived objects, it may be preferable to call their deleteLater() functions to explicitly delete them.

The view does not take ownership of the model unless it is the model's parent object because the model may be shared between many different views.

See also model(), selectionModel(), and setSelectionModel().

Upstream PySide2 reference signatures (binding differences may apply):

setModel(self, model: PySide2.QtCore.QAbstractItemModel) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setModel

setRootIndex

setRootIndex(index: Any) -> None

X.setRootIndex(index)

Supplemental documentation: Qt 5 reference:

[virtual slot] void QAbstractItemView::setRootIndex(const QModelIndex \&index)

Sets the root item to the item at the given index.

See also rootIndex().

Upstream PySide2 reference signatures (binding differences may apply):

setRootIndex(self, index: PySide2.QtCore.QModelIndex) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setRootIndex

setSelection

setSelection(rect: Any, command: Any) -> None

X.setSelection(rect, command)

Supplemental documentation: Qt 5 reference:

[pure virtual protected] void QAbstractItemView::setSelection(const QRect \&rect, QItemSelectionModel::SelectionFlags flags)

Applies the selection flags to the items in or touched by the rectangle, rect.

When implementing your own itemview setSelection should call selectionModel()->select(selection, flags) where selection is either an empty QModelIndex or a QItemSelection that contains all items that are contained in rect.

See also selectionCommand() and selectedIndexes().

Upstream PySide2 reference signatures (binding differences may apply):

setSelection(self, rect: PySide2.QtCore.QRect, command: PySide2.QtCore.QItemSelectionModel.SelectionFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setSelection

setSelectionBehavior

setSelectionBehavior(behavior: Any) -> None

X.setSelectionBehavior(behavior)

Upstream PySide2 reference signatures (binding differences may apply):

setSelectionBehavior(self, behavior: PySide2.QtWidgets.QAbstractItemView.SelectionBehavior) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setSelectionBehavior

setSelectionMode

setSelectionMode(mode: Any) -> None

X.setSelectionMode(mode)

Upstream PySide2 reference signatures (binding differences may apply):

setSelectionMode(self, mode: PySide2.QtWidgets.QAbstractItemView.SelectionMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setSelectionMode

setSelectionModel

setSelectionModel(selectionModel: Any) -> None

X.setSelectionModel(selectionModel)

Supplemental documentation: Qt 5 reference:

[virtual] void QAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel)

Sets the current selection model to the given selectionModel.

Note that, if you call setModel() after this function, the given selectionModel will be replaced by one created by the view.

Note: It is up to the application to delete the old selection model if it is no longer needed; i.e., if it is not being used by other views. This will happen automatically when its parent object is deleted. However, if it does not have a parent, or if the parent is a long-lived object, it may be preferable to call its deleteLater() function to explicitly delete it.

See also selectionModel(), setModel(), and clearSelection().

Upstream PySide2 reference signatures (binding differences may apply):

setSelectionModel(self, selectionModel: PySide2.QtCore.QItemSelectionModel) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setSelectionModel

setSizeAdjustPolicy

setSizeAdjustPolicy(policy: Any) -> Any

X.setSizeAdjustPolicy(policy)

setState

setState(state: Any) -> None

X.setState(state)

Supplemental documentation: Qt 5 reference:

[protected] void QAbstractItemView::setState(QAbstractItemView::State state)

Sets the item view's state to the given state.

See also state().

Upstream PySide2 reference signatures (binding differences may apply):

setState(self, state: PySide2.QtWidgets.QAbstractItemView.State) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setState

setTabKeyNavigation

setTabKeyNavigation(enable: bool) -> None

X.setTabKeyNavigation(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setTabKeyNavigation(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setTabKeyNavigation

setTextElideMode

setTextElideMode(mode: Any) -> None

X.setTextElideMode(mode)

Upstream PySide2 reference signatures (binding differences may apply):

setTextElideMode(self, mode: PySide2.QtCore.Qt.TextElideMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qabstractitemview.html#setTextElideMode