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.

C++ documentation:

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

source

pub unsafe fn alignment(&self) -> QFlags<AlignmentFlag>

Returns the text alignment defined by the option.

Calls C++ function: QFlags<Qt::AlignmentFlag> QTextOption::alignment() const.

C++ documentation:

Returns the text alignment defined by the option.

See also setAlignment().

source

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).

C++ documentation:

Returns true if the text option is the same as the other text option; otherwise returns false.

source

pub unsafe fn flags(&self) -> QFlags<Flag>

Returns the flags associated with the option.

Calls C++ function: QFlags<QTextOption::Flag> QTextOption::flags() const.

C++ documentation:

Returns the flags associated with the option.

See also setFlags().

source

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().

C++ documentation:

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.

source

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).

C++ documentation:

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.

source

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).

C++ documentation:

Construct a copy of the other text option.

source

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).

C++ documentation:

Sets the option’s text alignment to the specified alignment.

See also alignment().

source

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).

C++ documentation:

Sets the flags associated with the option to the given flags.

See also flags().

source

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).

C++ documentation:

Sets the tab positions for the text layout to those specified by tabStops.

See also tabArray(), setTabStop(), and setTabs().

source

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).

C++ documentation:

Sets the default distance in device units between tab stops to the value specified by tabStop.

See also tabStop(), setTabArray(), setTabs(), and tabs().

source

pub 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.

Sets the default distance in device units between tab stops to the value specified by tabStopDistance.

Calls C++ function: void QTextOption::setTabStopDistance(double tabStopDistance).

C++ documentation:

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().

source

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).

C++ documentation:

Set the Tab properties to tabStops.

See also tabStop() and tabs().

source

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).

C++ documentation:

Sets the direction of the text layout defined by the option to the given direction.

See also textDirection().

source

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).

C++ documentation:

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().

source

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).

C++ documentation:

Sets the option’s text wrap mode to the given mode.

See also wrapMode().

source

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.

C++ documentation:

Returns a list of tab positions defined for the text layout.

See also setTabArray() and tabStop().

source

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.

C++ documentation:

Returns the distance in device units between tab stops. Convenient function for the above method

See also setTabStop(), tabArray(), setTabs(), and tabs().

source

pub 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.

Returns the distance in device units between tab stops.

Calls C++ function: double QTextOption::tabStopDistance() const.

C++ documentation:

Returns the distance in device units between tab stops.

This function was introduced in Qt 5.10.

See also setTabStopDistance(), tabArray(), setTabs(), and tabs().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the direction of the text layout defined by the option.

See also setTextDirection().

source

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.

C++ documentation:

Returns true if the layout uses design rather than device metrics; otherwise returns false.

See also setUseDesignMetrics().

source

pub unsafe fn wrap_mode(&self) -> WrapMode

Returns the text wrap mode defined by the option.

Calls C++ function: QTextOption::WrapMode QTextOption::wrapMode() const.

C++ documentation:

Returns the text wrap mode defined by the option.

See also setWrapMode().

Trait Implementations§

source§

impl CppDeletable for QTextOption

source§

unsafe fn delete(&self)

Destroys the text option.

Calls C++ function: [destructor] void QTextOption::~QTextOption().

C++ documentation:

Destroys the text option.

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, 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.