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
.
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
impl AlignmentFlag
sourcepub const AlignLeft: AlignmentFlag = _
pub const AlignLeft: AlignmentFlag = _
Aligns with the left edge. (C++ enum variant: AlignLeft = 1
)
sourcepub const AlignLeading: AlignmentFlag = _
pub const AlignLeading: AlignmentFlag = _
Synonym for Qt::AlignLeft. (C++ enum variant: AlignLeading = 1
)
sourcepub const AlignRight: AlignmentFlag = _
pub const AlignRight: AlignmentFlag = _
Aligns with the right edge. (C++ enum variant: AlignRight = 2
)
sourcepub const AlignTrailing: AlignmentFlag = _
pub const AlignTrailing: AlignmentFlag = _
Synonym for Qt::AlignRight. (C++ enum variant: AlignTrailing = 2
)
sourcepub const AlignHCenter: AlignmentFlag = _
pub const AlignHCenter: AlignmentFlag = _
Centers horizontally in the available space. (C++ enum variant: AlignHCenter = 4
)
sourcepub const AlignJustify: AlignmentFlag = _
pub const AlignJustify: AlignmentFlag = _
Justifies the text in the available space. (C++ enum variant: AlignJustify = 8
)
sourcepub const AlignAbsolute: AlignmentFlag = _
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
)
sourcepub const AlignHorizontalMask: AlignmentFlag = _
pub const AlignHorizontalMask: AlignmentFlag = _
C++ enum variant: AlignHorizontal_Mask = 31
sourcepub const AlignTop: AlignmentFlag = _
pub const AlignTop: AlignmentFlag = _
Aligns with the top. (C++ enum variant: AlignTop = 32
)
sourcepub const AlignBottom: AlignmentFlag = _
pub const AlignBottom: AlignmentFlag = _
Aligns with the bottom. (C++ enum variant: AlignBottom = 64
)
sourcepub const AlignVCenter: AlignmentFlag = _
pub const AlignVCenter: AlignmentFlag = _
Centers vertically in the available space. (C++ enum variant: AlignVCenter = 128
)
sourcepub const AlignBaseline: AlignmentFlag = _
pub const AlignBaseline: AlignmentFlag = _
Aligns with the baseline. (C++ enum variant: AlignBaseline = 256
)
sourcepub const AlignVerticalMask: AlignmentFlag = _
pub const AlignVerticalMask: AlignmentFlag = _
C++ enum variant: AlignVertical_Mask = 480
sourcepub const AlignCenter: AlignmentFlag = _
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
impl<T: Into<QFlags<AlignmentFlag>>> BitOr<T> for AlignmentFlag
§type Output = QFlags<AlignmentFlag>
type Output = QFlags<AlignmentFlag>
|
operator.source§impl Clone for AlignmentFlag
impl Clone for AlignmentFlag
source§fn clone(&self) -> AlignmentFlag
fn clone(&self) -> AlignmentFlag
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AlignmentFlag
impl Debug for AlignmentFlag
source§impl From<AlignmentFlag> for QFlags<AlignmentFlag>
impl From<AlignmentFlag> for QFlags<AlignmentFlag>
source§fn from(value: AlignmentFlag) -> Self
fn from(value: AlignmentFlag) -> Self
source§impl From<AlignmentFlag> for c_int
impl From<AlignmentFlag> for c_int
source§fn from(value: AlignmentFlag) -> Self
fn from(value: AlignmentFlag) -> Self
source§impl From<i32> for AlignmentFlag
impl From<i32> for AlignmentFlag
source§impl PartialEq for AlignmentFlag
impl PartialEq for AlignmentFlag
source§fn eq(&self, other: &AlignmentFlag) -> bool
fn eq(&self, other: &AlignmentFlag) -> bool
self
and other
values to be equal, and is used
by ==
.