resize a cell of qtablewidget
Solved
General and Desktop
-
Hello i'm trying to set a picture in a cell of my tableWidget and is a little success but the size of cell is fixed and for me is not good.
I'd like the cell to fit the size of the image, how do I do that?ui->tableWidget->setRowCount(10); ui->tableWidget->setColumnCount(3); QStringList liste; liste << "Step" << "Value coder" << "Picture"; ui->tableWidget->setHorizontalHeaderLabels(liste); QPixmap pix("C:/Users/portalc/Pictures/atm3/pos_init.png"); QPixmap resPix = pix.scaled(300,300, Qt::KeepAspectRatio, Qt::FastTransformation); QLabel *lblTest = new QLabel; lblTest->setPixmap(resPix); lblTest->setAlignment(Qt::AlignCenter); ui->tableWidget->setCellWidget(1, 2, lblTest);
thanks for your help :)
-