[][src]Struct qt_gui::QTextLength

#[repr(C)]
pub struct QTextLength { /* fields omitted */ }

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.

Methods

impl QTextLength[src]

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QTextLength>>
) -> MutRef<QTextLength>
[src]

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.

pub unsafe fn new_0a() -> CppBox<QTextLength>[src]

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.

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

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.

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

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.

pub unsafe fn raw_value(&self) -> c_double[src]

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.

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

Returns the text length as a QVariant

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

C++ documentation:

Returns the text length as a QVariant

pub unsafe fn type_(&self) -> Type[src]

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.

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

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

impl CppDeletable for QTextLength[src]

unsafe fn delete(&mut self)[src]

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.

impl PartialEq<Ref<QTextLength>> for QTextLength[src]

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

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.