Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QTextTableFormat class provides formatting information for tables in a QTextDocument. More...
#include <QTextTableFormat>
Inherits QTextFrameFormat.
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 backgroundColor() function, and can be specified with setBackgroundColor(). 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. The setColumns() function can be used to change the number of constraints in use. If no constraints are required, clearColumnWidthConstraints() can be used to remove them.
See also QTextTable, QTextTableCell, and QTextLength.
Constructs a new table format object.
Returns the table's alignment.
See also setAlignment().
Returns the table's cell padding. This describes the distance between the border of a cell and its contents.
See also setCellPadding().
Returns the table's cell spacing. This describes the distance between adjacent cells.
See also setCellSpacing().
Clears the column width constraints for the table.
See also columnWidthConstraints() and setColumnWidthConstraints().
Returns a list of constraints used by this table format to control the appearance of columns in a table.
See also setColumnWidthConstraints().
Returns the number of columns specified by the table format.
See also setColumns().
Returns true if this table format is valid; otherwise returns false.
Sets the table's alignment.
See also alignment().
Sets the cell padding for the table. This determines the distance between the border of a cell and its contents.
See also cellPadding().
Sets the cell spacing for the table. This determines the distance between adjacent cells.
See also cellSpacing().
Sets the column width constraints for the table.
See also columnWidthConstraints() and clearColumnWidthConstraints().
Sets the number of columns required by the table format.
See also columns().
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |