#ifndef MYLIST_H #define MYLIST_H #include #include #include #include #include class MyList : public QListView { Q_OBJECT public slots: void setIcons() { QPixmap p(100, 100); p.fill(Qt::red); QStandardItem *item = m->item(0); item->setIcon(p); // Uncommenting this makes it work // doItemsLayout(); } public: QStandardItemModel *m; }; #endif