Implement it this way
Qt Code:
  1. class RectItem : public QGraphicsItem
  2. {
  3. ...
  4. public:
  5. ...
  6. enum { Type = UserType + 1 };
  7.  
  8. int type() const
  9. {
  10. return Type;
  11. }
  12. ...
  13. };
To copy to clipboard, switch view to plain text mode