// Create a root item and add properties QStandardItem* root = new QStandardItem("Root Item"); root->setEditable(false); // Create child item and add properties QStandardItem* child = new QStandardItem("Child Item"); child->setEditable(true); // Add child to root root->appendRow(child);
// Get child item at index 0 from root QStandardItem* child = root->child(0);These examples show how to create and retrieve child items using QStandardItem. The Qt framework provides the QStandardItemModel class for organizing and working with these items in a hierarchical structure.