QtBase
v6.3.1
|
The QTextTableCell class represents the properties of a cell in a QTextTable. \inmodule QtGui. More...
#include <qtexttable.h>
Public Member Functions | |
QTextTableCell () | |
~QTextTableCell () | |
QTextTableCell (const QTextTableCell &o) | |
QTextTableCell & | operator= (const QTextTableCell &o) |
void | setFormat (const QTextCharFormat &format) |
QTextCharFormat | format () const |
int | row () const |
int | column () const |
int | rowSpan () const |
int | columnSpan () const |
bool | isValid () const |
QTextCursor | firstCursorPosition () const |
QTextCursor | lastCursorPosition () const |
int | firstPosition () const |
int | lastPosition () const |
bool | operator== (const QTextTableCell &other) const |
bool | operator!= (const QTextTableCell &other) const |
QTextFrame::iterator | begin () const |
QTextFrame::iterator | end () const |
int | tableCellFormatIndex () const |
Friends | |
class | QTextTable |
The QTextTableCell class represents the properties of a cell in a QTextTable. \inmodule QtGui.
\reentrant
Table cells are pieces of document structure that belong to a table. The table orders cells into particular rows and columns; cells can also span multiple columns and rows.
Cells are usually created when a table is inserted into a document with QTextCursor::insertTable(), but they are also created and destroyed when a table is resized.
Cells contain information about their location in a table; you can obtain the row() and column() numbers of a cell, and its rowSpan() and columnSpan().
The format() of a cell describes the default character format of its contents. The firstCursorPosition() and lastCursorPosition() functions are used to obtain the extent of the cell in the document.
Definition at line 54 of file qtexttable.h.
|
inline |
|
inline |
Destroys the table cell.
Definition at line 58 of file qtexttable.h.
|
inline |
Copy constructor. Creates a new QTextTableCell object based on the other cell.
Definition at line 59 of file qtexttable.h.
QTextFrame::iterator QTextTableCell::begin | ( | ) | const |
Returns a frame iterator pointing to the beginning of the table's cell.
Definition at line 279 of file qtexttable.cpp.
int QTextTableCell::column | ( | ) | const |
Returns the number of the column in the table that contains this cell.
Definition at line 183 of file qtexttable.cpp.
int QTextTableCell::columnSpan | ( | ) | const |
Returns the number of columns this cell spans. The default is 1.
Definition at line 210 of file qtexttable.cpp.
QTextFrame::iterator QTextTableCell::end | ( | ) | const |
Returns a frame iterator pointing to the end of the table's cell.
Definition at line 292 of file qtexttable.cpp.
QTextCursor QTextTableCell::firstCursorPosition | ( | ) | const |
Returns the first valid cursor position in this cell.
Definition at line 228 of file qtexttable.cpp.
int QTextTableCell::firstPosition | ( | ) | const |
Definition at line 249 of file qtexttable.cpp.
QTextCharFormat QTextTableCell::format | ( | ) | const |
Returns the cell's character format.
Definition at line 138 of file qtexttable.cpp.
|
inline |
Returns true
if this is a valid table cell; otherwise returns false.
Definition at line 72 of file qtexttable.h.
QTextCursor QTextTableCell::lastCursorPosition | ( | ) | const |
Returns the last valid cursor position in this cell.
Definition at line 238 of file qtexttable.cpp.
int QTextTableCell::lastPosition | ( | ) | const |
Definition at line 260 of file qtexttable.cpp.
|
inline |
Returns true
if this cell object and the other cell object describe different cells; otherwise returns false
.
Definition at line 81 of file qtexttable.h.
|
inline |
Assigns the other table cell to this table cell.
Definition at line 60 of file qtexttable.h.
|
inline |
Returns true
if this cell object and the other cell object describe the same cell; otherwise returns false
.
Definition at line 79 of file qtexttable.h.
int QTextTableCell::row | ( | ) | const |
Returns the number of the row in the table that contains this cell.
Definition at line 166 of file qtexttable.cpp.
int QTextTableCell::rowSpan | ( | ) | const |
Returns the number of rows this cell spans. The default is 1.
Definition at line 200 of file qtexttable.cpp.
void QTextTableCell::setFormat | ( | const QTextCharFormat & | format | ) |
Sets the cell's character format to format. This can for example be used to change the background color of the entire cell:
QTextTableCell cell = table->cellAt(2, 3); QTextCharFormat format = cell.format(); format.setBackground(Qt::blue); cell.setFormat(format);
Note that the cell's row or column span cannot be changed through this function. You have to use QTextTable::mergeCells and QTextTable::splitCell instead.
Definition at line 119 of file qtexttable.cpp.
int QTextTableCell::tableCellFormatIndex | ( | ) | const |
Returns the index of the tableCell's format in the document's internal list of formats.
Definition at line 155 of file qtexttable.cpp.
|
friend |
Definition at line 90 of file qtexttable.h.