Hi,

I have a class that inherit from QGrpahicsEllipseItem to let it emit a signal when it is selected

Qt Code:
  1. #ifndef QDEFECTITEM_H
  2. #define QDEFECTITEM_H
  3.  
  4. #include <QGraphicsEllipseItem>
  5.  
  6. class QDefectItem : public QGraphicsEllipseItem
  7. {
  8. Q_OBJECT
  9.  
  10. public:
  11. QDefectItem();
  12. ~QDefectItem();
  13.  
  14. protected:
  15. QVariant itemChange(GraphicsItemChange change, const QVariant &value);
  16.  
  17. signals:
  18. void itemSelected(QGraphicsItem*);
  19. };
  20.  
  21. #endif // QDEFECTITEM_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #include "QDefectItem.h"
  2.  
  3. QDefectItem::QDefectItem()
  4. {
  5.  
  6. }
  7.  
  8. QDefectItem::~QDefectItem()
  9. {
  10.  
  11. }
  12.  
  13. QVariant QDefectItem::itemChange(GraphicsItemChange change,const QVariant &value)
  14. {
  15. if (change == QGraphicsItem::ItemSelectedChange)
  16. emit itemSelected(this);
  17. return value;
  18. }
To copy to clipboard, switch view to plain text mode 

This simple code returns an error when tryies to compile the generated moc file.
Missing something?

Thanks,