Skip to content

PythonQt.QtGui.QStandardItem · declarations 002

Back to PythonQt.QtGui.QStandardItem

rowCount

rowCount() -> int

X.rowCount() -> int

Supplemental documentation: Qt 5 reference:

int QStandardItem::rowCount() const

Returns the number of child item rows that the item has.

See also setRowCount() and columnCount().

Upstream PySide2 reference signatures (binding differences may apply):

rowCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#rowCount

setAccessibleDescription

setAccessibleDescription(accessibleDescription: str) -> None

X.setAccessibleDescription(accessibleDescription)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setAccessibleDescription(const QString \&accessibleDescription)

Sets the item's accessible description to the string specified by accessibleDescription.

The accessible description is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See also accessibleDescription() and setAccessibleText().

Upstream PySide2 reference signatures (binding differences may apply):

setAccessibleDescription(self, accessibleDescription: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setAccessibleDescription

setAccessibleText

setAccessibleText(accessibleText: str) -> None

X.setAccessibleText(accessibleText)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setAccessibleText(const QString \&accessibleText)

Sets the item's accessible text to the string specified by accessibleText.

The accessible text is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See also accessibleText() and setAccessibleDescription().

Upstream PySide2 reference signatures (binding differences may apply):

setAccessibleText(self, accessibleText: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setAccessibleText

setAutoTristate

setAutoTristate(tristate: bool) -> None

X.setAutoTristate(tristate)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setAutoTristate(bool tristate)

Determines that the item is tristate and controlled by QTreeWidget if tristate is true. This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked).

This function was introduced in Qt 5.6.

See also isAutoTristate(), setCheckable(), and setCheckState().

Upstream PySide2 reference signatures (binding differences may apply):

setAutoTristate(self, tristate: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setAutoTristate

setBackground

setBackground(brush: Any) -> None

X.setBackground(brush)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setBackground(const QBrush \&brush)

Sets the item's background brush to the specified brush.

See also background() and setForeground().

Upstream PySide2 reference signatures (binding differences may apply):

setBackground(self, brush: PySide2.QtGui.QBrush) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setBackground

setCheckState

setCheckState(checkState: Any) -> None

X.setCheckState(checkState)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setCheckState(Qt::CheckState state)

Sets the check state of the item to be state.

See also checkState() and setCheckable().

Upstream PySide2 reference signatures (binding differences may apply):

setCheckState(self, checkState: PySide2.QtCore.Qt.CheckState) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setCheckState

setCheckable

setCheckable(checkable: bool) -> None

X.setCheckable(checkable)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setCheckable(bool checkable)

Sets whether the item is user-checkable. If checkable is true, the item can be checked by the user; otherwise, the user cannot check the item.

The item delegate will render a checkable item with a check box next to the item's text.

See also isCheckable(), setCheckState(), setUserTristate(), and setAutoTristate().

Upstream PySide2 reference signatures (binding differences may apply):

setCheckable(self, checkable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setCheckable

setChild

setChild(row: int, column: Any, item: Any) -> None

X.setChild(row, column, item)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setChild(int row, int column, QStandardItem *item)

Sets the child item at (row, column) to item. This item (the parent item) takes ownership of item. If necessary, the row count and column count are increased to fit the item.

Note: Passing nullptr as item removes the item.

See also child().

void QStandardItem::setChild(int row, QStandardItem *item)

This is an overloaded function.

Sets the child at row to item.

Upstream PySide2 reference signatures (binding differences may apply):

setChild(self, row: int, column: int, item: PySide2.QtGui.QStandardItem) -> None
setChild(self, row: int, item: PySide2.QtGui.QStandardItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setChild

setColumnCount

setColumnCount(columns: int) -> None

X.setColumnCount(columns)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setColumnCount(int columns)

Sets the number of child item columns to columns. If this is less than columnCount(), the data in the unwanted columns is discarded.

See also columnCount() and setRowCount().

Upstream PySide2 reference signatures (binding differences may apply):

setColumnCount(self, columns: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setColumnCount

setData

setData(value: Any, role: int) -> None

X.setData(value, role)

Supplemental documentation: Qt 5 reference:

[virtual] void QStandardItem::setData(const QVariant \&value, int role \= Qt::UserRole + 1)

Sets the item's data for the given role to the specified value.

If you subclass QStandardItem and reimplement this function, your reimplementation should:

  • call emitDataChanged() if you do not call the base implementation of setData(). This will ensure that e.g. views using the model are notified of the changes
  • call the base implementation for roles you don't handle, otherwise setting flags, e.g. by calling setFlags(), setCheckable(), setEditable() etc., will not work.

Note: The default implementation treats Qt::EditRole and Qt::DisplayRole as referring to the same data.

See also Qt::ItemDataRole, data(), and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setData(self, value: typing.Any, role: int=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setData

setDragEnabled

setDragEnabled(dragEnabled: bool) -> None

X.setDragEnabled(dragEnabled)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setDragEnabled(bool dragEnabled)

Sets whether the item is drag enabled. If dragEnabled is true, the item can be dragged by the user; otherwise, the user cannot drag the item.

Note that you also need to ensure that item dragging is enabled in the view; see QAbstractItemView::dragEnabled.

See also isDragEnabled(), setDropEnabled(), and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setDragEnabled(self, dragEnabled: bool) -> None

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

setDropEnabled

setDropEnabled(dropEnabled: bool) -> None

X.setDropEnabled(dropEnabled)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setDropEnabled(bool dropEnabled)

Sets whether the item is drop enabled. If dropEnabled is true, the item can be used as a drop target; otherwise, it cannot.

Note that you also need to ensure that drops are enabled in the view; see QWidget::acceptDrops(); and that the model supports the desired drop actions; see QAbstractItemModel::supportedDropActions().

See also isDropEnabled(), setDragEnabled(), and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setDropEnabled(self, dropEnabled: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setDropEnabled

setEditable

setEditable(editable: bool) -> None

X.setEditable(editable)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setEditable(bool editable)

Sets whether the item is editable. If editable is true, the item can be edited by the user; otherwise, the user cannot edit the item.

How the user can edit items in a view is determined by the view's edit triggers; see QAbstractItemView::editTriggers.

See also isEditable() and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setEditable(self, editable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setEditable

setEnabled

setEnabled(enabled: bool) -> None

X.setEnabled(enabled)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setEnabled(bool enabled)

Sets whether the item is enabled. If enabled is true, the item is enabled, meaning that the user can interact with the item; if enabled is false, the user cannot interact with the item.

This flag takes precedence over the other item flags; e.g. if an item is not enabled, it cannot be selected by the user, even if the Qt::ItemIsSelectable flag has been set.

See also isEnabled(), Qt::ItemIsEnabled, and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setEnabled(self, enabled: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setEnabled

setFlags

setFlags(arg0: flags) -> None

X.setFlags(flags)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setFlags(Qt::ItemFlags flags)

Sets the item flags for the item to flags.

The item flags determine how the user can interact with the item. This is often used to disable an item.

See also flags() and setData().

Upstream PySide2 reference signatures (binding differences may apply):

setFlags(self, flags: PySide2.QtCore.Qt.ItemFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setFlags

setFont

setFont(font: Any) -> None

X.setFont(font)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setFont(const QFont \&font)

Sets the font used to display the item's text to the given font.

See also font(), setText(), and setForeground().

Upstream PySide2 reference signatures (binding differences may apply):

setFont(self, font: PySide2.QtGui.QFont) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setFont

setForeground

setForeground(brush: Any) -> None

X.setForeground(brush)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setForeground(const QBrush \&brush)

Sets the brush used to display the item's foreground (e.g. text) to the given brush.

See also foreground(), setBackground(), and setFont().

Upstream PySide2 reference signatures (binding differences may apply):

setForeground(self, brush: PySide2.QtGui.QBrush) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setForeground

setIcon

setIcon(icon: Any) -> None

X.setIcon(icon)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setIcon(const QIcon \&icon)

Sets the item's icon to the icon specified.

See also icon().

Upstream PySide2 reference signatures (binding differences may apply):

setIcon(self, icon: PySide2.QtGui.QIcon) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setIcon

setRowCount

setRowCount(rows: int) -> None

X.setRowCount(rows)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setRowCount(int rows)

Sets the number of child item rows to rows. If this is less than rowCount(), the data in the unwanted rows is discarded.

See also rowCount() and setColumnCount().

Upstream PySide2 reference signatures (binding differences may apply):

setRowCount(self, rows: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setRowCount

setSelectable

setSelectable(selectable: bool) -> None

X.setSelectable(selectable)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setSelectable(bool selectable)

Sets whether the item is selectable. If selectable is true, the item can be selected by the user; otherwise, the user cannot select the item.

You can control the selection behavior and mode by manipulating their view properties; see QAbstractItemView::selectionMode and QAbstractItemView::selectionBehavior.

See also isSelectable() and setFlags().

Upstream PySide2 reference signatures (binding differences may apply):

setSelectable(self, selectable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setSelectable

setSizeHint

setSizeHint(sizeHint: Any) -> None

X.setSizeHint(sizeHint)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setSizeHint(const QSize \&size)

Sets the size hint for the item to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

See also sizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

setSizeHint(self, sizeHint: PySide2.QtCore.QSize) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setSizeHint

setStatusTip

setStatusTip(statusTip: str) -> None

X.setStatusTip(statusTip)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setStatusTip(const QString \&statusTip)

Sets the item's status tip to the string specified by statusTip.

See also statusTip(), setToolTip(), and setWhatsThis().

Upstream PySide2 reference signatures (binding differences may apply):

setStatusTip(self, statusTip: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setStatusTip

setText

setText(text: str) -> None

X.setText(text)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setText(const QString \&text)

Sets the item's text to the text specified.

See also text(), setFont(), and setForeground().

Upstream PySide2 reference signatures (binding differences may apply):

setText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setText

setTextAlignment

setTextAlignment(textAlignment: Any) -> None

X.setTextAlignment(textAlignment)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setTextAlignment(Qt::Alignment alignment)

Sets the text alignment for the item's text to the alignment specified.

See also textAlignment().

Upstream PySide2 reference signatures (binding differences may apply):

setTextAlignment(self, textAlignment: PySide2.QtCore.Qt.Alignment) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setTextAlignment

setToolTip

setToolTip(toolTip: str) -> None

X.setToolTip(toolTip)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setToolTip(const QString \&toolTip)

Sets the item's tooltip to the string specified by toolTip.

See also toolTip(), setStatusTip(), and setWhatsThis().

Upstream PySide2 reference signatures (binding differences may apply):

setToolTip(self, toolTip: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setToolTip

setTristate

setTristate(tristate: bool) -> None

X.setTristate(tristate)

Upstream PySide2 reference signatures (binding differences may apply):

setTristate(self, tristate: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setTristate

setUserTristate

setUserTristate(tristate: bool) -> None

X.setUserTristate(tristate)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setUserTristate(bool tristate)

Sets whether the item is tristate and controlled by the user. If tristate is true, the user can cycle through three separate states; otherwise, the item is checkable with two states. (Note that this also requires that the item is checkable; see isCheckable().)

This function was introduced in Qt 5.6.

See also isUserTristate(), setCheckable(), and setCheckState().

Upstream PySide2 reference signatures (binding differences may apply):

setUserTristate(self, tristate: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setUserTristate

setWhatsThis

setWhatsThis(whatsThis: str) -> None

X.setWhatsThis(whatsThis)

Supplemental documentation: Qt 5 reference:

void QStandardItem::setWhatsThis(const QString \&whatsThis)

Sets the item's "What's This?" help to the string specified by whatsThis.

See also whatsThis(), setStatusTip(), and setToolTip().

Upstream PySide2 reference signatures (binding differences may apply):

setWhatsThis(self, whatsThis: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#setWhatsThis

sizeHint

sizeHint() -> Any

X.sizeHint() -> PythonQt.QtCore.QSize

Supplemental documentation: Qt 5 reference:

QSize QStandardItem::sizeHint() const

Returns the size hint set for the item, or an invalid QSize if no size hint has been set.

If no size hint has been set, the item delegate will compute the size hint based on the item data.

See also setSizeHint().

Upstream PySide2 reference signatures (binding differences may apply):

sizeHint(self) -> PySide2.QtCore.QSize

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#sizeHint

sortChildren

sortChildren(column: int, order: Any) -> None

X.sortChildren(column, order)

Supplemental documentation: Qt 5 reference:

void QStandardItem::sortChildren(int column, Qt::SortOrder order \= Qt::AscendingOrder)

Sorts the children of the item using the given order, by the values in the given column.

Note: This function is recursive, therefore it sorts the children of the item, its grandchildren, etc.

See also operator\<().

Upstream PySide2 reference signatures (binding differences may apply):

sortChildren(self, column: int, order: PySide2.QtCore.Qt.SortOrder=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#sortChildren

statusTip

statusTip() -> str

X.statusTip() -> str

Supplemental documentation: Qt 5 reference:

QString QStandardItem::statusTip() const

Returns the item's status tip.

See also setStatusTip(), toolTip(), and whatsThis().

Upstream PySide2 reference signatures (binding differences may apply):

statusTip(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#statusTip

takeChild

takeChild(row: int, column: int) -> Any

X.takeChild(row, column) -> PythonQt.QtGui.QStandardItem

Supplemental documentation: Qt 5 reference:

QStandardItem *QStandardItem::takeChild(int row, int column \= 0)

Removes the child item at (row, column) without deleting it, and returns a pointer to the item. If there was no child at the given location, then this function returns nullptr.

Note that this function, unlike takeRow() and takeColumn(), does not affect the dimensions of the child table.

See also child(), takeRow(), and takeColumn().

Upstream PySide2 reference signatures (binding differences may apply):

takeChild(self, row: int, column: int=...) -> PySide2.QtGui.QStandardItem

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#takeChild

takeColumn

takeColumn(column: int) -> tuple

X.takeColumn(column) -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QStandardItem *> QStandardItem::takeColumn(int column)

Removes column without deleting the column items, and returns a list of pointers to the removed items. For items in the column that have not been set, the corresponding pointers in the list will be nullptr.

See also removeColumn(), insertColumn(), and takeRow().

Upstream PySide2 reference signatures (binding differences may apply):

takeColumn(self, column: int) -> typing.List[PySide2.QtGui.QStandardItem]

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#takeColumn

takeRow

takeRow(row: int) -> tuple

X.takeRow(row) -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QStandardItem *> QStandardItem::takeRow(int row)

Removes row without deleting the row items, and returns a list of pointers to the removed items. For items in the row that have not been set, the corresponding pointers in the list will be nullptr.

See also removeRow(), insertRow(), and takeColumn().

Upstream PySide2 reference signatures (binding differences may apply):

takeRow(self, row: int) -> typing.List[PySide2.QtGui.QStandardItem]

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#takeRow

text

text() -> str

X.text() -> str

Supplemental documentation: Qt 5 reference:

QString QStandardItem::text() const

Returns the item's text. This is the text that's presented to the user in a view.

See also setText().

Upstream PySide2 reference signatures (binding differences may apply):

text(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#text

textAlignment

textAlignment() -> Any

X.textAlignment()

Supplemental documentation: Qt 5 reference:

Qt::Alignment QStandardItem::textAlignment() const

Returns the text alignment for the item's text.

See also setTextAlignment().

Upstream PySide2 reference signatures (binding differences may apply):

textAlignment(self) -> PySide2.QtCore.Qt.Alignment

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#textAlignment

toolTip

toolTip() -> str

X.toolTip() -> str

Supplemental documentation: Qt 5 reference:

QString QStandardItem::toolTip() const

Returns the item's tooltip.

See also setToolTip(), statusTip(), and whatsThis().

Upstream PySide2 reference signatures (binding differences may apply):

toolTip(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#toolTip

type

type() -> int

X.type() -> int

Supplemental documentation: Qt 5 reference:

[virtual] int QStandardItem::type() const

Returns the type of this item. The type is used to distinguish custom items from the base class. When subclassing QStandardItem, you should reimplement this function and return a new value greater than or equal to UserType.

See also QStandardItem::Type.

Upstream PySide2 reference signatures (binding differences may apply):

type(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#type

whatsThis

whatsThis() -> str

X.whatsThis() -> str

Supplemental documentation: Qt 5 reference:

QString QStandardItem::whatsThis() const

Returns the item's "What's This?" help.

See also setWhatsThis(), toolTip(), and statusTip().

Upstream PySide2 reference signatures (binding differences may apply):

whatsThis(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#whatsThis

write

write(out: Any) -> None

X.write(out)

Supplemental documentation: Qt 5 reference:

[virtual] void QStandardItem::write(QDataStream \&out) const

Writes the item to stream out. Only the data and flags of the item are written, not the child items.

See also read().

Upstream PySide2 reference signatures (binding differences may apply):

write(self, out: PySide2.QtCore.QDataStream) -> None

Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.html#write