Reputation: 11681
I wanted to know if there was a way of obtaining an image displayed on cell on a table in a way like this.Does QStandardItemModel have any methods that could assist ?
QImage p = MyQStandardItemModelptr->item(row,col)->data();
Any suggestions ?
Upvotes: 0
Views: 424
Reputation: 21258
You can try the following call:
QImage p = MyQStandardItemModelptr->item(row,col)->data(Qt::DecorationRole).value<QImage>();
Please note the usage of Qt::DecorationRole
.
Upvotes: 2