Struct qt_gui::QTextOption
source · #[repr(C)]pub struct QTextOption { /* private fields */ }
Expand description
The QTextOption class provides a description of general rich text properties.
C++ class: QTextOption
.
The QTextOption class provides a description of general rich text properties.
QTextOption is used to encapsulate common rich text properties in a single object. It contains information about text alignment, layout direction, word wrapping, and other standard properties associated with text rendering and layout.
Implementations§
source§impl QTextOption
impl QTextOption
sourcepub unsafe fn alignment(&self) -> QFlags<AlignmentFlag>
pub unsafe fn alignment(&self) -> QFlags<AlignmentFlag>
Returns the text alignment defined by the option.
Calls C++ function: QFlags<Qt::AlignmentFlag> QTextOption::alignment() const
.
Returns the text alignment defined by the option.
See also setAlignment().
sourcepub unsafe fn copy_from(
&self,
o: impl CastInto<Ref<QTextOption>>
) -> Ref<QTextOption>
pub unsafe fn copy_from( &self, o: impl CastInto<Ref<QTextOption>> ) -> Ref<QTextOption>
Returns true
if the text option is the same as the other text option; otherwise returns false
.
Calls C++ function: QTextOption& QTextOption::operator=(const QTextOption& o)
.
Returns true
if the text option is the same as the other text option; otherwise returns false
.
sourcepub unsafe fn flags(&self) -> QFlags<Flag>
pub unsafe fn flags(&self) -> QFlags<Flag>
Returns the flags associated with the option.
Calls C++ function: QFlags<QTextOption::Flag> QTextOption::flags() const
.
Returns the flags associated with the option.
See also setFlags().
sourcepub unsafe fn new_0a() -> CppBox<QTextOption>
pub unsafe fn new_0a() -> CppBox<QTextOption>
Constructs a text option with default properties for text. The text alignment property is set to Qt::AlignLeft. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.
Calls C++ function: [constructor] void QTextOption::QTextOption()
.
Constructs a text option with default properties for text. The text alignment property is set to Qt::AlignLeft. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.
sourcepub unsafe fn new_1a(alignment: QFlags<AlignmentFlag>) -> CppBox<QTextOption>
pub unsafe fn new_1a(alignment: QFlags<AlignmentFlag>) -> CppBox<QTextOption>
Constructs a text option with the given alignment for text. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.
Calls C++ function: [constructor] void QTextOption::QTextOption(QFlags<Qt::AlignmentFlag> alignment)
.
Constructs a text option with the given alignment for text. The word wrap property is set to QTextOption::WordWrap. The using of design metrics flag is set to false.
sourcepub unsafe fn new_copy(
o: impl CastInto<Ref<QTextOption>>
) -> CppBox<QTextOption>
pub unsafe fn new_copy( o: impl CastInto<Ref<QTextOption>> ) -> CppBox<QTextOption>
Construct a copy of the other text option.
Calls C++ function: [constructor] void QTextOption::QTextOption(const QTextOption& o)
.
Construct a copy of the other text option.
sourcepub unsafe fn set_alignment(&self, alignment: QFlags<AlignmentFlag>)
pub unsafe fn set_alignment(&self, alignment: QFlags<AlignmentFlag>)
Sets the option's text alignment to the specified alignment.
Calls C++ function: void QTextOption::setAlignment(QFlags<Qt::AlignmentFlag> alignment)
.
Sets the option’s text alignment to the specified alignment.
See also alignment().
sourcepub unsafe fn set_flags(&self, flags: QFlags<Flag>)
pub unsafe fn set_flags(&self, flags: QFlags<Flag>)
Sets the flags associated with the option to the given flags.
Calls C++ function: void QTextOption::setFlags(QFlags<QTextOption::Flag> flags)
.
Sets the flags associated with the option to the given flags.
See also flags().
sourcepub unsafe fn set_tab_array(&self, tab_stops: impl CastInto<Ref<QListOfDouble>>)
pub unsafe fn set_tab_array(&self, tab_stops: impl CastInto<Ref<QListOfDouble>>)
Sets the tab positions for the text layout to those specified by tabStops.
Calls C++ function: void QTextOption::setTabArray(const QList<double>& tabStops)
.
Sets the tab positions for the text layout to those specified by tabStops.
See also tabArray(), setTabStop(), and setTabs().
sourcepub unsafe fn set_tab_stop(&self, tab_stop: c_double)
pub unsafe fn set_tab_stop(&self, tab_stop: c_double)
Sets the default distance in device units between tab stops to the value specified by tabStop.
Calls C++ function: void QTextOption::setTabStop(double tabStop)
.
Sets the default distance in device units between tab stops to the value specified by tabStop.
See also tabStop(), setTabArray(), setTabs(), and tabs().
sourcepub unsafe fn set_tab_stop_distance(&self, tab_stop_distance: c_double)
Available on cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn set_tab_stop_distance(&self, tab_stop_distance: c_double)
cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Sets the default distance in device units between tab stops to the value specified by tabStopDistance.
Calls C++ function: void QTextOption::setTabStopDistance(double tabStopDistance)
.
Sets the default distance in device units between tab stops to the value specified by tabStopDistance.
This function was introduced in Qt 5.10.
See also tabStopDistance(), setTabArray(), setTabs(), and tabs().
sourcepub unsafe fn set_tabs(&self, tab_stops: impl CastInto<Ref<QListOfTab>>)
pub unsafe fn set_tabs(&self, tab_stops: impl CastInto<Ref<QListOfTab>>)
Set the Tab properties to tabStops.
Calls C++ function: void QTextOption::setTabs(const QList<QTextOption::Tab>& tabStops)
.
sourcepub unsafe fn set_text_direction(&self, a_direction: LayoutDirection)
pub unsafe fn set_text_direction(&self, a_direction: LayoutDirection)
Sets the direction of the text layout defined by the option to the given direction.
Calls C++ function: void QTextOption::setTextDirection(Qt::LayoutDirection aDirection)
.
Sets the direction of the text layout defined by the option to the given direction.
See also textDirection().
sourcepub unsafe fn set_use_design_metrics(&self, b: bool)
pub unsafe fn set_use_design_metrics(&self, b: bool)
If enable is true then the layout will use design metrics; otherwise it will use the metrics of the paint device (which is the default behavior).
Calls C++ function: void QTextOption::setUseDesignMetrics(bool b)
.
If enable is true then the layout will use design metrics; otherwise it will use the metrics of the paint device (which is the default behavior).
See also useDesignMetrics().
sourcepub unsafe fn set_wrap_mode(&self, wrap: WrapMode)
pub unsafe fn set_wrap_mode(&self, wrap: WrapMode)
Sets the option's text wrap mode to the given mode.
Calls C++ function: void QTextOption::setWrapMode(QTextOption::WrapMode wrap)
.
Sets the option’s text wrap mode to the given mode.
See also wrapMode().
sourcepub unsafe fn tab_array(&self) -> CppBox<QListOfDouble>
pub unsafe fn tab_array(&self) -> CppBox<QListOfDouble>
Returns a list of tab positions defined for the text layout.
Calls C++ function: QList<double> QTextOption::tabArray() const
.
Returns a list of tab positions defined for the text layout.
See also setTabArray() and tabStop().
sourcepub unsafe fn tab_stop(&self) -> c_double
pub unsafe fn tab_stop(&self) -> c_double
Returns the distance in device units between tab stops. Convenient function for the above method
Calls C++ function: double QTextOption::tabStop() const
.
Returns the distance in device units between tab stops. Convenient function for the above method
See also setTabStop(), tabArray(), setTabs(), and tabs().
sourcepub unsafe fn tab_stop_distance(&self) -> c_double
Available on cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn tab_stop_distance(&self) -> c_double
cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the distance in device units between tab stops.
Calls C++ function: double QTextOption::tabStopDistance() const
.
Returns the distance in device units between tab stops.
This function was introduced in Qt 5.10.
See also setTabStopDistance(), tabArray(), setTabs(), and tabs().
sourcepub unsafe fn tabs(&self) -> CppBox<QListOfTab>
pub unsafe fn tabs(&self) -> CppBox<QListOfTab>
Returns a list of tab positions defined for the text layout.
Calls C++ function: QList<QTextOption::Tab> QTextOption::tabs() const
.
Returns a list of tab positions defined for the text layout.
This function was introduced in Qt 4.4.
See also tabStop(), setTabs(), and setTabStop().
sourcepub unsafe fn text_direction(&self) -> LayoutDirection
pub unsafe fn text_direction(&self) -> LayoutDirection
Returns the direction of the text layout defined by the option.
Calls C++ function: Qt::LayoutDirection QTextOption::textDirection() const
.
Returns the direction of the text layout defined by the option.
See also setTextDirection().
sourcepub unsafe fn use_design_metrics(&self) -> bool
pub unsafe fn use_design_metrics(&self) -> bool
Returns true
if the layout uses design rather than device metrics; otherwise returns false
.
Calls C++ function: bool QTextOption::useDesignMetrics() const
.
Returns true
if the layout uses design rather than device metrics; otherwise returns false
.
See also setUseDesignMetrics().
sourcepub unsafe fn wrap_mode(&self) -> WrapMode
pub unsafe fn wrap_mode(&self) -> WrapMode
Returns the text wrap mode defined by the option.
Calls C++ function: QTextOption::WrapMode QTextOption::wrapMode() const
.
Returns the text wrap mode defined by the option.
See also setWrapMode().