Thanks! That worked. But now I have another problem:
QString file = "C:\\Users\\administrator\\Downloads\\ethereal-setup-0.99.0.exe";
QIcon appIcon
= fileIconProvider.
icon( fileInfo
);
QString file = "C:\\Users\\administrator\\Downloads\\ethereal-setup-0.99.0.exe";
QFileInfo fileInfo( file );
QFileIconProvider fileIconProvider;
QIcon appIcon = fileIconProvider.icon( fileInfo );
To copy to clipboard, switch view to plain text mode
Thats code I found here in the Forum.
Then I do the following:
scene->addItem(pitem2);
pitem2->setPos(100, 100);
QGraphicsPixmapItem *pitem2 = new QGraphicsPixmapItem(QPixmap(appIcon.pixmap(2,QIcon::Normal,QIcon::On)));
scene->addItem(pitem2);
pitem2->setPos(100, 100);
pitem2->setFlag(QGraphicsItem::ItemIsMovable,true);
To copy to clipboard, switch view to plain text mode
But nothing renders on the screen. An idea why?
Bookmarks