
Originally Posted by
Lykurg
Thanks Lykurg!
Have tried this now ...
QPixmap TableWidget
::selectedPixmap() const {
if ( !currentItem() )
{
qDebug() << "no item found ...";
}
else
{
qDebug() << "current item is" << currentItem();
return currentItem()->data( Qt::DecorationRole ).value<QPixmap>();
}
}
QPixmap TableWidget::selectedPixmap() const
{
if ( !currentItem() )
{
qDebug() << "no item found ...";
return QPixmap();
}
else
{
qDebug() << "current item is" << currentItem();
return currentItem()->data( Qt::DecorationRole ).value<QPixmap>();
}
}
To copy to clipboard, switch view to plain text mode
but's still the same.
qDebug() returns 'current item is 0x1422a10'
qDebug() << currentItem()->data( Qt:
ecorationRole ) returns ''QVariant(QString, "ArtMatch")'
But QSize returns 'QSize(-1, -1)'!
For testing I have tried to set my pixmap from an image with
QPixmap pixmap
( ":/images/ampel_rot.jpg" );
QPixmap pixmap( ":/images/ampel_rot.jpg" );
To copy to clipboard, switch view to plain text mode
With that my programm will work, but I need a pixmap with the content of currentItem()!
Any other ideas?
Bookmarks