Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can I use QPainter object in paint function, inherited from QGraphicsItem?
Rhadel last edited by
Or I can use only in paintEvent (QPaintEvent*) at QGraphicsView object?
bodzio131 last edited by
QGraphicItem::paint is pure virtual, so if you want to create your custom item by inheriting QGraphicsItem then you have to implement it and use QPainter inside. See "QGraphicItem::paint documentation":https://qt-project.org/doc/qt-4.8/qgraphicsitem.html#paint, there is simple example.