The QStandardItem class provides an item for use with the QStandardItemModel class. Items usually contain text, icons, or checkboxes.
The QStandardItem
class provides an item for use with the QStandardItemModel
class. 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.
Documentation for Qt 4.8 and for Qt 5.