Hi,
I have problems with itemChange. I use it like the example "Diagram Scene".
I have two ellipse and a line between them and if I move the ellipse the line should move too.
ellipseitem.cpp
Qt Code:
  1. QVariant EllipseItem::itemChange(GraphicsItemChange change, const QVariant &value)
  2. {
  3. if (change == QGraphicsItem::ItemPositionChange)
  4. {
  5. foreach (LineItem *arrow, arrows)
  6. {
  7. arrow->updatePosition();
  8. }
  9. }
  10. return value;
  11. }
To copy to clipboard, switch view to plain text mode 
ellipseitem.h
Qt Code:
  1. ...
  2. protected:
  3. QVariant itemChange(GraphicsItemChange change, const QVariant &value);
  4. private:
  5. QList<LineItem *> arrows;
To copy to clipboard, switch view to plain text mode 

but I get
LineItem was not declared in this scope
C++ forbids declaration of arrows with no type

My LineItem is like this: LineItem(qreal x1, qreal y1, qreal x2, qreal y2);
Can somebody tell me whats wrong?