Struct qt_core::ItemFlag

source ·
pub struct ItemFlag(/* private fields */);
Expand description

This enum describes the properties of an item:

C++ enum: Qt::ItemFlag.

C++ documentation:

This enum describes the properties of an item:

Note that checkable items need to be given both a suitable set of flags and an initial state, indicating whether the item is checked or not. This is handled automatically for model/view components, but needs to be explicitly set for instances of QListWidgetItem, QTableWidgetItem, and QTreeWidgetItem.

Note that it is undefined behavior to reimplement QAbstractItemModel::hasChildren to return true for an index if that index has the Qt::ItemNeverHasChildren flag set.

The ItemFlags type is a typedef for QFlags<ItemFlag>. It stores an OR combination of ItemFlag values.

See also QAbstractItemModel.

Implementations§

source§

impl ItemFlag

source

pub fn to_int(&self) -> c_int

source§

impl ItemFlag

source

pub const NoItemFlags: ItemFlag = _

It does not have any properties set. (C++ enum variant: NoItemFlags = 0)

source

pub const ItemIsSelectable: ItemFlag = _

It can be selected. (C++ enum variant: ItemIsSelectable = 1)

source

pub const ItemIsEditable: ItemFlag = _

It can be edited. (C++ enum variant: ItemIsEditable = 2)

source

pub const ItemIsDragEnabled: ItemFlag = _

It can be dragged. (C++ enum variant: ItemIsDragEnabled = 4)

source

pub const ItemIsDropEnabled: ItemFlag = _

It can be used as a drop target. (C++ enum variant: ItemIsDropEnabled = 8)

source

pub const ItemIsUserCheckable: ItemFlag = _

It can be checked or unchecked by the user. (C++ enum variant: ItemIsUserCheckable = 16)

source

pub const ItemIsEnabled: ItemFlag = _

The user can interact with the item. (C++ enum variant: ItemIsEnabled = 32)

source

pub const ItemIsAutoTristate: ItemFlag = _

The item’s state depends on the state of its children. This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked). (C++ enum variant: ItemIsAutoTristate = 64)

source

pub const ItemIsTristate: ItemFlag = _

This enum value is deprecated. Use Qt::ItemIsAutoTristate instead. (C++ enum variant: ItemIsTristate = 64)

source

pub const ItemNeverHasChildren: ItemFlag = _

The item never has child items. This is used for optimization purposes only. (C++ enum variant: ItemNeverHasChildren = 128)

source

pub const ItemIsUserTristate: ItemFlag = _

The user can cycle through three separate states. This value has been added in Qt 5.5. (C++ enum variant: ItemIsUserTristate = 256)

Trait Implementations§

source§

impl<T: Into<QFlags<ItemFlag>>> BitOr<T> for ItemFlag

§

type Output = QFlags<ItemFlag>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: T) -> QFlags<ItemFlag>

Performs the | operation. Read more
source§

impl Clone for ItemFlag

source§

fn clone(&self) -> ItemFlag

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ItemFlag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ItemFlag> for QFlags<ItemFlag>

source§

fn from(value: ItemFlag) -> Self

Converts to this type from the input type.
source§

impl From<ItemFlag> for c_int

source§

fn from(value: ItemFlag) -> Self

Converts to this type from the input type.
source§

impl From<i32> for ItemFlag

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ItemFlag

source§

fn eq(&self, other: &ItemFlag) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ItemFlag

source§

impl Eq for ItemFlag

source§

impl StructuralEq for ItemFlag

source§

impl StructuralPartialEq for ItemFlag

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.