137 ItemFlagsHaveChanged, |
137 ItemFlagsHaveChanged, |
138 ItemZValueChange, |
138 ItemZValueChange, |
139 ItemZValueHasChanged, |
139 ItemZValueHasChanged, |
140 ItemOpacityChange, |
140 ItemOpacityChange, |
141 ItemOpacityHasChanged, |
141 ItemOpacityHasChanged, |
142 ItemScenePositionHasChanged |
142 ItemScenePositionHasChanged, |
|
143 ItemRotationChange, |
|
144 ItemRotationHasChanged, |
|
145 ItemScaleChange, |
|
146 ItemScaleHasChanged, |
|
147 ItemTransformOriginPointChange, |
|
148 ItemTransformOriginPointHasChanged |
143 }; |
149 }; |
144 |
150 |
145 enum CacheMode { |
151 enum CacheMode { |
146 NoCache, |
152 NoCache, |
147 ItemCoordinateCache, |
153 ItemCoordinateCache, |
416 |
422 |
417 void installSceneEventFilter(QGraphicsItem *filterItem); |
423 void installSceneEventFilter(QGraphicsItem *filterItem); |
418 void removeSceneEventFilter(QGraphicsItem *filterItem); |
424 void removeSceneEventFilter(QGraphicsItem *filterItem); |
419 |
425 |
420 protected: |
426 protected: |
|
427 void updateMicroFocus(); |
421 virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event); |
428 virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event); |
422 virtual bool sceneEvent(QEvent *event); |
429 virtual bool sceneEvent(QEvent *event); |
423 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); |
430 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); |
424 virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event); |
431 virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event); |
425 virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); |
432 virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); |
538 Q_OBJECT |
545 Q_OBJECT |
539 Q_PROPERTY(QGraphicsObject * parent READ parentObject WRITE setParentItem NOTIFY parentChanged DESIGNABLE false) |
546 Q_PROPERTY(QGraphicsObject * parent READ parentObject WRITE setParentItem NOTIFY parentChanged DESIGNABLE false) |
540 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) |
547 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) |
541 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) |
548 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) |
542 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
549 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
543 Q_PROPERTY(QPointF pos READ pos WRITE setPos) |
550 Q_PROPERTY(QPointF pos READ pos WRITE setPos FINAL) |
544 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) |
551 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL) |
545 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) |
552 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL) |
546 Q_PROPERTY(qreal z READ zValue WRITE setZValue NOTIFY zChanged) |
553 Q_PROPERTY(qreal z READ zValue WRITE setZValue NOTIFY zChanged FINAL) |
547 Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) |
554 Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) |
548 Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) |
555 Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) |
549 Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint) |
556 Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint) |
|
557 #ifndef QT_NO_GRAPHICSEFFECT |
|
558 Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect) |
|
559 #endif |
|
560 Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), QDeclarativeListProperty<QGraphicsObject> children READ childrenList DESIGNABLE false NOTIFY childrenChanged) |
|
561 Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth NOTIFY widthChanged RESET resetWidth FINAL) |
|
562 Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight NOTIFY heightChanged RESET resetHeight FINAL) |
|
563 Q_CLASSINFO("DefaultProperty", "children") |
550 Q_INTERFACES(QGraphicsItem) |
564 Q_INTERFACES(QGraphicsItem) |
551 public: |
565 public: |
552 QGraphicsObject(QGraphicsItem *parent = 0); |
566 QGraphicsObject(QGraphicsItem *parent = 0); |
553 |
567 |
554 // ### Qt 5: Disambiguate |
568 // ### Qt 5: Disambiguate |
558 using QObject::children; |
572 using QObject::children; |
559 #endif |
573 #endif |
560 |
574 |
561 void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags()); |
575 void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags()); |
562 void ungrabGesture(Qt::GestureType type); |
576 void ungrabGesture(Qt::GestureType type); |
|
577 |
|
578 protected Q_SLOTS: |
|
579 void updateMicroFocus(); |
563 |
580 |
564 Q_SIGNALS: |
581 Q_SIGNALS: |
565 void parentChanged(); |
582 void parentChanged(); |
566 void opacityChanged(); |
583 void opacityChanged(); |
567 void visibleChanged(); |
584 void visibleChanged(); |
569 void xChanged(); |
586 void xChanged(); |
570 void yChanged(); |
587 void yChanged(); |
571 void zChanged(); |
588 void zChanged(); |
572 void rotationChanged(); |
589 void rotationChanged(); |
573 void scaleChanged(); |
590 void scaleChanged(); |
|
591 void childrenChanged(); |
|
592 void widthChanged(); |
|
593 void heightChanged(); |
574 |
594 |
575 protected: |
595 protected: |
576 QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene); |
596 QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene); |
577 private: |
597 private: |
578 friend class QGraphicsItem; |
598 friend class QGraphicsItem; |