QListWidget

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();

QListWidget

posted @ 2017-05-06 12:04  thomas_blog  阅读(94)  评论(0编辑  收藏  举报