Struct qt_gui::QTextLength

source ·
#[repr(C)]
pub struct QTextLength { /* private fields */ }
Expand description

The QTextLength class encapsulates the different types of length used in a QTextDocument.

C++ class: QTextLength.

C++ documentation:

The QTextLength class encapsulates the different types of length used in a QTextDocument.

When we specify a value for the length of an element in a text document, we often need to provide some other information so that the length is used in the way we expect. For example, when we specify a table width, the value can represent a fixed number of pixels, or it can be a percentage value. This information changes both the meaning of the value and the way it is used.

Generally, this class is used to specify table widths. These can be specified either as a fixed amount of pixels, as a percentage of the containing frame's width, or by a variable width that allows it to take up just the space it requires.

Implementations§

source§

impl QTextLength

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTextLength>> ) -> Ref<QTextLength>

The QTextLength class encapsulates the different types of length used in a QTextDocument.

Calls C++ function: QTextLength& QTextLength::operator=(const QTextLength& other).

C++ documentation:

The QTextLength class encapsulates the different types of length used in a QTextDocument.

When we specify a value for the length of an element in a text document, we often need to provide some other information so that the length is used in the way we expect. For example, when we specify a table width, the value can represent a fixed number of pixels, or it can be a percentage value. This information changes both the meaning of the value and the way it is used.

Generally, this class is used to specify table widths. These can be specified either as a fixed amount of pixels, as a percentage of the containing frame's width, or by a variable width that allows it to take up just the space it requires.

source

pub unsafe fn new_0a() -> CppBox<QTextLength>

Constructs a new length object which represents a variable size.

Calls C++ function: [constructor] void QTextLength::QTextLength().

C++ documentation:

Constructs a new length object which represents a variable size.

source

pub unsafe fn new_2a(type_: Type, value: c_double) -> CppBox<QTextLength>

Constructs a new length object of the given type and value.

Calls C++ function: [constructor] void QTextLength::QTextLength(QTextLength::Type type, double value).

C++ documentation:

Constructs a new length object of the given type and value.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QTextLength>> ) -> CppBox<QTextLength>

The QTextLength class encapsulates the different types of length used in a QTextDocument.

Calls C++ function: [constructor] void QTextLength::QTextLength(const QTextLength& other).

C++ documentation:

The QTextLength class encapsulates the different types of length used in a QTextDocument.

When we specify a value for the length of an element in a text document, we often need to provide some other information so that the length is used in the way we expect. For example, when we specify a table width, the value can represent a fixed number of pixels, or it can be a percentage value. This information changes both the meaning of the value and the way it is used.

Generally, this class is used to specify table widths. These can be specified either as a fixed amount of pixels, as a percentage of the containing frame's width, or by a variable width that allows it to take up just the space it requires.

source

pub unsafe fn raw_value(&self) -> c_double

Returns the constraint value that is specific for the type of the length. If the length is QTextLength::PercentageLength then the raw value is in percent, in the range of 0 to 100. If the length is QTextLength::FixedLength then that fixed amount is returned. For variable lengths, zero is returned.

Calls C++ function: double QTextLength::rawValue() const.

C++ documentation:

Returns the constraint value that is specific for the type of the length. If the length is QTextLength::PercentageLength then the raw value is in percent, in the range of 0 to 100. If the length is QTextLength::FixedLength then that fixed amount is returned. For variable lengths, zero is returned.

source

pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>

Returns the text length as a QVariant

Calls C++ function: QVariant QTextLength::operator QVariant() const.

C++ documentation:

Returns the text length as a QVariant

source

pub unsafe fn type_(&self) -> Type

Returns the type of this length object.

Calls C++ function: QTextLength::Type QTextLength::type() const.

C++ documentation:

Returns the type of this length object.

See also QTextLength::Type.

source

pub unsafe fn value(&self, maximum_length: c_double) -> c_double

Returns the effective length, constrained by the type of the length object and the specified maximumLength.

Calls C++ function: double QTextLength::value(double maximumLength) const.

C++ documentation:

Returns the effective length, constrained by the type of the length object and the specified maximumLength.

See also type().

Trait Implementations§

source§

impl CppDeletable for QTextLength

source§

unsafe fn delete(&self)

The QTextLength class encapsulates the different types of length used in a QTextDocument.

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

C++ documentation:

The QTextLength class encapsulates the different types of length used in a QTextDocument.

When we specify a value for the length of an element in a text document, we often need to provide some other information so that the length is used in the way we expect. For example, when we specify a table width, the value can represent a fixed number of pixels, or it can be a percentage value. This information changes both the meaning of the value and the way it is used.

Generally, this class is used to specify table widths. These can be specified either as a fixed amount of pixels, as a percentage of the containing frame's width, or by a variable width that allows it to take up just the space it requires.

source§

impl PartialEq<Ref<QTextLength>> for QTextLength

source§

fn eq(&self, other: &Ref<QTextLength>) -> bool

Returns true if this text length is the same as the other text length.

Calls C++ function: bool QTextLength::operator==(const QTextLength& other) const.

C++ documentation:

Returns true if this text length is the same as the other text length.

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.

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.