i have to load certain image as icon in Qlistwidget but everytime to perform this operation i have to writecan i perform this opeartion dynamically ?? so that everytime i dont need to write same code for loading all images.Code:
Printable View
i have to load certain image as icon in Qlistwidget but everytime to perform this operation i have to writecan i perform this opeartion dynamically ?? so that everytime i dont need to write same code for loading all images.Code:
You could do something like
Is that what you're looking for?Code:
ui->listWidget_2->addItem(new QListWidgetItem(QIcon(QString(":/new/Myresource/%1.jpg").arg(item), item));