Hi everyone,
I want to resize a QLabel(in the labels are images) to fit in a cell. I use
label->setFixedSize(ui->tableWidget->columnWidth(currentColumn),ui->tableWidget->rowHeight(currentRow));
label->setFixedSize(ui->tableWidget->columnWidth(currentColumn),ui->tableWidget->rowHeight(currentRow));
To copy to clipboard, switch view to plain text mode
to set the labels size and than
QPixmap p=QPixmap(iterator->next());
To copy to clipboard, switch view to plain text mode
label->setPixmap(p.scaled(label->width(),label->height(),Qt::KeepAspectRatio));
label->setPixmap(p.scaled(label->width(),label->height(),Qt::KeepAspectRatio));
To copy to clipboard, switch view to plain text mode
to keep the image aspect ratio. I get the currentColumn/Row from a selectionmodel.
When the cell doesn´t have row/colspan all works fine. But when i span (for example 2 rows) then i only get the height of the first row and i want to get the height of r1+r2. So the Image only fit the size of the first cell before the span and ignores the additional size from the span.
I didn´t find something about cellwidth/cellheight so I´m asking here now.
(And sorry for my bad english)
Bookmarks