+ pushButton->setFixedWidth(list->width());
+#endif
+ connect(pushButton, SIGNAL(clicked()), b.receiver, b.slot);
+ QListWidgetItem *item = new QListWidgetItem();
+ item->setFlags(Qt::NoItemFlags);
+ list->insertItem(row, item);
+ list->setItemWidget(item, pushButton);
+}
+
+void ListWindow::setModel(QAbstractItemModel *aModel)
+{
+ TRACE;
+ mModel = aModel;
+ populateList();
+ if (mModel) {
+ connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+ this, SLOT(populateList()));
+ connect(mModel, SIGNAL(rowsRemoved(QModelIndex, int, int)),
+ this, SLOT(populateList()));
+ connect(mModel, SIGNAL(rowsInserted(QModelIndex, int, int)),
+ this, SLOT(populateList()));
+ connect(mModel, SIGNAL(layoutChanged()), this, SLOT(populateList()));