for completeness, here is the InteractiveQGraphicsFrameItem class, which works without problems:

Qt Code:
  1. #ifndef INTERACTIVEQGRAPHICSFRAMEITEM_H
  2. #define INTERACTIVEQGRAPHICSFRAMEITEM_H
  3.  
  4. #include <QSharedData>
  5. #include "GraphicItemsSharedLibrary.h"
  6. #include "AbstractInteractiveQGraphicsItem.h"
  7.  
  8. class QRectF;
  9. class QColor;
  10. class QPainter;
  11. class QWidget;
  12. class QKeyEvent;
  13.  
  14. class InteractiveQGraphicsFrameItemData;
  15.  
  16. class GRAPHICITEMS_SHAREDLIB_LIB_EXPORT InteractiveQGraphicsFrameItem : public AbstractInteractiveQGraphicsItem
  17. {
  18. public:
  19. InteractiveQGraphicsFrameItem(AbstractInteractiveQGraphicsCoordinationItem* parent = 0, QGraphicsScene* scene = 0);
  20. virtual ~InteractiveQGraphicsFrameItem();
  21. virtual QRectF boundingRect() const;
  22. virtual QRectF getRect();
  23. virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
  24. virtual void setDrawNewRectOnClickOutOfTheFrame(bool b);
  25. virtual void setFillColor(const QColor &color);
  26. virtual void setFrame(const QRectF& rect);
  27. virtual void setFrameColor(const QColor &color);
  28. virtual void setHandleFillColor(const QColor &color);
  29. virtual void setHandleFrameColor(const QColor &color);
  30. virtual void setMaximumHandleSize(double size);
  31. virtual void setOuterFillColor(const QColor &color);
  32.  
  33. protected:
  34. virtual void adjustHandleSize();
  35. virtual void keyPressEvent(QKeyEvent* event);
  36. virtual void keyReleaseEvent(QKeyEvent* event);
  37. virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
  38. virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
  39. virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
  40. // virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
  41. // virtual void wheelEvent(QGraphicsSceneWheelEvent* event);
  42.  
  43. virtual void updateHandles();
  44.  
  45. protected:
  46. QSharedDataPointer<InteractiveQGraphicsFrameItemData> d;
  47. };
  48.  
  49. #endif // INTERACTIVEQGRAPHICSFRAMEITEM_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #ifndef INTERACTIVEQGRAPHICSFRAMEITEMDATA_H
  2. #define INTERACTIVEQGRAPHICSFRAMEITEMDATA_H
  3.  
  4. #include <QSharedData>
  5. #include <QRectF>
  6. #include <QPointF>
  7. #include <QVector>
  8. #include <QColor>
  9.  
  10. class InteractiveQGraphicsFrameItemData : public QSharedData
  11. {
  12. public:
  13. InteractiveQGraphicsFrameItemData();
  14.  
  15. QRectF frame;
  16. bool mouseDown;
  17. bool mouseInObject;
  18. bool newSelection;
  19. bool lockAspectRatio;
  20. bool drawNewRectOnClickOutOfTheFrame;
  21. double handleSize;
  22. double maximumHandleSize;
  23. QRectF* mouseOverHandle;
  24. QPointF dragStartPoint;
  25. QRectF frameBeforeDrag;
  26. QColor fillColor;
  27. QColor frameColor;
  28. QColor handleFillColor;
  29. QColor handleFrameColor;
  30. QColor outerFillColor;
  31.  
  32. // naming convention for handles
  33. // T top, B bottom, R Right, L left
  34. // 2 letters: a corner
  35. // 1 letter: the handle on the middle of the corresponding side
  36. QRectF TLHandle, TRHandle, BLHandle, BRHandle;
  37. QRectF LHandle, THandle, RHandle, BHandle;
  38.  
  39. QVector<QRectF*> handles;
  40. };
  41.  
  42. #endif // INTERACTIVEQGRAPHICSFRAMEITEMDATA_H
To copy to clipboard, switch view to plain text mode 

Now where is the difference to the InteractiveQGraphicsLineItem class, which makes the one compile and the other not?