How to insert a picture in the merged cell(2 lines) of QTablewidget ?
-
I insert a picture in the merged cell(2 lines) of QTablewidget,but the picture can only display height of one line and becomes very narrow.How to solve it?
my code:
tableWidget1->setItem(3,3,newQTableWidgetItem(QIcon("image2/vm.png"),tr("Ab")));
tableWidget1->resizeColumnToContents(3);
tableWidget1->resizeRowToContents(3); -
I have made it without using delegate!
the code:tableWidget1->setItem(3,3,new QTableWidgetItem(tr("")));
QPixmap pix1("image2/vm1.png");
QBrush brush1(pix1);
tableWidget1->item(3,3)->setBackground(brush1);tableWidget1->resizeColumnToContents(3);
tableWidget1->resizeRowToContents(3);