Struct qt_gui::QTextFrameFormat
source · #[repr(C)]pub struct QTextFrameFormat { /* private fields */ }
Expand description
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
C++ class: QTextFrameFormat
.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.
The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame's padding(). This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.
The position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.
The validity of a QTextFrameFormat object can be determined with the isValid() function.
Implementations§
source§impl QTextFrameFormat
impl QTextFrameFormat
sourcepub unsafe fn border(&self) -> c_double
pub unsafe fn border(&self) -> c_double
Returns the width of the border in pixels.
Calls C++ function: double QTextFrameFormat::border() const
.
Returns the width of the border in pixels.
See also setBorder().
sourcepub unsafe fn border_brush(&self) -> CppBox<QBrush>
pub unsafe fn border_brush(&self) -> CppBox<QBrush>
Returns the brush used for the frame's border.
Calls C++ function: QBrush QTextFrameFormat::borderBrush() const
.
Returns the brush used for the frame’s border.
This function was introduced in Qt 4.3.
See also setBorderBrush().
sourcepub unsafe fn border_style(&self) -> BorderStyle
pub unsafe fn border_style(&self) -> BorderStyle
Returns the style of the frame's border.
Calls C++ function: QTextFrameFormat::BorderStyle QTextFrameFormat::borderStyle() const
.
Returns the style of the frame’s border.
This function was introduced in Qt 4.3.
See also setBorderStyle().
sourcepub unsafe fn bottom_margin(&self) -> c_double
pub unsafe fn bottom_margin(&self) -> c_double
Returns the width of the frame's bottom margin in pixels.
Calls C++ function: double QTextFrameFormat::bottomMargin() const
.
Returns the width of the frame’s bottom margin in pixels.
This function was introduced in Qt 4.3.
See also setBottomMargin().
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTextFrameFormat>>
) -> Ref<QTextFrameFormat>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTextFrameFormat>> ) -> Ref<QTextFrameFormat>
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
Calls C++ function: QTextFrameFormat& QTextFrameFormat::operator=(const QTextFrameFormat& other)
.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.
The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame's padding(). This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.
The position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.
The validity of a QTextFrameFormat object can be determined with the isValid() function.
sourcepub unsafe fn height(&self) -> CppBox<QTextLength>
pub unsafe fn height(&self) -> CppBox<QTextLength>
Returns the height of the frame's border rectangle.
Calls C++ function: QTextLength QTextFrameFormat::height() const
.
Returns the height of the frame’s border rectangle.
See also setHeight().
sourcepub unsafe fn is_valid(&self) -> bool
pub unsafe fn is_valid(&self) -> bool
Returns true
if the format description is valid; otherwise returns false
.
Calls C++ function: bool QTextFrameFormat::isValid() const
.
Returns true
if the format description is valid; otherwise returns false
.
sourcepub unsafe fn left_margin(&self) -> c_double
pub unsafe fn left_margin(&self) -> c_double
Returns the width of the frame's left margin in pixels.
Calls C++ function: double QTextFrameFormat::leftMargin() const
.
Returns the width of the frame’s left margin in pixels.
This function was introduced in Qt 4.3.
See also setLeftMargin().
sourcepub unsafe fn margin(&self) -> c_double
pub unsafe fn margin(&self) -> c_double
Returns the width of the frame's external margin in pixels.
Calls C++ function: double QTextFrameFormat::margin() const
.
Returns the width of the frame’s external margin in pixels.
See also setMargin().
sourcepub unsafe fn new() -> CppBox<QTextFrameFormat>
pub unsafe fn new() -> CppBox<QTextFrameFormat>
Constructs a text frame format object with the default properties.
Calls C++ function: [constructor] void QTextFrameFormat::QTextFrameFormat()
.
Constructs a text frame format object with the default properties.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTextFrameFormat>>
) -> CppBox<QTextFrameFormat>
pub unsafe fn new_copy( other: impl CastInto<Ref<QTextFrameFormat>> ) -> CppBox<QTextFrameFormat>
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
Calls C++ function: [constructor] void QTextFrameFormat::QTextFrameFormat(const QTextFrameFormat& other)
.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.
The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame's padding(). This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.
The position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.
The validity of a QTextFrameFormat object can be determined with the isValid() function.
sourcepub unsafe fn padding(&self) -> c_double
pub unsafe fn padding(&self) -> c_double
Returns the width of the frame's internal padding in pixels.
Calls C++ function: double QTextFrameFormat::padding() const
.
Returns the width of the frame’s internal padding in pixels.
See also setPadding().
sourcepub unsafe fn page_break_policy(&self) -> QFlags<PageBreakFlag>
pub unsafe fn page_break_policy(&self) -> QFlags<PageBreakFlag>
Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto.
Calls C++ function: QFlags<QTextFormat::PageBreakFlag> QTextFrameFormat::pageBreakPolicy() const
.
Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto.
This function was introduced in Qt 4.2.
See also setPageBreakPolicy().
sourcepub unsafe fn position(&self) -> Position
pub unsafe fn position(&self) -> Position
Returns the positioning policy for frames with this frame format.
Calls C++ function: QTextFrameFormat::Position QTextFrameFormat::position() const
.
Returns the positioning policy for frames with this frame format.
See also setPosition().
sourcepub unsafe fn right_margin(&self) -> c_double
pub unsafe fn right_margin(&self) -> c_double
Returns the width of the frame's right margin in pixels.
Calls C++ function: double QTextFrameFormat::rightMargin() const
.
Returns the width of the frame’s right margin in pixels.
This function was introduced in Qt 4.3.
See also setRightMargin().
sourcepub unsafe fn set_border(&self, border: c_double)
pub unsafe fn set_border(&self, border: c_double)
Sets the width (in pixels) of the frame's border.
Calls C++ function: void QTextFrameFormat::setBorder(double border)
.
Sets the width (in pixels) of the frame’s border.
See also border().
sourcepub unsafe fn set_border_brush(&self, brush: impl CastInto<Ref<QBrush>>)
pub unsafe fn set_border_brush(&self, brush: impl CastInto<Ref<QBrush>>)
Sets the brush used for the frame's border.
Calls C++ function: void QTextFrameFormat::setBorderBrush(const QBrush& brush)
.
Sets the brush used for the frame’s border.
This function was introduced in Qt 4.3.
See also borderBrush().
sourcepub unsafe fn set_border_style(&self, style: BorderStyle)
pub unsafe fn set_border_style(&self, style: BorderStyle)
Sets the style of the frame's border.
Calls C++ function: void QTextFrameFormat::setBorderStyle(QTextFrameFormat::BorderStyle style)
.
Sets the style of the frame’s border.
This function was introduced in Qt 4.3.
See also borderStyle().
sourcepub unsafe fn set_bottom_margin(&self, margin: c_double)
pub unsafe fn set_bottom_margin(&self, margin: c_double)
Sets the frame's bottom margin in pixels.
Calls C++ function: void QTextFrameFormat::setBottomMargin(double margin)
.
Sets the frame’s bottom margin in pixels.
This function was introduced in Qt 4.3.
See also bottomMargin().
sourcepub unsafe fn set_height_double(&self, height: c_double)
pub unsafe fn set_height_double(&self, height: c_double)
This is an overloaded function.
Calls C++ function: void QTextFrameFormat::setHeight(double height)
.
This is an overloaded function.
Sets the frame's height.
sourcepub unsafe fn set_height_q_text_length(
&self,
height: impl CastInto<Ref<QTextLength>>
)
pub unsafe fn set_height_q_text_length( &self, height: impl CastInto<Ref<QTextLength>> )
Sets the frame's height.
Calls C++ function: void QTextFrameFormat::setHeight(const QTextLength& height)
.
Sets the frame’s height.
See also height().
sourcepub unsafe fn set_left_margin(&self, margin: c_double)
pub unsafe fn set_left_margin(&self, margin: c_double)
Sets the frame's left margin in pixels.
Calls C++ function: void QTextFrameFormat::setLeftMargin(double margin)
.
Sets the frame’s left margin in pixels.
This function was introduced in Qt 4.3.
See also leftMargin().
sourcepub unsafe fn set_margin(&self, margin: c_double)
pub unsafe fn set_margin(&self, margin: c_double)
Sets the frame's margin in pixels. This method also sets the left, right, top and bottom margins of the frame to the same value. The individual margins override the general margin.
Calls C++ function: void QTextFrameFormat::setMargin(double margin)
.
Sets the frame’s margin in pixels. This method also sets the left, right, top and bottom margins of the frame to the same value. The individual margins override the general margin.
See also margin().
sourcepub unsafe fn set_padding(&self, padding: c_double)
pub unsafe fn set_padding(&self, padding: c_double)
Sets the width of the frame's internal padding in pixels.
Calls C++ function: void QTextFrameFormat::setPadding(double padding)
.
Sets the width of the frame’s internal padding in pixels.
See also padding().
sourcepub unsafe fn set_page_break_policy(&self, flags: QFlags<PageBreakFlag>)
pub unsafe fn set_page_break_policy(&self, flags: QFlags<PageBreakFlag>)
Sets the page break policy for the frame/table to policy.
Calls C++ function: void QTextFrameFormat::setPageBreakPolicy(QFlags<QTextFormat::PageBreakFlag> flags)
.
Sets the page break policy for the frame/table to policy.
This function was introduced in Qt 4.2.
See also pageBreakPolicy().
sourcepub unsafe fn set_position(&self, f: Position)
pub unsafe fn set_position(&self, f: Position)
Sets the policy for positioning frames with this frame format.
Calls C++ function: void QTextFrameFormat::setPosition(QTextFrameFormat::Position f)
.
Sets the policy for positioning frames with this frame format.
See also position().
sourcepub unsafe fn set_right_margin(&self, margin: c_double)
pub unsafe fn set_right_margin(&self, margin: c_double)
Sets the frame's right margin in pixels.
Calls C++ function: void QTextFrameFormat::setRightMargin(double margin)
.
Sets the frame’s right margin in pixels.
This function was introduced in Qt 4.3.
See also rightMargin().
sourcepub unsafe fn set_top_margin(&self, margin: c_double)
pub unsafe fn set_top_margin(&self, margin: c_double)
Sets the frame's top margin in pixels.
Calls C++ function: void QTextFrameFormat::setTopMargin(double margin)
.
Sets the frame’s top margin in pixels.
This function was introduced in Qt 4.3.
See also topMargin().
sourcepub unsafe fn set_width_double(&self, width: c_double)
pub unsafe fn set_width_double(&self, width: c_double)
This is an overloaded function.
Calls C++ function: void QTextFrameFormat::setWidth(double width)
.
This is an overloaded function.
Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width.
sourcepub unsafe fn set_width_q_text_length(
&self,
length: impl CastInto<Ref<QTextLength>>
)
pub unsafe fn set_width_q_text_length( &self, length: impl CastInto<Ref<QTextLength>> )
Sets the frame's border rectangle's width.
Calls C++ function: void QTextFrameFormat::setWidth(const QTextLength& length)
.
Sets the frame’s border rectangle’s width.
See also width() and QTextLength.
sourcepub unsafe fn top_margin(&self) -> c_double
pub unsafe fn top_margin(&self) -> c_double
Returns the width of the frame's top margin in pixels.
Calls C++ function: double QTextFrameFormat::topMargin() const
.
Returns the width of the frame’s top margin in pixels.
This function was introduced in Qt 4.3.
See also setTopMargin().
sourcepub unsafe fn width(&self) -> CppBox<QTextLength>
pub unsafe fn width(&self) -> CppBox<QTextLength>
Returns the width of the frame's border rectangle.
Calls C++ function: QTextLength QTextFrameFormat::width() const
.
Returns the width of the frame’s border rectangle.
See also setWidth() and QTextLength.
Methods from Deref<Target = QTextFormat>§
sourcepub unsafe fn background(&self) -> CppBox<QBrush>
pub unsafe fn background(&self) -> CppBox<QBrush>
Returns the brush used to paint the document's background.
Calls C++ function: QBrush QTextFormat::background() const
.
Returns the brush used to paint the document’s background.
See also setBackground(), clearBackground(), and foreground().
sourcepub unsafe fn bool_property(&self, property_id: c_int) -> bool
pub unsafe fn bool_property(&self, property_id: c_int) -> bool
Returns the value of the property specified by propertyId. If the property isn't of QTextFormat::Bool type, false is returned instead.
Calls C++ function: bool QTextFormat::boolProperty(int propertyId) const
.
Returns the value of the property specified by propertyId. If the property isn’t of QTextFormat::Bool type, false is returned instead.
See also setProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn brush_property(&self, property_id: c_int) -> CppBox<QBrush>
pub unsafe fn brush_property(&self, property_id: c_int) -> CppBox<QBrush>
Returns the value of the property given by propertyId; if the property isn't of QVariant::Brush type, Qt::NoBrush is returned instead.
Calls C++ function: QBrush QTextFormat::brushProperty(int propertyId) const
.
Returns the value of the property given by propertyId; if the property isn’t of QVariant::Brush type, Qt::NoBrush is returned instead.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn clear_background(&self)
pub unsafe fn clear_background(&self)
Clears the brush used to paint the document's background. The default brush will be used.
Calls C++ function: void QTextFormat::clearBackground()
.
Clears the brush used to paint the document’s background. The default brush will be used.
See also background(), setBackground(), and clearForeground().
sourcepub unsafe fn clear_foreground(&self)
pub unsafe fn clear_foreground(&self)
Clears the brush used to paint the document's foreground. The default brush will be used.
Calls C++ function: void QTextFormat::clearForeground()
.
Clears the brush used to paint the document’s foreground. The default brush will be used.
See also foreground(), setForeground(), and clearBackground().
sourcepub unsafe fn clear_property(&self, property_id: c_int)
pub unsafe fn clear_property(&self, property_id: c_int)
Clears the value of the property given by propertyId
Calls C++ function: void QTextFormat::clearProperty(int propertyId)
.
Clears the value of the property given by propertyId
See also Property.
sourcepub unsafe fn color_property(&self, property_id: c_int) -> CppBox<QColor>
pub unsafe fn color_property(&self, property_id: c_int) -> CppBox<QColor>
Returns the value of the property given by propertyId; if the property isn't of QVariant::Color type, an invalid color is returned instead.
Calls C++ function: QColor QTextFormat::colorProperty(int propertyId) const
.
Returns the value of the property given by propertyId; if the property isn’t of QVariant::Color type, an invalid color is returned instead.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn copy_from(
&self,
rhs: impl CastInto<Ref<QTextFormat>>
) -> Ref<QTextFormat>
pub unsafe fn copy_from( &self, rhs: impl CastInto<Ref<QTextFormat>> ) -> Ref<QTextFormat>
Assigns the other text format to this text format, and returns a reference to this text format.
Calls C++ function: QTextFormat& QTextFormat::operator=(const QTextFormat& rhs)
.
Assigns the other text format to this text format, and returns a reference to this text format.
sourcepub unsafe fn double_property(&self, property_id: c_int) -> c_double
pub unsafe fn double_property(&self, property_id: c_int) -> c_double
Returns the value of the property specified by propertyId. If the property isn't of QVariant::Double or QMetaType::Float type, 0 is returned instead.
Calls C++ function: double QTextFormat::doubleProperty(int propertyId) const
.
Returns the value of the property specified by propertyId. If the property isn’t of QVariant::Double or QMetaType::Float type, 0 is returned instead.
See also setProperty(), boolProperty(), intProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn foreground(&self) -> CppBox<QBrush>
pub unsafe fn foreground(&self) -> CppBox<QBrush>
Returns the brush used to render foreground details, such as text, frame outlines, and table borders.
Calls C++ function: QBrush QTextFormat::foreground() const
.
Returns the brush used to render foreground details, such as text, frame outlines, and table borders.
See also setForeground(), clearForeground(), and background().
sourcepub unsafe fn has_property(&self, property_id: c_int) -> bool
pub unsafe fn has_property(&self, property_id: c_int) -> bool
Returns true
if the text format has a property with the given propertyId; otherwise returns false
.
Calls C++ function: bool QTextFormat::hasProperty(int propertyId) const
.
Returns true
if the text format has a property with the given propertyId; otherwise returns false
.
See also properties() and Property.
sourcepub unsafe fn int_property(&self, property_id: c_int) -> c_int
pub unsafe fn int_property(&self, property_id: c_int) -> c_int
Returns the value of the property specified by propertyId. If the property is not of QTextFormat::Integer type, 0 is returned instead.
Calls C++ function: int QTextFormat::intProperty(int propertyId) const
.
Returns the value of the property specified by propertyId. If the property is not of QTextFormat::Integer type, 0 is returned instead.
See also setProperty(), boolProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn is_block_format(&self) -> bool
pub unsafe fn is_block_format(&self) -> bool
Returns true
if this text format is a BlockFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isBlockFormat() const
.
Returns true
if this text format is a BlockFormat
; otherwise returns false
.
sourcepub unsafe fn is_char_format(&self) -> bool
pub unsafe fn is_char_format(&self) -> bool
Returns true
if this text format is a CharFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isCharFormat() const
.
Returns true
if this text format is a CharFormat
; otherwise returns false
.
sourcepub unsafe fn is_empty(&self) -> bool
pub unsafe fn is_empty(&self) -> bool
Returns true if the format does not store any properties; false otherwise.
Calls C++ function: bool QTextFormat::isEmpty() const
.
Returns true if the format does not store any properties; false otherwise.
This function was introduced in Qt 5.3.
See also propertyCount() and properties().
sourcepub unsafe fn is_frame_format(&self) -> bool
pub unsafe fn is_frame_format(&self) -> bool
Returns true
if this text format is a FrameFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isFrameFormat() const
.
Returns true
if this text format is a FrameFormat
; otherwise returns false
.
sourcepub unsafe fn is_image_format(&self) -> bool
pub unsafe fn is_image_format(&self) -> bool
Returns true
if this text format is an image format; otherwise returns false
.
Calls C++ function: bool QTextFormat::isImageFormat() const
.
Returns true
if this text format is an image format; otherwise returns false
.
sourcepub unsafe fn is_list_format(&self) -> bool
pub unsafe fn is_list_format(&self) -> bool
Returns true
if this text format is a ListFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isListFormat() const
.
Returns true
if this text format is a ListFormat
; otherwise returns false
.
sourcepub unsafe fn is_table_cell_format(&self) -> bool
pub unsafe fn is_table_cell_format(&self) -> bool
Returns true
if this text format is a TableCellFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isTableCellFormat() const
.
Returns true
if this text format is a TableCellFormat
; otherwise returns false
.
This function was introduced in Qt 4.4.
sourcepub unsafe fn is_table_format(&self) -> bool
pub unsafe fn is_table_format(&self) -> bool
Returns true
if this text format is a TableFormat
; otherwise returns false
.
Calls C++ function: bool QTextFormat::isTableFormat() const
.
Returns true
if this text format is a TableFormat
; otherwise returns false
.
sourcepub unsafe fn is_valid(&self) -> bool
pub unsafe fn is_valid(&self) -> bool
Returns true
if the format is valid (i.e. is not InvalidFormat); otherwise returns false
.
Calls C++ function: bool QTextFormat::isValid() const
.
Returns true
if the format is valid (i.e. is not InvalidFormat); otherwise returns false
.
sourcepub unsafe fn layout_direction(&self) -> LayoutDirection
pub unsafe fn layout_direction(&self) -> LayoutDirection
Returns the document's layout direction.
Calls C++ function: Qt::LayoutDirection QTextFormat::layoutDirection() const
.
Returns the document’s layout direction.
See also setLayoutDirection().
sourcepub unsafe fn length_property(&self, property_id: c_int) -> CppBox<QTextLength>
pub unsafe fn length_property(&self, property_id: c_int) -> CppBox<QTextLength>
Returns the value of the property given by propertyId.
Calls C++ function: QTextLength QTextFormat::lengthProperty(int propertyId) const
.
Returns the value of the property given by propertyId.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn length_vector_property(
&self,
property_id: c_int
) -> CppBox<QVectorOfQTextLength>
pub unsafe fn length_vector_property( &self, property_id: c_int ) -> CppBox<QVectorOfQTextLength>
Returns the value of the property given by propertyId. If the property isn't of QTextFormat::LengthVector type, an empty length vector is returned instead.
Calls C++ function: QVector<QTextLength> QTextFormat::lengthVectorProperty(int propertyId) const
.
Returns the value of the property given by propertyId. If the property isn’t of QTextFormat::LengthVector type, an empty length vector is returned instead.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), and Property.
sourcepub unsafe fn merge(&self, other: impl CastInto<Ref<QTextFormat>>)
pub unsafe fn merge(&self, other: impl CastInto<Ref<QTextFormat>>)
Merges the other format with this format; where there are conflicts the other format takes precedence.
Calls C++ function: void QTextFormat::merge(const QTextFormat& other)
.
Merges the other format with this format; where there are conflicts the other format takes precedence.
sourcepub unsafe fn object_index(&self) -> c_int
pub unsafe fn object_index(&self) -> c_int
Returns the index of the format object, or -1 if the format object is invalid.
Calls C++ function: int QTextFormat::objectIndex() const
.
Returns the index of the format object, or -1 if the format object is invalid.
See also setObjectIndex().
sourcepub unsafe fn object_type(&self) -> c_int
pub unsafe fn object_type(&self) -> c_int
Returns the text format's object type.
Calls C++ function: int QTextFormat::objectType() const
.
Returns the text format’s object type.
See also ObjectTypes and setObjectType().
sourcepub unsafe fn pen_property(&self, property_id: c_int) -> CppBox<QPen>
pub unsafe fn pen_property(&self, property_id: c_int) -> CppBox<QPen>
Returns the value of the property given by propertyId; if the property isn't of QVariant::Pen type, Qt::NoPen is returned instead.
Calls C++ function: QPen QTextFormat::penProperty(int propertyId) const
.
Returns the value of the property given by propertyId; if the property isn’t of QVariant::Pen type, Qt::NoPen is returned instead.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn properties(&self) -> CppBox<QMapOfIntQVariant>
pub unsafe fn properties(&self) -> CppBox<QMapOfIntQVariant>
Returns a map with all properties of this text format.
Calls C++ function: QMap<int, QVariant> QTextFormat::properties() const
.
Returns a map with all properties of this text format.
sourcepub unsafe fn property(&self, property_id: c_int) -> CppBox<QVariant>
pub unsafe fn property(&self, property_id: c_int) -> CppBox<QVariant>
Returns the property specified by the given propertyId.
Calls C++ function: QVariant QTextFormat::property(int propertyId) const
.
Returns the property specified by the given propertyId.
See also setProperty() and Property.
sourcepub unsafe fn property_count(&self) -> c_int
pub unsafe fn property_count(&self) -> c_int
Returns the number of properties stored in the format.
Calls C++ function: int QTextFormat::propertyCount() const
.
Returns the number of properties stored in the format.
This function was introduced in Qt 4.3.
sourcepub unsafe fn set_background(&self, brush: impl CastInto<Ref<QBrush>>)
pub unsafe fn set_background(&self, brush: impl CastInto<Ref<QBrush>>)
Sets the brush use to paint the document's background to the brush specified.
Calls C++ function: void QTextFormat::setBackground(const QBrush& brush)
.
Sets the brush use to paint the document’s background to the brush specified.
See also background(), clearBackground(), and setForeground().
sourcepub unsafe fn set_foreground(&self, brush: impl CastInto<Ref<QBrush>>)
pub unsafe fn set_foreground(&self, brush: impl CastInto<Ref<QBrush>>)
Sets the foreground brush to the specified brush. The foreground brush is mostly used to render text.
Calls C++ function: void QTextFormat::setForeground(const QBrush& brush)
.
Sets the foreground brush to the specified brush. The foreground brush is mostly used to render text.
See also foreground(), clearForeground(), and setBackground().
sourcepub unsafe fn set_layout_direction(&self, direction: LayoutDirection)
pub unsafe fn set_layout_direction(&self, direction: LayoutDirection)
Sets the document's layout direction to the specified direction.
Calls C++ function: void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)
.
Sets the document’s layout direction to the specified direction.
See also layoutDirection().
sourcepub unsafe fn set_object_index(&self, object: c_int)
pub unsafe fn set_object_index(&self, object: c_int)
Sets the format object's object index.
Calls C++ function: void QTextFormat::setObjectIndex(int object)
.
Sets the format object’s object index.
See also objectIndex().
sourcepub unsafe fn set_object_type(&self, type_: c_int)
pub unsafe fn set_object_type(&self, type_: c_int)
Sets the text format's object type to type.
Calls C++ function: void QTextFormat::setObjectType(int type)
.
Sets the text format’s object type to type.
See also ObjectTypes and objectType().
sourcepub unsafe fn set_property_int_q_variant(
&self,
property_id: c_int,
value: impl CastInto<Ref<QVariant>>
)
pub unsafe fn set_property_int_q_variant( &self, property_id: c_int, value: impl CastInto<Ref<QVariant>> )
Sets the property specified by the propertyId to the given value.
Calls C++ function: void QTextFormat::setProperty(int propertyId, const QVariant& value)
.
sourcepub unsafe fn set_property_int_q_vector_of_q_text_length(
&self,
property_id: c_int,
lengths: impl CastInto<Ref<QVectorOfQTextLength>>
)
pub unsafe fn set_property_int_q_vector_of_q_text_length( &self, property_id: c_int, lengths: impl CastInto<Ref<QVectorOfQTextLength>> )
Sets the value of the property given by propertyId to value.
Calls C++ function: void QTextFormat::setProperty(int propertyId, const QVector<QTextLength>& lengths)
.
Sets the value of the property given by propertyId to value.
See also lengthVectorProperty() and Property.
sourcepub unsafe fn string_property(&self, property_id: c_int) -> CppBox<QString>
pub unsafe fn string_property(&self, property_id: c_int) -> CppBox<QString>
Returns the value of the property given by propertyId; if the property isn't of QVariant::String type, an empty string is returned instead.
Calls C++ function: QString QTextFormat::stringProperty(int propertyId) const
.
Returns the value of the property given by propertyId; if the property isn’t of QVariant::String type, an empty string is returned instead.
See also setProperty(), boolProperty(), intProperty(), doubleProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.
sourcepub unsafe fn swap(&self, other: impl CastInto<Ref<QTextFormat>>)
pub unsafe fn swap(&self, other: impl CastInto<Ref<QTextFormat>>)
Swaps this text format with other. This function is very fast and never fails.
Calls C++ function: void QTextFormat::swap(QTextFormat& other)
.
Swaps this text format with other. This function is very fast and never fails.
This function was introduced in Qt 5.0.
sourcepub unsafe fn to_block_format(&self) -> CppBox<QTextBlockFormat>
pub unsafe fn to_block_format(&self) -> CppBox<QTextBlockFormat>
Returns this format as a block format.
Calls C++ function: QTextBlockFormat QTextFormat::toBlockFormat() const
.
Returns this format as a block format.
sourcepub unsafe fn to_char_format(&self) -> CppBox<QTextCharFormat>
pub unsafe fn to_char_format(&self) -> CppBox<QTextCharFormat>
Returns this format as a character format.
Calls C++ function: QTextCharFormat QTextFormat::toCharFormat() const
.
Returns this format as a character format.
sourcepub unsafe fn to_frame_format(&self) -> CppBox<QTextFrameFormat>
pub unsafe fn to_frame_format(&self) -> CppBox<QTextFrameFormat>
Returns this format as a frame format.
Calls C++ function: QTextFrameFormat QTextFormat::toFrameFormat() const
.
Returns this format as a frame format.
sourcepub unsafe fn to_image_format(&self) -> CppBox<QTextImageFormat>
pub unsafe fn to_image_format(&self) -> CppBox<QTextImageFormat>
Returns this format as an image format.
Calls C++ function: QTextImageFormat QTextFormat::toImageFormat() const
.
Returns this format as an image format.
sourcepub unsafe fn to_list_format(&self) -> CppBox<QTextListFormat>
pub unsafe fn to_list_format(&self) -> CppBox<QTextListFormat>
Returns this format as a list format.
Calls C++ function: QTextListFormat QTextFormat::toListFormat() const
.
Returns this format as a list format.
sourcepub unsafe fn to_q_variant(&self) -> CppBox<QVariant>
pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>
sourcepub unsafe fn to_table_cell_format(&self) -> CppBox<QTextTableCellFormat>
pub unsafe fn to_table_cell_format(&self) -> CppBox<QTextTableCellFormat>
Returns this format as a table cell format.
Calls C++ function: QTextTableCellFormat QTextFormat::toTableCellFormat() const
.
Returns this format as a table cell format.
This function was introduced in Qt 4.4.
sourcepub unsafe fn to_table_format(&self) -> CppBox<QTextTableFormat>
pub unsafe fn to_table_format(&self) -> CppBox<QTextTableFormat>
Returns this format as a table format.
Calls C++ function: QTextTableFormat QTextFormat::toTableFormat() const
.
Returns this format as a table format.
sourcepub unsafe fn type_(&self) -> c_int
pub unsafe fn type_(&self) -> c_int
Returns the type of this format.
Calls C++ function: int QTextFormat::type() const
.
Returns the type of this format.
See also FormatType.
Trait Implementations§
source§impl CppDeletable for QTextFrameFormat
impl CppDeletable for QTextFrameFormat
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
Calls C++ function: [destructor] void QTextFrameFormat::~QTextFrameFormat()
.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.
The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame's padding(). This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.
The position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.
The validity of a QTextFrameFormat object can be determined with the isValid() function.
source§impl Deref for QTextFrameFormat
impl Deref for QTextFrameFormat
source§fn deref(&self) -> &QTextFormat
fn deref(&self) -> &QTextFormat
Calls C++ function: QTextFormat* static_cast<QTextFormat*>(QTextFrameFormat* ptr)
.
§type Target = QTextFormat
type Target = QTextFormat
source§impl StaticDowncast<QTextFrameFormat> for QTextFormat
impl StaticDowncast<QTextFrameFormat> for QTextFormat
source§unsafe fn static_downcast(ptr: Ptr<QTextFormat>) -> Ptr<QTextFrameFormat>
unsafe fn static_downcast(ptr: Ptr<QTextFormat>) -> Ptr<QTextFrameFormat>
Calls C++ function: QTextFrameFormat* static_cast<QTextFrameFormat*>(QTextFormat* ptr)
.
source§impl StaticDowncast<QTextTableFormat> for QTextFrameFormat
impl StaticDowncast<QTextTableFormat> for QTextFrameFormat
source§unsafe fn static_downcast(ptr: Ptr<QTextFrameFormat>) -> Ptr<QTextTableFormat>
unsafe fn static_downcast(ptr: Ptr<QTextFrameFormat>) -> Ptr<QTextTableFormat>
Calls C++ function: QTextTableFormat* static_cast<QTextTableFormat*>(QTextFrameFormat* ptr)
.
source§impl StaticUpcast<QTextFormat> for QTextFrameFormat
impl StaticUpcast<QTextFormat> for QTextFrameFormat
source§unsafe fn static_upcast(ptr: Ptr<QTextFrameFormat>) -> Ptr<QTextFormat>
unsafe fn static_upcast(ptr: Ptr<QTextFrameFormat>) -> Ptr<QTextFormat>
Calls C++ function: QTextFormat* static_cast<QTextFormat*>(QTextFrameFormat* ptr)
.
source§impl StaticUpcast<QTextFrameFormat> for QTextTableFormat
impl StaticUpcast<QTextFrameFormat> for QTextTableFormat
source§unsafe fn static_upcast(ptr: Ptr<QTextTableFormat>) -> Ptr<QTextFrameFormat>
unsafe fn static_upcast(ptr: Ptr<QTextTableFormat>) -> Ptr<QTextFrameFormat>
Calls C++ function: QTextFrameFormat* static_cast<QTextFrameFormat*>(QTextTableFormat* ptr)
.