QStandardItem is a class in the Qt library that represents a single item in a model/view architecture. It provides a way to store and manipulate data in a table or tree structure. The QStandardItem type is part of the QtGui module in Qt.
Example 1:
QStandardItem* item = new QStandardItem("example"); item->setEditable(false); model->setItem(0, 0, item);
This code creates a new QStandardItem called "example", disables editing on it, and sets it as the item in the first row and column of a model.
Example 2:
QStandardItemModel* model = new QStandardItemModel(); QStandardItem* parentItem = model->invisibleRootItem(); QStandardItem* childItem = new QStandardItem("child"); parentItem->appendRow(childItem);
This code creates a new QStandardItemModel, gets the invisible root item as the parent item, creates a new child item called "child", and adds it as a row to the parent item.
The package library for QStandardItem is Qt.
C++ (Cpp) QStandardItem::type - 30 examples found. These are the top rated real world C++ (Cpp) examples of QStandardItem::type extracted from open source projects. You can rate examples to help us improve the quality of examples.