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
.
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
impl QTextLength
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTextLength>>
) -> Ref<QTextLength>
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)
.
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.
sourcepub unsafe fn new_0a() -> CppBox<QTextLength>
pub unsafe fn new_0a() -> CppBox<QTextLength>
Constructs a new length object which represents a variable size.
Calls C++ function: [constructor] void QTextLength::QTextLength()
.
Constructs a new length object which represents a variable size.
sourcepub unsafe fn new_2a(type_: Type, value: c_double) -> CppBox<QTextLength>
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)
.
Constructs a new length object of the given type and value.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTextLength>>
) -> CppBox<QTextLength>
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)
.
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.
sourcepub unsafe fn raw_value(&self) -> c_double
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
.
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.
sourcepub unsafe fn to_q_variant(&self) -> CppBox<QVariant>
pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>
sourcepub unsafe fn type_(&self) -> Type
pub unsafe fn type_(&self) -> Type
Returns the type of this length object.
Calls C++ function: QTextLength::Type QTextLength::type() const
.
Returns the type of this length object.
See also QTextLength::Type.
sourcepub unsafe fn value(&self, maximum_length: c_double) -> c_double
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
.
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
impl CppDeletable for QTextLength
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QTextLength class encapsulates the different types of length used in a QTextDocument.
Calls C++ function: [destructor] void QTextLength::~QTextLength()
.
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.