QListWidgetItem *item=new QListWidgetItem(list,0);
item->setSizeHint(QSize(100,100));
QWidget *w = new QWidget(list);
QHBoxLayout *layout=new QHBoxLayout(w);
QPushButton *pushButton=new QPushButton(w);
QCheckBox *checkBox=new QCheckBox(w);
layout->addWidget(checkBox);
layout->addWidget(pushButton);
w->setLayout(layout);
w->show();
list->setItemWidget(item,w);
list->show();
实现了在QListWidgetItem中添加按钮和CheckBox的功能