PythonQt.QtGui.QStandardItem
QStandardItem
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
Items usually contain text, icons, or checkboxes.
Each item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each item can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().
By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling setFlags(). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.
You can store application-specific data in an item by calling setData().
Each item can have a two-dimensional table of child items. This makes it possible to build hierarchies of items. The typical hierarchy is the tree, in which case the child table is a table with a single column (a list).
The dimensions of the child table can be set with setRowCount() and setColumnCount(). Items can be positioned in the child table with setChild(). Get a pointer to a child item with child(). New rows and columns of children can also be inserted with insertRow() and insertColumn(), or appended with appendRow() and appendColumn(). When using the append and insert functions, the dimensions of the child table will grow as needed.
An existing row of children can be removed with removeRow() or takeRow(); correspondingly, a column can be removed with removeColumn() or takeColumn().
An item's children can be sorted by calling sortChildren().
Subclassing
When subclassing QStandardItem to provide custom items, it is possible to define new types for them so that they can be distinguished from the base class. The type() function should be reimplemented to return a new type value equal to or greater than UserType.
Reimplement data() and setData() if you want to perform custom handling of data queries and/or control how an item's data is represented.
Reimplement clone() if you want QStandardItemModel to be able to create instances of your custom item class on demand (see QStandardItemModel::setItemPrototype()).
Reimplement read() and write() if you want to control how items are represented in their serialized form.
Reimplement operator\<() if you want to control the semantics of item comparison. operator\<() determines the sorted order when sorting items with sortChildren() or with QStandardItemModel::sort().
Source: https://doc.qt.io/archives/qt-5.15/qstandarditem.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 |
|---|---|---|---|
ItemType |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
Type |
attribute | Any |
(shared captured text) |
UserType |
attribute | Any |
(shared captured text) |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
accessibleDescription |
function | (self) -> str |
X.accessibleDescription() -> str |
accessibleText |
function | (self) -> str |
X.accessibleText() -> str |
appendColumn |
function | (self, items: Any) -> None |
Appends a column containing items. |
appendRow |
function | (self, item: Any) -> None |
Appends a row containing items. |
appendRows |
function | (self, items: Any) -> None |
Appends rows containing items. |
background |
function | (self) -> Any |
X.background() -> PythonQt.QtGui.QBrush |
checkState |
function | (self) -> Any |
Returns the checked state of the item. |
child |
function | (self, row: int, column: int) -> Any |
X.child(row, column) -> PythonQt.QtGui.QStandardItem |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
clone |
function | (self) -> Any |
X.clone() -> PythonQt.QtGui.QStandardItem |
column |
function | (self) -> int |
X.column() -> int |
columnCount |
function | (self) -> int |
X.columnCount() -> int |
data |
function | (self, role: int) -> Any |
X.data(role) -> object |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
emitDataChanged |
function | (self) -> None |
Causes the model associated with this item to emit a [dataChanged](https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#dataChanged)() signal for this item. |
flags |
function | (self) -> Any |
Returns the item flags for the item. |
font |
function | (self) -> Any |
X.font() -> PythonQt.QtGui.QFont |
foreground |
function | (self) -> Any |
X.foreground() -> PythonQt.QtGui.QBrush |
hasChildren |
function | (self) -> bool |
X.hasChildren() -> bool |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
icon |
function | (self) -> Any |
X.icon() -> PythonQt.QtGui.QIcon |
index |
function | (self) -> Any |
X.index() -> PythonQt.QtCore.QModelIndex |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
insertColumn |
function | (self, column: int, items: Any) -> None |
X.insertColumn(column, items) |
insertColumns |
function | (self, column: int, count: int) -> None |
X.insertColumns(column, count) |
insertRow |
function | (self, row: int, item: Any) -> None |
X.insertRow(row, item) |
insertRows |
function | (self, row: int, items: Any) -> None |
X.insertRows(row, items) |
isAutoTristate |
function | (self) -> bool |
X.isAutoTristate() -> bool |
isCheckable |
function | (self) -> bool |
X.isCheckable() -> bool |
isDragEnabled |
function | (self) -> bool |
X.isDragEnabled() -> bool |
isDropEnabled |
function | (self) -> bool |
X.isDropEnabled() -> bool |
isEditable |
function | (self) -> bool |
X.isEditable() -> bool |
isEnabled |
function | (self) -> bool |
X.isEnabled() -> bool |
isSelectable |
function | (self) -> bool |
X.isSelectable() -> bool |
isTristate |
function | (self) -> bool |
X.isTristate() -> bool |
isUserTristate |
function | (self) -> bool |
X.isUserTristate() -> bool |
model |
function | (self) -> Any |
X.model() -> PythonQt.QtGui.QStandardItemModel |
parent |
function | (self) -> Any |
X.parent() -> PythonQt.QtGui.QStandardItem |
read |
function | (self, *args: Any, **kwargs: Any) -> None |
Reads the item from stream in. |
readFrom |
function | (self, *args: Any, **kwargs: Any) -> Any |
(shared captured text) |
removeColumn |
function | (self, column: int) -> None |
Removes the given column. |
removeColumns |
function | (self, column: int, count: int) -> None |
X.removeColumns(column, count) |
removeRow |
function | (self, row: int) -> None |
Removes the given row. |
removeRows |
function | (self, row: int, count: int) -> None |
X.removeRows(row, count) |
row |
function | (self) -> int |
X.row() -> int |
rowCount |
function | (self) -> int |
X.rowCount() -> int |
setAccessibleDescription |
function | (self, accessibleDescription: str) -> None |
Sets the item's accessible description to the string specified by accessibleDescription. |
setAccessibleText |
function | (self, accessibleText: str) -> None |
Sets the item's accessible text to the string specified by accessibleText. |
setAutoTristate |
function | (self, tristate: bool) -> None |
Determines that the item is tristate and controlled by [QTreeWidget](https://doc.qt.io/archives/qt-5.15/qtreewidget.html) if tristate is true. |
setBackground |
function | (self, brush: Any) -> None |
Sets the item's background brush to the specified brush. |
setCheckState |
function | (self, checkState: Any) -> None |
Sets the check state of the item to be state. |
setCheckable |
function | (self, checkable: bool) -> None |
Sets whether the item is user-checkable. |
setChild |
function | (self, row: int, column: Any, item: Any) -> None |
X.setChild(row, column, item) |
setColumnCount |
function | (self, columns: int) -> None |
Sets the number of child item columns to columns. |
setData |
function | (self, value: Any, role: int) -> None |
X.setData(value, role) |
setDragEnabled |
function | (self, dragEnabled: bool) -> None |
Sets whether the item is drag enabled. |
setDropEnabled |
function | (self, dropEnabled: bool) -> None |
Sets whether the item is drop enabled. |
setEditable |
function | (self, editable: bool) -> None |
Sets whether the item is editable. |
setEnabled |
function | (self, enabled: bool) -> None |
Sets whether the item is enabled. |
setFlags |
function | (self, arg0: flags) -> None |
Sets the item flags for the item to flags. |
setFont |
function | (self, font: Any) -> None |
Sets the font used to display the item's text to the given font. |
setForeground |
function | (self, brush: Any) -> None |
Sets the brush used to display the item's foreground (e.g. text) to the given brush. |
setIcon |
function | (self, icon: Any) -> None |
Sets the item's icon to the icon specified. |
setRowCount |
function | (self, rows: int) -> None |
Sets the number of child item rows to rows. |
setSelectable |
function | (self, selectable: bool) -> None |
Sets whether the item is selectable. |
setSizeHint |
function | (self, sizeHint: Any) -> None |
Sets the size hint for the item to be size. |
setStatusTip |
function | (self, statusTip: str) -> None |
Sets the item's status tip to the string specified by statusTip. |
setText |
function | (self, text: str) -> None |
Sets the item's text to the text specified. |
setTextAlignment |
function | (self, textAlignment: Any) -> None |
Sets the text alignment for the item's text to the alignment specified. |
setToolTip |
function | (self, toolTip: str) -> None |
Sets the item's tooltip to the string specified by toolTip. |
setTristate |
function | (self, tristate: bool) -> None |
|
setUserTristate |
function | (self, tristate: bool) -> None |
Sets whether the item is tristate and controlled by the user. |
setWhatsThis |
function | (self, whatsThis: str) -> None |
Sets the item's "What's This?" help to the string specified by whatsThis. |
sizeHint |
function | (self) -> Any |
X.sizeHint() -> PythonQt.QtCore.QSize |
sortChildren |
function | (self, column: int, order: Any) -> None |
X.sortChildren(column, order) |
statusTip |
function | (self) -> str |
X.statusTip() -> str |
takeChild |
function | (self, row: int, column: int) -> Any |
X.takeChild(row, column) -> PythonQt.QtGui.QStandardItem |
takeColumn |
function | (self, column: int) -> tuple |
X.takeColumn(column) -> tuple |
takeRow |
function | (self, row: int) -> tuple |
X.takeRow(row) -> tuple |
text |
function | (self) -> str |
X.text() -> str |
textAlignment |
function | (self) -> Any |
Returns the text alignment for the item's text. |
toolTip |
function | (self) -> str |
X.toolTip() -> str |
type |
function | (self) -> int |
X.type() -> int |
whatsThis |
function | (self) -> str |
X.whatsThis() -> str |
write |
function | (self, out: Any) -> None |
Writes the item to stream out. |
writeTo |
function | (self, out: Any) -> Any |
(shared captured text) |