Can I use QPainter object in paint function, inherited from QGraphicsItem?
-
Or I can use only in paintEvent (QPaintEvent*) at QGraphicsView object?
Thank you.
-
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.