QListWidget
1.定义List
2.item
3.list insertItem
QListWidget listWidget;
QListWidgetItem *listWidgetItem1 = new QListWidgetItem;
listWidget.insertItem(n, listWidgetItem1);
QTreeWidget
1.定义QTreeWidget
2. 设置列数treeWidget.setColumnCount(2);
3.添加项目QTreeWidgetItem *grade1 = new QTreeWidgetItem(&treeWidget);
QTableWidget
1. 创建表格部件,同时指定行数和列数QTableWidget tableWidget(3, 2);
2. 创建表格项目,并插入到指定单元
tableWidget.setItem(1, 1, tableWidgetItem);