I would like to change my mouse cursor when it is in a graphics item (MyCircle inherits from QObject
and QGraphicsItem
).
Had my class inherited from <
QGraphicsItem
already has a method for changing the cursor, so you don't need to manually play around with hover events:
QGraphicsItem::setCursor(const QCursor &cursor)
http://doc.qt.io/qt-5/qgraphicsitem.html#setCursor
PS: The dual inheritance of QWidget
and QGraphicsItem
you do is also a bad idea, only inherit from QGraphicsItem
.