Struct qt_core::AlignmentFlag

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

This enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.

C++ enum: Qt::AlignmentFlag.

C++ documentation:

This enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.

The TextElideMode enum can also be used in many situations to fine-tune the appearance of aligned text.

The horizontal flags are:

The vertical flags are:

You can use only one of the horizontal flags at a time. There is one two-dimensional flag:

You can use at most one horizontal and one vertical flag at a time. Qt::AlignCenter counts as both horizontal and vertical.

Three enum values are useful in applications that can be run in right-to-left mode:

Masks:

Conflicting combinations of flags have undefined meanings.

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

Implementations§

source§

impl AlignmentFlag

source

pub fn to_int(&self) -> c_int

source§

impl AlignmentFlag

source

pub const AlignLeft: AlignmentFlag = _

Aligns with the left edge. (C++ enum variant: AlignLeft = 1)

source

pub const AlignLeading: AlignmentFlag = _

Synonym for Qt::AlignLeft. (C++ enum variant: AlignLeading = 1)

source

pub const AlignRight: AlignmentFlag = _

Aligns with the right edge. (C++ enum variant: AlignRight = 2)

source

pub const AlignTrailing: AlignmentFlag = _

Synonym for Qt::AlignRight. (C++ enum variant: AlignTrailing = 2)

source

pub const AlignHCenter: AlignmentFlag = _

Centers horizontally in the available space. (C++ enum variant: AlignHCenter = 4)

source

pub const AlignJustify: AlignmentFlag = _

Justifies the text in the available space. (C++ enum variant: AlignJustify = 8)

source

pub const AlignAbsolute: AlignmentFlag = _

If the widget’s layout direction is Qt::RightToLeft (instead of Qt::LeftToRight, the default), Qt::AlignLeft refers to the right edge and Qt::AlignRight to the left edge. This is normally the desired behavior. If you want Qt::AlignLeft to always mean “left” and Qt::AlignRight to always mean “right”, combine the flag with Qt::AlignAbsolute. (C++ enum variant: AlignAbsolute = 16)

source

pub const AlignHorizontalMask: AlignmentFlag = _

C++ enum variant: AlignHorizontal_Mask = 31

source

pub const AlignTop: AlignmentFlag = _

Aligns with the top. (C++ enum variant: AlignTop = 32)

source

pub const AlignBottom: AlignmentFlag = _

Aligns with the bottom. (C++ enum variant: AlignBottom = 64)

source

pub const AlignVCenter: AlignmentFlag = _

Centers vertically in the available space. (C++ enum variant: AlignVCenter = 128)

source

pub const AlignBaseline: AlignmentFlag = _

Aligns with the baseline. (C++ enum variant: AlignBaseline = 256)

source

pub const AlignVerticalMask: AlignmentFlag = _

C++ enum variant: AlignVertical_Mask = 480

source

pub const AlignCenter: AlignmentFlag = _

Centers in both dimensions. (C++ enum variant: AlignCenter = 132)

Trait Implementations§

source§

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

§

type Output = QFlags<AlignmentFlag>

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl Clone for AlignmentFlag

source§

fn clone(&self) -> AlignmentFlag

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 AlignmentFlag

source§

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

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

impl From<AlignmentFlag> for QFlags<AlignmentFlag>

source§

fn from(value: AlignmentFlag) -> Self

Converts to this type from the input type.
source§

impl From<AlignmentFlag> for c_int

source§

fn from(value: AlignmentFlag) -> Self

Converts to this type from the input type.
source§

impl From<i32> for AlignmentFlag

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AlignmentFlag

source§

fn eq(&self, other: &AlignmentFlag) -> 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 AlignmentFlag

source§

impl Eq for AlignmentFlag

source§

impl StructuralEq for AlignmentFlag

source§

impl StructuralPartialEq for AlignmentFlag

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.