Qt 4.8
|
The QTextTableCell class represents the properties of a cell in a QTextTable. More...
#include <qtexttable.h>
Public Functions | |
QTextFrame::iterator | begin () const |
Returns a frame iterator pointing to the beginning of the table's cell. More... | |
int | column () const |
Returns the number of the column in the table that contains this cell. More... | |
int | columnSpan () const |
Returns the number of columns this cell spans. More... | |
QTextFrame::iterator | end () const |
Returns a frame iterator pointing to the end of the table's cell. More... | |
QTextCursor | firstCursorPosition () const |
Returns the first valid cursor position in this cell. More... | |
int | firstPosition () const |
Returns the first valid position in the document occupied by this cell. More... | |
QTextCharFormat | format () const |
Returns the cell's character format. More... | |
bool | isValid () const |
Returns true if this is a valid table cell; otherwise returns false. More... | |
QTextCursor | lastCursorPosition () const |
Returns the last valid cursor position in this cell. More... | |
int | lastPosition () const |
Returns the last valid position in the document occupied by this cell. More... | |
bool | operator!= (const QTextTableCell &other) const |
Returns true if this cell object and the other cell object describe different cells; otherwise returns false. More... | |
QTextTableCell & | operator= (const QTextTableCell &o) |
Assigns the other table cell to this table cell. More... | |
bool | operator== (const QTextTableCell &other) const |
Returns true if this cell object and the other cell object describe the same cell; otherwise returns false. More... | |
QTextTableCell () | |
Constructs an invalid table cell. More... | |
QTextTableCell (const QTextTableCell &o) | |
Copy constructor. More... | |
int | row () const |
Returns the number of the row in the table that contains this cell. More... | |
int | rowSpan () const |
Returns the number of rows this cell spans. More... | |
void | setFormat (const QTextCharFormat &format) |
Sets the cell's character format to format. More... | |
int | tableCellFormatIndex () const |
Returns the index of the tableCell's format in the document's internal list of formats. More... | |
~QTextTableCell () | |
Destroys the table cell. More... | |
Private Functions | |
QTextTableCell (const QTextTable *t, int f) | |
Properties | |
int | fragment |
const QTextTable * | table |
Friends | |
class | QTextTable |
The QTextTableCell class represents the properties of a cell in a QTextTable.
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 59 of file qtexttable.h.
|
inline |
|
inline |
|
inline |
Copy constructor.
Creates a new QTextTableCell object based on the other cell.
Definition at line 64 of file qtexttable.h.
|
inlineprivate |
Definition at line 96 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 306 of file qtexttable.cpp.
Referenced by QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), and QTextDocumentLayoutPrivate::layoutTable().
int QTextTableCell::column | ( | ) | const |
Returns the number of the column in the table that contains this cell.
Definition at line 201 of file qtexttable.cpp.
Referenced by QTextCursorPrivate::aboutToRemoveCell(), QTextCursorPrivate::adjustCursor(), QTextTableData::cellPosition(), QTextTableData::cellRect(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextControlPrivate::gotoNextTableCell(), QTextControlPrivate::gotoPreviousTableCell(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutTable(), QTextTable::mergeCells(), QTextCursorPrivate::movePosition(), QTextCursorPrivate::selectedTableCells(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), and QTextTable::splitCell().
int QTextTableCell::columnSpan | ( | ) | const |
Returns the number of columns this cell spans.
The default is 1.
Definition at line 228 of file qtexttable.cpp.
Referenced by QTextTableData::cellRect(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextControlPrivate::gotoNextTableCell(), QTextDocumentLayoutPrivate::layoutTable(), QTextCursorPrivate::movePosition(), QTextHtmlImporter::TableCellIterator::operator++(), QTextCursorPrivate::selectedTableCells(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), and QTextOdfWriter::writeFrame().
QTextFrame::iterator QTextTableCell::end | ( | ) | const |
Returns a frame iterator pointing to the end of the table's cell.
Definition at line 319 of file qtexttable.cpp.
QTextCursor QTextTableCell::firstCursorPosition | ( | ) | const |
Returns the first valid cursor position in this cell.
Definition at line 249 of file qtexttable.cpp.
Referenced by QTextControlPrivate::gotoNextTableCell(), QTextControlPrivate::gotoPreviousTableCell(), and QTextTable::mergeCells().
int QTextTableCell::firstPosition | ( | ) | const |
Returns the first valid position in the document occupied by this cell.
Definition at line 273 of file qtexttable.cpp.
Referenced by QTextCursorPrivate::aboutToRemoveCell(), adjustContextSelectionsForCell(), QTextCursorPrivate::adjustCursor(), begin(), QTextCursorPrivate::clearCells(), QTextCopyHelper::copy(), end(), firstCursorPosition(), QTextDocumentLayoutPrivate::hitTest(), QTextTable::mergeCells(), QTextCursorPrivate::movePosition(), QTextHtmlImporter::processBlockNode(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), and QTextTable::splitCell().
QTextCharFormat QTextTableCell::format | ( | ) | const |
Returns the cell's character format.
Definition at line 153 of file qtexttable.cpp.
Referenced by QTextTableData::cellPosition(), columnSpan(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutTable(), QTextTable::mergeCells(), QTextHtmlImporter::processBlockNode(), rowSpan(), setFormat(), QTextTable::splitCell(), and QTextOdfWriter::writeFrame().
|
inline |
Returns true if this is a valid table cell; otherwise returns false.
Definition at line 77 of file qtexttable.h.
Referenced by QTextCursorPrivate::aboutToRemoveCell(), QTextDocumentLayout::blockBoundingRect(), QTextCursorPrivate::complexSelectionTable(), QTextDocumentLayoutPrivate::frameBoundingRectInternal(), QTextDocumentLayoutPrivate::hitTest(), QTextTable::mergeCells(), QTextCursorPrivate::movePosition(), QTextHtmlImporter::TableCellIterator::operator++(), QTextHtmlImporter::processBlockNode(), QTextTable::rowEnd(), QTextTable::rowStart(), QTextCursorPrivate::selectedTableCells(), and QTextTable::splitCell().
QTextCursor QTextTableCell::lastCursorPosition | ( | ) | const |
Returns the last valid cursor position in this cell.
Definition at line 259 of file qtexttable.cpp.
Referenced by QTextHtmlImporter::closeTag().
int QTextTableCell::lastPosition | ( | ) | const |
Returns the last valid position in the document occupied by this cell.
Definition at line 287 of file qtexttable.cpp.
Referenced by adjustContextSelectionsForCell(), QTextCursorPrivate::adjustCursor(), begin(), QTextCursorPrivate::clearCells(), QTextCopyHelper::copy(), end(), QTextDocumentLayoutPrivate::hitTest(), lastCursorPosition(), QTextCursorPrivate::movePosition(), QTextTable::removeColumns(), QTextTable::removeRows(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), and QTextTable::splitCell().
|
inline |
Returns true if this cell object and the other cell object describe different cells; otherwise returns false.
Definition at line 86 of file qtexttable.h.
|
inline |
|
inline |
Returns true if this cell object and the other cell object describe the same cell; otherwise returns false.
Definition at line 84 of file qtexttable.h.
int QTextTableCell::row | ( | ) | const |
Returns the number of the row in the table that contains this cell.
Definition at line 184 of file qtexttable.cpp.
Referenced by QTextCursorPrivate::aboutToRemoveCell(), QTextCursorPrivate::adjustCursor(), QTextTableData::cellPosition(), QTextTableData::cellRect(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextControlPrivate::gotoNextTableCell(), QTextControlPrivate::gotoPreviousTableCell(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutTable(), QTextTable::mergeCells(), QTextCursorPrivate::movePosition(), QTextTable::rowEnd(), QTextTable::rowStart(), QTextCursorPrivate::selectedTableCells(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), QTextTable::splitCell(), and QTextOdfWriter::writeFrame().
int QTextTableCell::rowSpan | ( | ) | const |
Returns the number of rows this cell spans.
The default is 1.
Definition at line 218 of file qtexttable.cpp.
Referenced by QTextTableData::cellRect(), QTextCopyHelper::copy(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitTable(), QTextDocumentLayoutPrivate::layoutTable(), QTextCursorPrivate::movePosition(), QTextCursorPrivate::selectedTableCells(), QTextCursor::selectedText(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setBlockFormat(), QTextCursorPrivate::setCharFormat(), and QTextOdfWriter::writeFrame().
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 134 of file qtexttable.cpp.
Referenced by QTextHtmlImporter::processBlockNode().
int QTextTableCell::tableCellFormatIndex | ( | ) | const |
Returns the index of the tableCell's format in the document's internal list of formats.
Definition at line 173 of file qtexttable.cpp.
Referenced by format(), and QTextOdfWriter::writeFrame().
|
friend |
Definition at line 95 of file qtexttable.h.
|
private |
Definition at line 100 of file qtexttable.h.
Referenced by column(), firstPosition(), QTextTablePrivate::fragmentAdded(), lastPosition(), operator=(), operator==(), row(), setFormat(), tableCellFormatIndex(), and QTextTablePrivate::update().
|
private |
Definition at line 99 of file qtexttable.h.
Referenced by begin(), column(), QTextTablePrivate::createTable(), end(), firstCursorPosition(), firstPosition(), format(), lastCursorPosition(), lastPosition(), operator=(), operator==(), row(), setFormat(), and tableCellFormatIndex().