pub struct GraphicsItemChange(/* private fields */);
Expand description
This enum describes the state changes that are notified by QGraphicsItem::itemChange(). The notifications are sent as the state changes, and in some cases, adjustments can be made (see the documentation for each change for details).
C++ enum: QGraphicsItem::GraphicsItemChange
.
This enum describes the state changes that are notified by QGraphicsItem::itemChange(). The notifications are sent as the state changes, and in some cases, adjustments can be made (see the documentation for each change for details).
Note: Be careful with calling functions on the QGraphicsItem itself inside itemChange(), as certain function calls can lead to unwanted recursion. For example, you cannot call setPos() in itemChange() on an ItemPositionChange notification, as the setPos() function will again call itemChange(ItemPositionChange). Instead, you can return the new, adjusted position from itemChange().
Implementations§
Source§impl GraphicsItemChange
impl GraphicsItemChange
Sourcepub const ItemPositionChange: GraphicsItemChange
pub const ItemPositionChange: GraphicsItemChange
The item’s position changes. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and when the item’s local position changes, relative to its parent (i.e., as a result of calling setPos() or moveBy()). The value argument is the new position (i.e., a QPointF). You can call pos() to get the original position. Do not call setPos() or moveBy() in itemChange() as this notification is delivered; instead, you can return the new, adjusted position from itemChange(). After this notification, QGraphicsItem immediately sends the ItemPositionHasChanged notification if the position changed. (C++ enum variant: ItemPositionChange = 0
)
Sourcepub const ItemMatrixChange: GraphicsItemChange
pub const ItemMatrixChange: GraphicsItemChange
The item’s affine transformation matrix is changing. This value is obsolete; you can use ItemTransformChange instead. (C++ enum variant: ItemMatrixChange = 1
)
Sourcepub const ItemVisibleChange: GraphicsItemChange
pub const ItemVisibleChange: GraphicsItemChange
The item’s visible state changes. If the item is presently visible, it will become invisible, and vice verca. The value argument is the new visible state (i.e., true or false). Do not call setVisible() in itemChange() as this notification is delivered; instead, you can return the new visible state from itemChange(). (C++ enum variant: ItemVisibleChange = 2
)
Sourcepub const ItemEnabledChange: GraphicsItemChange
pub const ItemEnabledChange: GraphicsItemChange
The item’s enabled state changes. If the item is presently enabled, it will become disabled, and vice verca. The value argument is the new enabled state (i.e., true or false). Do not call setEnabled() in itemChange() as this notification is delivered. Instead, you can return the new state from itemChange(). (C++ enum variant: ItemEnabledChange = 3
)
Sourcepub const ItemSelectedChange: GraphicsItemChange
pub const ItemSelectedChange: GraphicsItemChange
The item’s selected state changes. If the item is presently selected, it will become unselected, and vice verca. The value argument is the new selected state (i.e., true or false). Do not call setSelected() in itemChange() as this notification is delivered; instead, you can return the new selected state from itemChange(). (C++ enum variant: ItemSelectedChange = 4
)
Sourcepub const ItemParentChange: GraphicsItemChange
pub const ItemParentChange: GraphicsItemChange
The item’s parent changes. The value argument is the new parent item (i.e., a QGraphicsItem pointer). Do not call setParentItem() in itemChange() as this notification is delivered; instead, you can return the new parent from itemChange(). (C++ enum variant: ItemParentChange = 5
)
Sourcepub const ItemChildAddedChange: GraphicsItemChange
pub const ItemChildAddedChange: GraphicsItemChange
A child is added to this item. The value argument is the new child item (i.e., a QGraphicsItem pointer). Do not pass this item to any item’s setParentItem() function as this notification is delivered. The return value is unused; you cannot adjust anything in this notification. Note that the new child might not be fully constructed when this notification is sent; calling pure virtual functions on the child can lead to a crash. (C++ enum variant: ItemChildAddedChange = 6
)
Sourcepub const ItemChildRemovedChange: GraphicsItemChange
pub const ItemChildRemovedChange: GraphicsItemChange
A child is removed from this item. The value argument is the child item that is about to be removed (i.e., a QGraphicsItem pointer). The return value is unused; you cannot adjust anything in this notification. (C++ enum variant: ItemChildRemovedChange = 7
)
Sourcepub const ItemTransformChange: GraphicsItemChange
pub const ItemTransformChange: GraphicsItemChange
The item’s transformation matrix changes. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and when the item’s local transformation matrix changes (i.e., as a result of calling setTransform(). The value argument is the new matrix (i.e., a QTransform); to get the old matrix, call transform(). Do not call setTransform() or set any of the transformation properties in itemChange() as this notification is delivered; instead, you can return the new matrix from itemChange(). This notification is not sent if you change the transformation properties. (C++ enum variant: ItemTransformChange = 8
)
Sourcepub const ItemPositionHasChanged: GraphicsItemChange
pub const ItemPositionHasChanged: GraphicsItemChange
The item’s position has changed. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and after the item’s local position, relative to its parent, has changed. The value argument is the new position (the same as pos()), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). (C++ enum variant: ItemPositionHasChanged = 9
)
Sourcepub const ItemTransformHasChanged: GraphicsItemChange
pub const ItemTransformHasChanged: GraphicsItemChange
The item’s transformation matrix has changed either because setTransform is called, or one of the transformation properties is changed. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and after the item’s local transformation matrix has changed. The value argument is the new matrix (same as transform()), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). (C++ enum variant: ItemTransformHasChanged = 10
)
Sourcepub const ItemSceneChange: GraphicsItemChange
pub const ItemSceneChange: GraphicsItemChange
The item is moved to a new scene. This notification is also sent when the item is added to its initial scene, and when it is removed. The item’s scene() is the old scene (or 0 if the item has not been added to a scene yet). The value argument is the new scene (i.e., a QGraphicsScene pointer), or a null pointer if the item is removed from a scene. Do not override this change by passing this item to QGraphicsScene::addItem() as this notification is delivered; instead, you can return the new scene from itemChange(). Use this feature with caution; objecting to a scene change can quickly lead to unwanted recursion. (C++ enum variant: ItemSceneChange = 11
)
Sourcepub const ItemVisibleHasChanged: GraphicsItemChange
pub const ItemVisibleHasChanged: GraphicsItemChange
The item’s visible state has changed. The value argument is the new visible state (i.e., true or false). Do not call setVisible() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemVisibleHasChanged = 12
)
Sourcepub const ItemEnabledHasChanged: GraphicsItemChange
pub const ItemEnabledHasChanged: GraphicsItemChange
The item’s enabled state has changed. The value argument is the new enabled state (i.e., true or false). Do not call setEnabled() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemEnabledHasChanged = 13
)
Sourcepub const ItemSelectedHasChanged: GraphicsItemChange
pub const ItemSelectedHasChanged: GraphicsItemChange
The item’s selected state has changed. The value argument is the new selected state (i.e., true or false). Do not call setSelected() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemSelectedHasChanged = 14
)
Sourcepub const ItemParentHasChanged: GraphicsItemChange
pub const ItemParentHasChanged: GraphicsItemChange
The item’s parent has changed. The value argument is the new parent (i.e., a pointer to a QGraphicsItem). Do not call setParentItem() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemParentHasChanged = 15
)
Sourcepub const ItemSceneHasChanged: GraphicsItemChange
pub const ItemSceneHasChanged: GraphicsItemChange
The item’s scene has changed. The item’s scene() is the new scene. This notification is also sent when the item is added to its initial scene, and when it is removed.The value argument is the new scene (i.e., a pointer to a QGraphicsScene). Do not call setScene() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemSceneHasChanged = 16
)
Sourcepub const ItemCursorChange: GraphicsItemChange
pub const ItemCursorChange: GraphicsItemChange
The item’s cursor changes. The value argument is the new cursor (i.e., a QCursor). Do not call setCursor() in itemChange() as this notification is delivered. Instead, you can return a new cursor from itemChange(). (C++ enum variant: ItemCursorChange = 17
)
Sourcepub const ItemCursorHasChanged: GraphicsItemChange
pub const ItemCursorHasChanged: GraphicsItemChange
Sourcepub const ItemToolTipChange: GraphicsItemChange
pub const ItemToolTipChange: GraphicsItemChange
The item’s tooltip changes. The value argument is the new tooltip (i.e., a QToolTip). Do not call setToolTip() in itemChange() as this notification is delivered. Instead, you can return a new tooltip from itemChange(). (C++ enum variant: ItemToolTipChange = 19
)
Sourcepub const ItemToolTipHasChanged: GraphicsItemChange
pub const ItemToolTipHasChanged: GraphicsItemChange
The item’s tooltip has changed. The value argument is the new tooltip (i.e., a QToolTip). Do not call setToolTip() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemToolTipHasChanged = 20
)
Sourcepub const ItemFlagsChange: GraphicsItemChange
pub const ItemFlagsChange: GraphicsItemChange
The item’s flags change. The value argument is the new flags (i.e., a quint32). Do not call setFlags() in itemChange() as this notification is delivered. Instead, you can return the new flags from itemChange(). (C++ enum variant: ItemFlagsChange = 21
)
Sourcepub const ItemFlagsHaveChanged: GraphicsItemChange
pub const ItemFlagsHaveChanged: GraphicsItemChange
The item’s flags have changed. The value argument is the new flags (i.e., a quint32). Do not call setFlags() in itemChange() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemFlagsHaveChanged = 22
)
Sourcepub const ItemZValueChange: GraphicsItemChange
pub const ItemZValueChange: GraphicsItemChange
The item’s Z-value changes. The value argument is the new Z-value (i.e., a double). Do not call setZValue() in itemChange() as this notification is delivered. Instead, you can return a new Z-value from itemChange(). (C++ enum variant: ItemZValueChange = 23
)
Sourcepub const ItemZValueHasChanged: GraphicsItemChange
pub const ItemZValueHasChanged: GraphicsItemChange
The item’s Z-value has changed. The value argument is the new Z-value (i.e., a double). Do not call setZValue() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemZValueHasChanged = 24
)
Sourcepub const ItemOpacityChange: GraphicsItemChange
pub const ItemOpacityChange: GraphicsItemChange
The item’s opacity changes. The value argument is the new opacity (i.e., a double). Do not call setOpacity() in itemChange() as this notification is delivered. Instead, you can return a new opacity from itemChange(). (C++ enum variant: ItemOpacityChange = 25
)
Sourcepub const ItemOpacityHasChanged: GraphicsItemChange
pub const ItemOpacityHasChanged: GraphicsItemChange
The item’s opacity has changed. The value argument is the new opacity (i.e., a double). Do not call setOpacity() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemOpacityHasChanged = 26
)
Sourcepub const ItemScenePositionHasChanged: GraphicsItemChange
pub const ItemScenePositionHasChanged: GraphicsItemChange
The item’s scene position has changed. This notification is sent if the ItemSendsScenePositionChanges flag is enabled, and after the item’s scene position has changed (i.e., the position or transformation of the item itself or the position or transformation of any ancestor has changed). The value argument is the new scene position (the same as scenePos()), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). (C++ enum variant: ItemScenePositionHasChanged = 27
)
Sourcepub const ItemRotationChange: GraphicsItemChange
pub const ItemRotationChange: GraphicsItemChange
The item’s rotation property changes. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and when the item’s rotation property changes (i.e., as a result of calling setRotation()). The value argument is the new rotation (i.e., a double); to get the old rotation, call rotation(). Do not call setRotation() in itemChange() as this notification is delivered; instead, you can return the new rotation from itemChange(). (C++ enum variant: ItemRotationChange = 28
)
Sourcepub const ItemRotationHasChanged: GraphicsItemChange
pub const ItemRotationHasChanged: GraphicsItemChange
The item’s rotation property has changed. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and after the item’s rotation property has changed. The value argument is the new rotation (i.e., a double), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). Do not call setRotation() in itemChange() as this notification is delivered. (C++ enum variant: ItemRotationHasChanged = 29
)
Sourcepub const ItemScaleChange: GraphicsItemChange
pub const ItemScaleChange: GraphicsItemChange
The item’s scale property changes. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and when the item’s scale property changes (i.e., as a result of calling setScale()). The value argument is the new scale (i.e., a double); to get the old scale, call scale(). Do not call setScale() in itemChange() as this notification is delivered; instead, you can return the new scale from itemChange(). (C++ enum variant: ItemScaleChange = 30
)
Sourcepub const ItemScaleHasChanged: GraphicsItemChange
pub const ItemScaleHasChanged: GraphicsItemChange
The item’s scale property has changed. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and after the item’s scale property has changed. The value argument is the new scale (i.e., a double), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). Do not call setScale() in itemChange() as this notification is delivered. (C++ enum variant: ItemScaleHasChanged = 31
)
Sourcepub const ItemTransformOriginPointChange: GraphicsItemChange
pub const ItemTransformOriginPointChange: GraphicsItemChange
The item’s transform origin point property changes. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and when the item’s transform origin point property changes (i.e., as a result of calling setTransformOriginPoint()). The value argument is the new origin point (i.e., a QPointF); to get the old origin point, call transformOriginPoint(). Do not call setTransformOriginPoint() in itemChange() as this notification is delivered; instead, you can return the new transform origin point from itemChange(). (C++ enum variant: ItemTransformOriginPointChange = 32
)
Sourcepub const ItemTransformOriginPointHasChanged: GraphicsItemChange
pub const ItemTransformOriginPointHasChanged: GraphicsItemChange
The item’s transform origin point property has changed. This notification is sent if the ItemSendsGeometryChanges flag is enabled, and after the item’s transform origin point property has changed. The value argument is the new origin point (i.e., a QPointF), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). Do not call setTransformOriginPoint() in itemChange() as this notification is delivered. (C++ enum variant: ItemTransformOriginPointHasChanged = 33
)
Trait Implementations§
Source§impl Clone for GraphicsItemChange
impl Clone for GraphicsItemChange
Source§fn clone(&self) -> GraphicsItemChange
fn clone(&self) -> GraphicsItemChange
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more