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; the focus_order callback considers only items with this flag set.
Sourcepub const ACCEPTS_HOVER: Self
pub const ACCEPTS_HOVER: Self
Item dispatches hover events (Qt setAcceptHoverEvents).
Default off; hover handlers wired via ItemBuilder::on_hover
flip this on automatically.
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 NEGATIVE_Z_BEHIND_PARENT: Self
pub const NEGATIVE_Z_BEHIND_PARENT: Self
Children with z < 0 paint behind this item rather
than in front. Mirrors Qt’s ItemNegativeZStacksBehindParent.
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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