[][src]Struct qt_widgets::q_graphics_item::GraphicsItemChange

#[repr(transparent)]pub struct 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).

C++ enum: QGraphicsItem::GraphicsItemChange.

C++ documentation:

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().

Methods

impl GraphicsItemChange[src]

pub fn to_int(&self) -> c_int[src]

impl GraphicsItemChange[src]

pub const ItemPositionChange: GraphicsItemChange[src]

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)

pub const ItemMatrixChange: GraphicsItemChange[src]

The item's affine transformation matrix is changing. This value is obsolete; you can use ItemTransformChange instead. (C++ enum variant: ItemMatrixChange = 1)

pub const ItemVisibleChange: GraphicsItemChange[src]

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)

pub const ItemEnabledChange: GraphicsItemChange[src]

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)

pub const ItemSelectedChange: GraphicsItemChange[src]

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)

pub const ItemParentChange: GraphicsItemChange[src]

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)

pub const ItemChildAddedChange: GraphicsItemChange[src]

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)

pub const ItemChildRemovedChange: GraphicsItemChange[src]

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)

pub const ItemTransformChange: GraphicsItemChange[src]

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)

pub const ItemPositionHasChanged: GraphicsItemChange[src]

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)

pub const ItemTransformHasChanged: GraphicsItemChange[src]

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)

pub const ItemSceneChange: GraphicsItemChange[src]

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)

pub const ItemVisibleHasChanged: GraphicsItemChange[src]

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)

pub const ItemEnabledHasChanged: GraphicsItemChange[src]

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)

pub const ItemSelectedHasChanged: GraphicsItemChange[src]

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)

pub const ItemParentHasChanged: GraphicsItemChange[src]

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)

pub const ItemSceneHasChanged: GraphicsItemChange[src]

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)

pub const ItemCursorChange: GraphicsItemChange[src]

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)

pub const ItemCursorHasChanged: GraphicsItemChange[src]

The item's cursor has changed. The value argument is the new cursor (i.e., a QCursor). Do not call setCursor() as this notification is delivered. The return value is ignored. (C++ enum variant: ItemCursorHasChanged = 18)

pub const ItemToolTipChange: GraphicsItemChange[src]

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)

pub const ItemToolTipHasChanged: GraphicsItemChange[src]

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)

pub const ItemFlagsChange: GraphicsItemChange[src]

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)

pub const ItemFlagsHaveChanged: GraphicsItemChange[src]

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)

pub const ItemZValueChange: GraphicsItemChange[src]

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)

pub const ItemZValueHasChanged: GraphicsItemChange[src]

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)

pub const ItemOpacityChange: GraphicsItemChange[src]

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)

pub const ItemOpacityHasChanged: GraphicsItemChange[src]

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)

pub const ItemScenePositionHasChanged: GraphicsItemChange[src]

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)

pub const ItemRotationChange: GraphicsItemChange[src]

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)

pub const ItemRotationHasChanged: GraphicsItemChange[src]

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)

pub const ItemScaleChange: GraphicsItemChange[src]

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)

pub const ItemScaleHasChanged: GraphicsItemChange[src]

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)

pub const ItemTransformOriginPointChange: GraphicsItemChange[src]

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)

pub const ItemTransformOriginPointHasChanged: GraphicsItemChange[src]

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

impl Clone for GraphicsItemChange[src]

impl Copy for GraphicsItemChange[src]

impl Debug for GraphicsItemChange[src]

impl Eq for GraphicsItemChange[src]

impl From<GraphicsItemChange> for c_int[src]

impl From<i32> for GraphicsItemChange[src]

impl PartialEq<GraphicsItemChange> for GraphicsItemChange[src]

impl StructuralEq for GraphicsItemChange[src]

impl StructuralPartialEq for GraphicsItemChange[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.