Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to write custom singnal and slots for custom QGraphicsPolygonItem?
opengpu last edited by
how to write custom singnal and slots for custom QGraphicsPolygonItem?
i found that QGraphicsPolygonItem is not inherited from QObejct...
and i tried add Q_OBJECT for my class, and compiled wrong...
jalomic last edited by
You can inherit QGraphicsPolygonItem from QObject yourself
andreyc last edited by
As jalomic suggested inherit you custom QGraphicsPolygonItem from both classes QObject and QGraphicsPolygonItem
Please note that QObject must be first in the inheritance chain. Otherwise moc will not recognize it.
class MyGPI : public QObject, public QGraphicsPolygonItem