this is my example
for (int i =0; i<12;i++)
{
item
->setSizeHint
(QSize(200,
60));
itemwid = new itemWidget(this);
itemwid->ui->lblImage->setPixmap(pix.scaled(pix.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));
itemwid->ui->lbl1->setText(tr("row number %1").arg(i));
itemwid->ui->lbl2->setText(tr("row number %1").arg(i+1));
this->ui->listWidget->setItemWidget(item,itemwid);
// store data into Qlist<QlistWidgetItem*>
itemTemp->append(item);
}
for (int i =0; i<12;i++)
{
QListWidgetItem *item = new QListWidgetItem(this->ui->listWidget);
QPixmap pix=icon.pixmap(QSize(400,400),QIcon::Selected,QIcon::On);
item->setSizeHint(QSize(200,60));
itemwid = new itemWidget(this);
itemwid->ui->lblImage->setPixmap(pix.scaled(pix.size(),Qt::KeepAspectRatio,Qt::SmoothTransformation));
itemwid->ui->lbl1->setText(tr("row number %1").arg(i));
itemwid->ui->lbl2->setText(tr("row number %1").arg(i+1));
this->ui->listWidget->setItemWidget(item,itemwid);
// store data into Qlist<QlistWidgetItem*>
itemTemp->append(item);
}
To copy to clipboard, switch view to plain text mode
besides, if i use xml to store item ,then is it feasible?
Bookmarks