QWidget* widget = new QWidget;
QListWidget* listWidget = new QListWidget;
QVBoxLayout* layout = new QVBoxLayout;
QListWidgetItem* item1 = new QListWidgetItem("Object", listWidget);
QListWidgetItem* item2 = new QListWidgetItem("Instance", listWidget);
QListWidgetItem* item3 = new QListWidgetItem("Resource", listWidget);
listWidget->addItem(item1);
listWidget->addItem(item2);
listWidget->addItem(item3);
listWidget->show();
layout->addWidget(listWidget);
widget->setLayout(layout);
widget->show();