Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
SetPixmap in custom QGraphicsPixmapItem class not working
noastick last edited by
I've come here for help on an issue that I can't solve after quite some time looking for help.
I created a class which "derives" from a QGraphicsPixmapItem. In the constructor I want to set the pixmap from a resource file.
I've tried loading with "qrc:/..." or "://..." but there is no help. The resource file name is "image.qrc" and the prefix /Lshape. The file name is "Lshape1.png".
In the scene I do:
@ Lshape * lshape = new Lshape();
EDIT: I've also tried setPixmap(QPixmap(":/Lshape/Lshape1.png"))--;
Asperamanca last edited by
Try setting an alias for the pixmap. Also, post your qrc file.