pub struct ItemFlags(/* private fields */);Expand description
A bitset of per-item behavior flags.
Use ItemFlags::default for the standard “interactive,
visible, selectable” baseline. Compose flags with | and toggle
them with ItemFlags::set / ItemFlags::contains.
Implementations§
Source§impl ItemFlags
impl ItemFlags
Sourcepub const IS_VISIBLE: Self
pub const IS_VISIBLE: Self
Item paints and is hit-tested. Default on. Clearing this is
the equivalent of Qt’s setVisible(false) — the item is
neither painted nor hit-tested. Children of an invisible
item are also effectively invisible.
Sourcepub const IS_ENABLED: Self
pub const IS_ENABLED: Self
Item dispatches pointer events. Default on. Disabled items are still painted but pass clicks through to items beneath.
Sourcepub const IS_DRAGGABLE: Self
pub const IS_DRAGGABLE: Self
Item participates in drag-to-move. Default off.
Sourcepub const IS_SELECTABLE: Self
pub const IS_SELECTABLE: Self
Item is included in marquee box-select results. Default on.
Sourcepub const IS_FOCUSABLE: Self
pub const IS_FOCUSABLE: Self
Item can take keyboard focus. Default off. Declared only: the
built-in traversal (SceneView::focus_in_direction) walks every
item in insertion order, and a focus_order callback is handed
the whole Scene and filters for itself — nothing reads this bit.
Sourcepub const ACCEPTS_HOVER: Self
pub const ACCEPTS_HOVER: Self
Item dispatches hover events (Qt setAcceptHoverEvents).
Default off. Declared only: the view dispatches hover from the
presence of a SceneItemHandlerSet::on_hover callback, and
nothing sets or reads this bit.
Sourcepub const CLIPS_TO_SHAPE: Self
pub const CLIPS_TO_SHAPE: Self
Item’s paint output is clipped to its local_bounds.
Default off.
Sourcepub const CLIPS_CHILDREN_TO_SHAPE: Self
pub const CLIPS_CHILDREN_TO_SHAPE: Self
Children are clipped to this item’s local_bounds. Default
off; mirrors Qt’s ItemClipsChildrenToShape.
Sourcepub const IGNORES_TRANSFORMATIONS: Self
pub const IGNORES_TRANSFORMATIONS: Self
Item paints and hit-tests at a fixed pixel size, independent
of the view’s zoom and rotation. Its anchor (the item’s
parent-relative scene point) is projected through the view
transform like any other point, so the visible position
follows pan/zoom and tracks the underlying scene data —
but the item itself does not grow with zoom or rotate with
the view. Mirrors Qt’s ItemIgnoresTransformations.
Annotation pins for graph editors, fixed-pixel-size badges
over moving content, chart axis labels. Default off.
Sourcepub const HAS_NO_CONTENTS: Self
pub const HAS_NO_CONTENTS: Self
Item has nothing to paint — the paint walk skips it entirely. Pure logical-only containers (used for AT grouping or hit-test routing) set this. Default off.
Sourcepub const IS_RESIZABLE: Self
pub const IS_RESIZABLE: Self
Item offers resize handles to a selection transform controller.
Default off, like IS_DRAGGABLE.
A resize writes the item’s local_bounds, so the item reflows into the
new box — a heavyweight card relayouts, a RectItem redraws at the new
size, a PathItem fits its geometry to it. Nothing is scaled visually
and then baked.
Sourcepub const IS_ROTATABLE: Self
pub const IS_ROTATABLE: Self
Item offers a rotate handle to a selection transform controller. Default off.
Honoured for the lightweight tier only. A heavyweight entry carrying it
is refused, because place_children sizes a card from the AABB of its
transformed bounds: a rotation there inflates the layout box and rotates
nothing. See SceneView::transform_controller.
Sourcepub const ASPECT_LOCKED: Self
pub const ASPECT_LOCKED: Self
A resize of this item keeps its aspect ratio whatever the controller’s
keep_ratio setting says. Default off.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether the bitset contains every flag in other.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether the bitset shares any flags with other.
Sourcepub fn set(&mut self, flag: Self, on: bool)
pub fn set(&mut self, flag: Self, on: bool)
Set (when on) or clear (when !on) the bits in flag.
Trait Implementations§
Source§impl BitOrAssign for ItemFlags
impl BitOrAssign for ItemFlags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreimpl Copy for ItemFlags
impl Eq for ItemFlags
impl StructuralPartialEq for ItemFlags
Auto Trait Implementations§
impl Freeze for ItemFlags
impl RefUnwindSafe for ItemFlags
impl Send for ItemFlags
impl Sync for ItemFlags
impl Unpin for ItemFlags
impl UnsafeUnpin for ItemFlags
impl UnwindSafe for ItemFlags
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more