How does a Qtablewidget display images ?
Unsolved
General and Desktop
-
I want to add an image in the Qtablewidget that fills the entire cell and changes along with the height and column width:
item = new QTableWidgetItem(); item->setData(Qt::DecorationRole, QPixmap(p_info->mSnap_path+"/"+p_info->mSnap_name).scaled(80,80,Qt::IgnoreAspectRatio)); this->compare_rec->setItem(row,0,item);
The image is displayed, but when I change the column width or row height, the image does not fill the entire cell:
Can it be done in any way? -
Hi,
You would need to implement a custom QStyledItemDelegate to scale the image.