PythonQt.Qt.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 (shared captured text) |
accessibleText |
function | (self) -> str |
X.accessibleText() -> str (shared captured text) |
appendColumn |
function | (self, items: Any) -> None |
Appends a column containing items. (shared captured text) |
appendRow |
function | (self, item: Any) -> None |
Appends a row containing items. (shared captured text) |
appendRows |
function | (self, items: Any) -> None |
Appends rows containing items. (shared captured text) |
background |
function | (self) -> Any |
X.background() -> PythonQt.QtGui.QBrush (shared captured text) |
checkState |
function | (self) -> Any |
Returns the checked state of the item. (shared captured text) |
child |
function | (self, row: int, column: int) -> Any |
X.child(row, column) -> PythonQt.QtGui.QStandardItem (shared captured text) |
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 (shared captured text) |
column |
function | (self) -> int |
X.column() -> int (shared captured text) |
columnCount |
function | (self) -> int |
X.columnCount() -> int (shared captured text) |
data |
function | (self, role: int) -> Any |
X.data(role) -> object (shared captured text) |
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. (shared captured text) |
flags |
function | (self) -> Any |
Returns the item flags for the item. (shared captured text) |
font |
function | (self) -> Any |
X.font() -> PythonQt.QtGui.QFont (shared captured text) |
foreground |
function | (self) -> Any |
X.foreground() -> PythonQt.QtGui.QBrush (shared captured text) |
hasChildren |
function | (self) -> bool |
X.hasChildren() -> bool (shared captured text) |
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 (shared captured text) |
index |
function | (self) -> Any |
X.index() -> PythonQt.QtCore.QModelIndex (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) |
insertColumn |
function | (self, column: int, items: Any) -> None |
X.insertColumn(column, items) (shared captured text) |
insertColumns |
function | (self, column: int, count: int) -> None |
X.insertColumns(column, count) (shared captured text) |
insertRow |
function | (self, row: int, item: Any) -> None |
X.insertRow(row, item) (shared captured text) |
insertRows |
function | (self, row: int, items: Any) -> None |
X.insertRows(row, items) (shared captured text) |
isAutoTristate |
function | (self) -> bool |
X.isAutoTristate() -> bool (shared captured text) |
isCheckable |
function | (self) -> bool |
X.isCheckable() -> bool (shared captured text) |
isDragEnabled |
function | (self) -> bool |
X.isDragEnabled() -> bool (shared captured text) |
isDropEnabled |
function | (self) -> bool |
X.isDropEnabled() -> bool (shared captured text) |
isEditable |
function | (self) -> bool |
X.isEditable() -> bool (shared captured text) |
isEnabled |
function | (self) -> bool |
X.isEnabled() -> bool (shared captured text) |
isSelectable |
function | (self) -> bool |
X.isSelectable() -> bool (shared captured text) |
isTristate |
function | (self) -> bool |
X.isTristate() -> bool (shared captured text) |
isUserTristate |
function | (self) -> bool |
X.isUserTristate() -> bool (shared captured text) |
model |
function | (self) -> Any |
X.model() -> PythonQt.QtGui.QStandardItemModel (shared captured text) |
parent |
function | (self) -> Any |
X.parent() -> PythonQt.QtGui.QStandardItem (shared captured text) |
read |
function | (self, *args: Any, **kwargs: Any) -> None |
Reads the item from stream in. (shared captured text) |
readFrom |
function | (self, *args: Any, **kwargs: Any) -> Any |
(shared captured text) |
removeColumn |
function | (self, column: int) -> None |
Removes the given column. (shared captured text) |
removeColumns |
function | (self, column: int, count: int) -> None |
X.removeColumns(column, count) (shared captured text) |
removeRow |
function | (self, row: int) -> None |
Removes the given row. (shared captured text) |
removeRows |
function | (self, row: int, count: int) -> None |
X.removeRows(row, count) (shared captured text) |
row |
function | (self) -> int |
X.row() -> int (shared captured text) |
rowCount |
function | (self) -> int |
X.rowCount() -> int (shared captured text) |
setAccessibleDescription |
function | (self, accessibleDescription: str) -> None |
Sets the item's accessible description to the string specified by accessibleDescription. (shared captured text) |
setAccessibleText |
function | (self, accessibleText: str) -> None |
Sets the item's accessible text to the string specified by accessibleText. (shared captured text) |
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. (shared captured text) |
setBackground |
function | (self, brush: Any) -> None |
Sets the item's background brush to the specified brush. (shared captured text) |
setCheckState |
function | (self, checkState: Any) -> None |
Sets the check state of the item to be state. (shared captured text) |
setCheckable |
function | (self, checkable: bool) -> None |
Sets whether the item is user-checkable. (shared captured text) |
setChild |
function | (self, row: int, column: Any, item: Any) -> None |
X.setChild(row, column, item) (shared captured text) |
setColumnCount |
function | (self, columns: int) -> None |
Sets the number of child item columns to columns. (shared captured text) |
setData |
function | (self, value: Any, role: int) -> None |
X.setData(value, role) (shared captured text) |
setDragEnabled |
function | (self, dragEnabled: bool) -> None |
Sets whether the item is drag enabled. (shared captured text) |
setDropEnabled |
function | (self, dropEnabled: bool) -> None |
Sets whether the item is drop enabled. (shared captured text) |
setEditable |
function | (self, editable: bool) -> None |
Sets whether the item is editable. (shared captured text) |
setEnabled |
function | (self, enabled: bool) -> None |
Sets whether the item is enabled. (shared captured text) |
setFlags |
function | (self, arg0: flags) -> None |
Sets the item flags for the item to flags. (shared captured text) |
setFont |
function | (self, font: Any) -> None |
Sets the font used to display the item's text to the given font. (shared captured text) |
setForeground |
function | (self, brush: Any) -> None |
Sets the brush used to display the item's foreground (e.g. text) to the given brush. (shared captured text) |
setIcon |
function | (self, icon: Any) -> None |
Sets the item's icon to the icon specified. (shared captured text) |
setRowCount |
function | (self, rows: int) -> None |
Sets the number of child item rows to rows. (shared captured text) |
setSelectable |
function | (self, selectable: bool) -> None |
Sets whether the item is selectable. (shared captured text) |
setSizeHint |
function | (self, sizeHint: Any) -> None |
Sets the size hint for the item to be size. (shared captured text) |
setStatusTip |
function | (self, statusTip: str) -> None |
Sets the item's status tip to the string specified by statusTip. (shared captured text) |
setText |
function | (self, text: str) -> None |
Sets the item's text to the text specified. (shared captured text) |
setTextAlignment |
function | (self, textAlignment: Any) -> None |
Sets the text alignment for the item's text to the alignment specified. (shared captured text) |
setToolTip |
function | (self, toolTip: str) -> None |
Sets the item's tooltip to the string specified by toolTip. (shared captured text) |
setTristate |
function | (self, tristate: bool) -> None |
(shared captured text) |
setUserTristate |
function | (self, tristate: bool) -> None |
Sets whether the item is tristate and controlled by the user. (shared captured text) |
setWhatsThis |
function | (self, whatsThis: str) -> None |
Sets the item's "What's This?" help to the string specified by whatsThis. (shared captured text) |
sizeHint |
function | (self) -> Any |
X.sizeHint() -> PythonQt.QtCore.QSize (shared captured text) |
sortChildren |
function | (self, column: int, order: Any) -> None |
X.sortChildren(column, order) (shared captured text) |
statusTip |
function | (self) -> str |
X.statusTip() -> str (shared captured text) |
takeChild |
function | (self, row: int, column: int) -> Any |
X.takeChild(row, column) -> PythonQt.QtGui.QStandardItem (shared captured text) |
takeColumn |
function | (self, column: int) -> tuple |
X.takeColumn(column) -> tuple (shared captured text) |
takeRow |
function | (self, row: int) -> tuple |
X.takeRow(row) -> tuple (shared captured text) |
text |
function | (self) -> str |
X.text() -> str (shared captured text) |
textAlignment |
function | (self) -> Any |
Returns the text alignment for the item's text. (shared captured text) |
toolTip |
function | (self) -> str |
X.toolTip() -> str (shared captured text) |
type |
function | (self) -> int |
X.type() -> int (shared captured text) |
whatsThis |
function | (self) -> str |
X.whatsThis() -> str (shared captured text) |
write |
function | (self, out: Any) -> None |
Writes the item to stream out. (shared captured text) |
writeTo |
function | (self, out: Any) -> Any |
(shared captured text) |