pub enum ItemSelectionMode {
IntersectsItemShape,
ContainsItemShape,
IntersectsItemBoundingRect,
ContainsItemBoundingRect,
}Expand description
How a region query decides whether an item is picked — Qt’s
Qt::ItemSelectionMode, one variant for one.
The …ItemShape modes consult SceneItem::shape,
in whichever frame keeps both sides’ bands round — usually the item’s
local one, with the region mapped down into it, and scene space when
the region’s band cannot make that trip
(ItemShape::contained_by_scene_region). The …ItemBoundingRect modes
compare the item’s scene AABB, in scene space.
For an item whose transform is identity and whose shape is the default AABB
the two families coincide exactly. For an item carrying a rotation or a
scale they do not: the scene AABB of a rotated box is the enlarged
axis-aligned hull of it, so a bounding-rect query is strictly the looser
test. That is a real behaviour difference, not a rounding one — and it is
an implication, in both directions. A shape lies inside its own box, so
a shape the region meets its box meets too, and a box the region contains
drags its shape in with it. Both are pinned by
tests/prop_selection_modes.rs, and holding them is what decides how a
band may be mapped.
Variants§
IntersectsItemShape
Picked when its shape intersects the region. Qt’s default and Teksilo’s: it is the rule that makes a rubber band agree with a click about what an item is.
ContainsItemShape
Picked when its shape lies entirely inside the region — “select what the lasso fully encircles”.
IntersectsItemBoundingRect
Picked when its scene AABB intersects the region. The cheap mode, and
the one that reproduces the pre-ItemShape marquee.
ContainsItemBoundingRect
Picked when its scene AABB lies entirely inside the region.
Implementations§
Source§impl ItemSelectionMode
impl ItemSelectionMode
Sourcepub fn uses_shape(self) -> bool
pub fn uses_shape(self) -> bool
Whether this mode consults the item’s shape (rather than its AABB).
Sourcepub fn requires_containment(self) -> bool
pub fn requires_containment(self) -> bool
Whether this mode requires full containment (rather than any overlap).
Trait Implementations§
Source§impl Clone for ItemSelectionMode
impl Clone for ItemSelectionMode
Source§fn clone(&self) -> ItemSelectionMode
fn clone(&self) -> ItemSelectionMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ItemSelectionMode
Source§impl Debug for ItemSelectionMode
impl Debug for ItemSelectionMode
Source§impl Default for ItemSelectionMode
impl Default for ItemSelectionMode
Source§fn default() -> ItemSelectionMode
fn default() -> ItemSelectionMode
impl Eq for ItemSelectionMode
Source§impl PartialEq for ItemSelectionMode
impl PartialEq for ItemSelectionMode
impl StructuralPartialEq for ItemSelectionMode
Auto Trait Implementations§
impl Freeze for ItemSelectionMode
impl RefUnwindSafe for ItemSelectionMode
impl Send for ItemSelectionMode
impl Sync for ItemSelectionMode
impl Unpin for ItemSelectionMode
impl UnsafeUnpin for ItemSelectionMode
impl UnwindSafe for ItemSelectionMode
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