[][src]Struct qt_gui::QTextTableFormat

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

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

C++ class: QTextTableFormat.

C++ documentation:

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block. Tables in rich text documents are formatted using the properties defined in this class.

Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the alignment() function and set with setAlignment().

Cells within the table are separated by cell spacing. The number of pixels between cells is set with setCellSpacing() and read with cellSpacing(). The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with setCellPadding() and read with cellPadding().

The table's background color can be read with the background() function, and can be specified with setBackground(). The background color of each cell can be set independently, and will control the color of the cell within the padded area.

The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see QTextLength). The columns() function returns the number of columns with constraints, and the columnWidthConstraints() function returns the constraints defined for the table. These quantities can also be set by calling setColumnWidthConstraints() with a vector containing new constraints. If no constraints are required, clearColumnWidthConstraints() can be used to remove them.

Methods

impl QTextTableFormat[src]

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

Returns the table's alignment.

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

C++ documentation:

Returns the table's alignment.

See also setAlignment().

pub unsafe fn border_collapse(&self) -> bool[src]

This is supported on cpp_lib_version="5.14.0" only.

Returns true if borderCollapse is enabled.

Calls C++ function: bool QTextTableFormat::borderCollapse() const.

C++ documentation:

Returns true if borderCollapse is enabled.

This function was introduced in Qt 5.14.

See also setBorderCollapse().

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

Returns the table's cell padding. This describes the distance between the border of a cell and its contents.

Calls C++ function: double QTextTableFormat::cellPadding() const.

C++ documentation:

Returns the table's cell padding. This describes the distance between the border of a cell and its contents.

See also setCellPadding().

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

Returns the table's cell spacing. This describes the distance between adjacent cells.

Calls C++ function: double QTextTableFormat::cellSpacing() const.

C++ documentation:

Returns the table's cell spacing. This describes the distance between adjacent cells.

See also setCellSpacing().

pub unsafe fn clear_column_width_constraints(&self)[src]

Clears the column width constraints for the table.

Calls C++ function: void QTextTableFormat::clearColumnWidthConstraints().

C++ documentation:

Clears the column width constraints for the table.

See also columnWidthConstraints() and setColumnWidthConstraints().

pub unsafe fn column_width_constraints(&self) -> CppBox<QVectorOfQTextLength>[src]

Returns a list of constraints used by this table format to control the appearance of columns in a table.

Calls C++ function: QVector<QTextLength> QTextTableFormat::columnWidthConstraints() const.

C++ documentation:

Returns a list of constraints used by this table format to control the appearance of columns in a table.

See also setColumnWidthConstraints().

pub unsafe fn columns(&self) -> c_int[src]

Returns the number of columns specified by the table format.

Calls C++ function: int QTextTableFormat::columns() const.

C++ documentation:

Returns the number of columns specified by the table format.

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

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

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

C++ documentation:

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block. Tables in rich text documents are formatted using the properties defined in this class.

Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the alignment() function and set with setAlignment().

Cells within the table are separated by cell spacing. The number of pixels between cells is set with setCellSpacing() and read with cellSpacing(). The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with setCellPadding() and read with cellPadding().

The table's background color can be read with the background() function, and can be specified with setBackground(). The background color of each cell can be set independently, and will control the color of the cell within the padded area.

The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see QTextLength). The columns() function returns the number of columns with constraints, and the columnWidthConstraints() function returns the constraints defined for the table. These quantities can also be set by calling setColumnWidthConstraints() with a vector containing new constraints. If no constraints are required, clearColumnWidthConstraints() can be used to remove them.

pub unsafe fn header_row_count(&self) -> c_int[src]

Returns the number of rows in the table that define the header.

Calls C++ function: int QTextTableFormat::headerRowCount() const.

C++ documentation:

Returns the number of rows in the table that define the header.

This function was introduced in Qt 4.2.

See also setHeaderRowCount().

pub unsafe fn is_valid(&self) -> bool[src]

Returns true if this table format is valid; otherwise returns false.

Calls C++ function: bool QTextTableFormat::isValid() const.

C++ documentation:

Returns true if this table format is valid; otherwise returns false.

pub unsafe fn new() -> CppBox<QTextTableFormat>[src]

Constructs a new table format object.

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

C++ documentation:

Constructs a new table format object.

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

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

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

C++ documentation:

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block. Tables in rich text documents are formatted using the properties defined in this class.

Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the alignment() function and set with setAlignment().

Cells within the table are separated by cell spacing. The number of pixels between cells is set with setCellSpacing() and read with cellSpacing(). The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with setCellPadding() and read with cellPadding().

The table's background color can be read with the background() function, and can be specified with setBackground(). The background color of each cell can be set independently, and will control the color of the cell within the padded area.

The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see QTextLength). The columns() function returns the number of columns with constraints, and the columnWidthConstraints() function returns the constraints defined for the table. These quantities can also be set by calling setColumnWidthConstraints() with a vector containing new constraints. If no constraints are required, clearColumnWidthConstraints() can be used to remove them.

pub unsafe fn set_alignment(&self, alignment: QFlags<AlignmentFlag>)[src]

Sets the table's alignment.

Calls C++ function: void QTextTableFormat::setAlignment(QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Sets the table's alignment.

See also alignment().

pub unsafe fn set_border_collapse(&self, border_collapse: bool)[src]

This is supported on cpp_lib_version="5.14.0" only.

Enabling borderCollapse will have the following implications:

Calls C++ function: void QTextTableFormat::setBorderCollapse(bool borderCollapse).

C++ documentation:

Enabling borderCollapse will have the following implications:

  • The borders and grid of the table will be rendered following the CSS table border-collapse: collapse rules
  • Setting the border property to a minimum value of 1 will render a one pixel solid inner table grid using the borderBrush property and an outer border as specified
  • The various border style properties of QTextTableCellFormat can be used to customize the grid and have precedence over the border and grid of the table
  • The cellSpacing property will be ignored
  • For print pagination:
    • Columns continued on a page will not have their top cell border rendered
    • Repeated header rows will always have their bottom cell border rendered

With borderCollapse disabled, cell borders can still be styled using QTextTableCellFormat but styling will be applied only within the cell's frame, which is probably not very useful in practice.

This function was introduced in Qt 5.14.

See also borderCollapse(), setBorder(), setBorderBrush(), setBorderStyle(), and QTextTableCellFormat.

pub unsafe fn set_cell_padding(&self, padding: c_double)[src]

Sets the cell padding for the table. This determines the distance between the border of a cell and its contents.

Calls C++ function: void QTextTableFormat::setCellPadding(double padding).

C++ documentation:

Sets the cell padding for the table. This determines the distance between the border of a cell and its contents.

See also cellPadding().

pub unsafe fn set_cell_spacing(&self, spacing: c_double)[src]

Sets the cell spacing for the table. This determines the distance between adjacent cells.

Calls C++ function: void QTextTableFormat::setCellSpacing(double spacing).

C++ documentation:

Sets the cell spacing for the table. This determines the distance between adjacent cells.

See also cellSpacing().

pub unsafe fn set_column_width_constraints(
    &self,
    constraints: impl CastInto<Ref<QVectorOfQTextLength>>
)
[src]

Sets the column width constraints for the table.

Calls C++ function: void QTextTableFormat::setColumnWidthConstraints(const QVector<QTextLength>& constraints).

C++ documentation:

Sets the column width constraints for the table.

See also columnWidthConstraints() and clearColumnWidthConstraints().

pub unsafe fn set_columns(&self, columns: c_int)[src]

Calls C++ function: void QTextTableFormat::setColumns(int columns).

pub unsafe fn set_header_row_count(&self, count: c_int)[src]

Declares the first count rows of the table as table header. The table header rows get repeated when a table is broken across a page boundary.

Calls C++ function: void QTextTableFormat::setHeaderRowCount(int count).

C++ documentation:

Declares the first count rows of the table as table header. The table header rows get repeated when a table is broken across a page boundary.

This function was introduced in Qt 4.2.

See also headerRowCount().

Methods from Deref<Target = QTextFrameFormat>

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

Returns the width of the border in pixels.

Calls C++ function: double QTextFrameFormat::border() const.

C++ documentation:

Returns the width of the border in pixels.

See also setBorder().

pub unsafe fn border_brush(&self) -> CppBox<QBrush>[src]

Returns the brush used for the frame's border.

Calls C++ function: QBrush QTextFrameFormat::borderBrush() const.

C++ documentation:

Returns the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also setBorderBrush().

pub unsafe fn border_style(&self) -> BorderStyle[src]

Returns the style of the frame's border.

Calls C++ function: QTextFrameFormat::BorderStyle QTextFrameFormat::borderStyle() const.

C++ documentation:

Returns the style of the frame's border.

This function was introduced in Qt 4.3.

See also setBorderStyle().

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

Returns the width of the frame's bottom margin in pixels.

Calls C++ function: double QTextFrameFormat::bottomMargin() const.

C++ documentation:

Returns the width of the frame's bottom margin in pixels.

This function was introduced in Qt 4.3.

See also setBottomMargin().

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

The QTextFrameFormat class provides formatting information for frames in a QTextDocument.

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

C++ documentation:

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.

pub unsafe fn height(&self) -> CppBox<QTextLength>[src]

Returns the height of the frame's border rectangle.

Calls C++ function: QTextLength QTextFrameFormat::height() const.

C++ documentation:

Returns the height of the frame's border rectangle.

See also setHeight().

pub unsafe fn is_valid(&self) -> bool[src]

Returns true if the format description is valid; otherwise returns false.

Calls C++ function: bool QTextFrameFormat::isValid() const.

C++ documentation:

Returns true if the format description is valid; otherwise returns false.

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

Returns the width of the frame's left margin in pixels.

Calls C++ function: double QTextFrameFormat::leftMargin() const.

C++ documentation:

Returns the width of the frame's left margin in pixels.

This function was introduced in Qt 4.3.

See also setLeftMargin().

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

Returns the width of the frame's external margin in pixels.

Calls C++ function: double QTextFrameFormat::margin() const.

C++ documentation:

Returns the width of the frame's external margin in pixels.

See also setMargin().

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

Returns the width of the frame's internal padding in pixels.

Calls C++ function: double QTextFrameFormat::padding() const.

C++ documentation:

Returns the width of the frame's internal padding in pixels.

See also setPadding().

pub unsafe fn page_break_policy(&self) -> QFlags<PageBreakFlag>[src]

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.

C++ documentation:

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

pub unsafe fn position(&self) -> Position[src]

Returns the positioning policy for frames with this frame format.

Calls C++ function: QTextFrameFormat::Position QTextFrameFormat::position() const.

C++ documentation:

Returns the positioning policy for frames with this frame format.

See also setPosition().

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

Returns the width of the frame's right margin in pixels.

Calls C++ function: double QTextFrameFormat::rightMargin() const.

C++ documentation:

Returns the width of the frame's right margin in pixels.

This function was introduced in Qt 4.3.

See also setRightMargin().

pub unsafe fn set_border(&self, border: c_double)[src]

Sets the width (in pixels) of the frame's border.

Calls C++ function: void QTextFrameFormat::setBorder(double border).

C++ documentation:

Sets the width (in pixels) of the frame's border.

See also border().

pub unsafe fn set_border_brush(&self, brush: impl CastInto<Ref<QBrush>>)[src]

Sets the brush used for the frame's border.

Calls C++ function: void QTextFrameFormat::setBorderBrush(const QBrush& brush).

C++ documentation:

Sets the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also borderBrush().

pub unsafe fn set_border_style(&self, style: BorderStyle)[src]

Sets the style of the frame's border.

Calls C++ function: void QTextFrameFormat::setBorderStyle(QTextFrameFormat::BorderStyle style).

C++ documentation:

Sets the style of the frame's border.

This function was introduced in Qt 4.3.

See also borderStyle().

pub unsafe fn set_bottom_margin(&self, margin: c_double)[src]

Sets the frame's bottom margin in pixels.

Calls C++ function: void QTextFrameFormat::setBottomMargin(double margin).

C++ documentation:

Sets the frame's bottom margin in pixels.

This function was introduced in Qt 4.3.

See also bottomMargin().

pub unsafe fn set_height_double(&self, height: c_double)[src]

This is an overloaded function.

Calls C++ function: void QTextFrameFormat::setHeight(double height).

C++ documentation:

This is an overloaded function.

Sets the frame's height.

pub unsafe fn set_height_q_text_length(
    &self,
    height: impl CastInto<Ref<QTextLength>>
)
[src]

Sets the frame's height.

Calls C++ function: void QTextFrameFormat::setHeight(const QTextLength& height).

C++ documentation:

Sets the frame's height.

See also height().

pub unsafe fn set_left_margin(&self, margin: c_double)[src]

Sets the frame's left margin in pixels.

Calls C++ function: void QTextFrameFormat::setLeftMargin(double margin).

C++ documentation:

Sets the frame's left margin in pixels.

This function was introduced in Qt 4.3.

See also leftMargin().

pub unsafe fn set_margin(&self, margin: c_double)[src]

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

C++ documentation:

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

pub unsafe fn set_padding(&self, padding: c_double)[src]

Sets the width of the frame's internal padding in pixels.

Calls C++ function: void QTextFrameFormat::setPadding(double padding).

C++ documentation:

Sets the width of the frame's internal padding in pixels.

See also padding().

pub unsafe fn set_page_break_policy(&self, flags: QFlags<PageBreakFlag>)[src]

Sets the page break policy for the frame/table to policy.

Calls C++ function: void QTextFrameFormat::setPageBreakPolicy(QFlags<QTextFormat::PageBreakFlag> flags).

C++ documentation:

Sets the page break policy for the frame/table to policy.

This function was introduced in Qt 4.2.

See also pageBreakPolicy().

pub unsafe fn set_position(&self, f: Position)[src]

Sets the policy for positioning frames with this frame format.

Calls C++ function: void QTextFrameFormat::setPosition(QTextFrameFormat::Position f).

C++ documentation:

Sets the policy for positioning frames with this frame format.

See also position().

pub unsafe fn set_right_margin(&self, margin: c_double)[src]

Sets the frame's right margin in pixels.

Calls C++ function: void QTextFrameFormat::setRightMargin(double margin).

C++ documentation:

Sets the frame's right margin in pixels.

This function was introduced in Qt 4.3.

See also rightMargin().

pub unsafe fn set_top_margin(&self, margin: c_double)[src]

Sets the frame's top margin in pixels.

Calls C++ function: void QTextFrameFormat::setTopMargin(double margin).

C++ documentation:

Sets the frame's top margin in pixels.

This function was introduced in Qt 4.3.

See also topMargin().

pub unsafe fn set_width_double(&self, width: c_double)[src]

This is an overloaded function.

Calls C++ function: void QTextFrameFormat::setWidth(double width).

C++ documentation:

This is an overloaded function.

Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width.

pub unsafe fn set_width_q_text_length(
    &self,
    length: impl CastInto<Ref<QTextLength>>
)
[src]

Sets the frame's border rectangle's width.

Calls C++ function: void QTextFrameFormat::setWidth(const QTextLength& length).

C++ documentation:

Sets the frame's border rectangle's width.

See also width() and QTextLength.

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

Returns the width of the frame's top margin in pixels.

Calls C++ function: double QTextFrameFormat::topMargin() const.

C++ documentation:

Returns the width of the frame's top margin in pixels.

This function was introduced in Qt 4.3.

See also setTopMargin().

pub unsafe fn width(&self) -> CppBox<QTextLength>[src]

Returns the width of the frame's border rectangle.

Calls C++ function: QTextLength QTextFrameFormat::width() const.

C++ documentation:

Returns the width of the frame's border rectangle.

See also setWidth() and QTextLength.

Trait Implementations

impl CppDeletable for QTextTableFormat[src]

unsafe fn delete(&self)[src]

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

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

C++ documentation:

The QTextTableFormat class provides formatting information for tables in a QTextDocument.

A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block. Tables in rich text documents are formatted using the properties defined in this class.

Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the alignment() function and set with setAlignment().

Cells within the table are separated by cell spacing. The number of pixels between cells is set with setCellSpacing() and read with cellSpacing(). The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with setCellPadding() and read with cellPadding().

The table's background color can be read with the background() function, and can be specified with setBackground(). The background color of each cell can be set independently, and will control the color of the cell within the padded area.

The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see QTextLength). The columns() function returns the number of columns with constraints, and the columnWidthConstraints() function returns the constraints defined for the table. These quantities can also be set by calling setColumnWidthConstraints() with a vector containing new constraints. If no constraints are required, clearColumnWidthConstraints() can be used to remove them.

impl Deref for QTextTableFormat[src]

type Target = QTextFrameFormat

The resulting type after dereferencing.

fn deref(&self) -> &QTextFrameFormat[src]

Calls C++ function: QTextFrameFormat* static_cast<QTextFrameFormat*>(QTextTableFormat* ptr).

impl StaticDowncast<QTextTableFormat> for QTextFrameFormat[src]

unsafe fn static_downcast(ptr: Ptr<QTextFrameFormat>) -> Ptr<QTextTableFormat>[src]

Calls C++ function: QTextTableFormat* static_cast<QTextTableFormat*>(QTextFrameFormat* ptr).

impl StaticDowncast<QTextTableFormat> for QTextFormat[src]

unsafe fn static_downcast(ptr: Ptr<QTextFormat>) -> Ptr<QTextTableFormat>[src]

Calls C++ function: QTextTableFormat* static_cast<QTextTableFormat*>(QTextFormat* ptr).

impl StaticUpcast<QTextFormat> for QTextTableFormat[src]

unsafe fn static_upcast(ptr: Ptr<QTextTableFormat>) -> Ptr<QTextFormat>[src]

Calls C++ function: QTextFormat* static_cast<QTextFormat*>(QTextTableFormat* ptr).

impl StaticUpcast<QTextFrameFormat> for QTextTableFormat[src]

unsafe fn static_upcast(ptr: Ptr<QTextTableFormat>) -> Ptr<QTextFrameFormat>[src]

Calls C++ function: QTextFrameFormat* static_cast<QTextFrameFormat*>(QTextTableFormat* ptr).

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.