QListWidget上面显示图标问题
void prepare::list_item(){ QString the_dir(QString(GEN_DIR)+"ico/"); qDebug()<<the_dir; QDir dir( the_dir, "*.png" ); for ( uint i = 0; i < dir.count(); i++ ) { QListWidgetItem *listItem = new QListWidgetItem(QIcon(the_dir+dir[i]), dir[i], listWidget, 0); qDebug()<<dir[i]; listWidget->setCurrentItem(listItem); } listWidget->setFlow(QListView::LeftToRight); listWidget->update();}