Talei
3rd April 2010, 15:35
Hello,
I have QStandardItemModel with QPixmap on first column. I want scale pixmaps but I can't figure out how to copy them back to tmp pixmaps.
QPixmap tmp = QPixmap( model.data( model.index( i, 0 ), Qt::DecorationRole ).toByteArray() );
//tmp is empty
//at index i,0 are Pixmaps
Any suggestion are more then welcome.
EDIT:
qDebug() << model.data( model.index( i, 0 ), Qt::DecorationRole ).type();
//out: QVariant::QPixmap
I have QStandardItemModel with QPixmap on first column. I want scale pixmaps but I can't figure out how to copy them back to tmp pixmaps.
QPixmap tmp = QPixmap( model.data( model.index( i, 0 ), Qt::DecorationRole ).toByteArray() );
//tmp is empty
//at index i,0 are Pixmaps
Any suggestion are more then welcome.
EDIT:
qDebug() << model.data( model.index( i, 0 ), Qt::DecorationRole ).type();
//out: QVariant::QPixmap