#include// ... QStandardItem *item = new QStandardItem("Hello, World!");
#includeIn this example, a new QStandardItemModel is created and a QStandardItem object is added to the model. The "Apples" text is set as its data and an icon is set using the setIcon() method. Finally, the item is added to the model using the appendRow() method. Package/library: Qt framework's GUI module, available in the Qt library.// ... QStandardItemModel *model = new QStandardItemModel; QStandardItem *item = new QStandardItem("Apples"); item->setIcon(QIcon(":/images/apple.png")); model->appendRow(item);