<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qtexttable.cpp --> <head> <title>Qt 4.6: QTextTableCell Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QTextTableCell"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QTextTableCell Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span> </h1> <p>The QTextTableCell class represents the properties of a cell in a <a href="qtexttable.html">QTextTable</a>. <a href="#details">More...</a></p> <pre> #include <QTextTableCell></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <ul> <li><a href="qtexttablecell-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#QTextTableCell">QTextTableCell</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#QTextTableCell-2">QTextTableCell</a></b> ( const QTextTableCell & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#dtor.QTextTableCell">~QTextTableCell</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextFrame::iterator </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#begin">begin</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#column">column</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#columnSpan">columnSpan</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextFrame::iterator </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#end">end</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextCursor </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#firstCursorPosition">firstCursorPosition</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextCharFormat </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#format">format</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#isValid">isValid</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextCursor </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#lastCursorPosition">lastCursorPosition</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#row">row</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#rowSpan">rowSpan</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#setFormat">setFormat</a></b> ( const QTextCharFormat & <i>format</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#tableCellFormatIndex">tableCellFormatIndex</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#operator-not-eq">operator!=</a></b> ( const QTextTableCell & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QTextTableCell & </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#operator-eq">operator=</a></b> ( const QTextTableCell & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtexttablecell.html#operator-eq-eq">operator==</a></b> ( const QTextTableCell & <i>other</i> ) const</td></tr> </table> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QTextTableCell class represents the properties of a cell in a <a href="qtexttable.html">QTextTable</a>.</p> <p>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.</p> <p>Cells are usually created when a table is inserted into a document with <a href="qtextcursor.html#insertTable">QTextCursor::insertTable</a>(), but they are also created and destroyed when a table is resized.</p> <p>Cells contain information about their location in a table; you can obtain the <a href="qtexttablecell.html#row">row</a>() and <a href="qtexttablecell.html#column">column</a>() numbers of a cell, and its <a href="qtexttablecell.html#rowSpan">rowSpan</a>() and <a href="qtexttablecell.html#columnSpan">columnSpan</a>().</p> <p>The <a href="qtexttablecell.html#format">format</a>() of a cell describes the default character format of its contents. The <a href="qtexttablecell.html#firstCursorPosition">firstCursorPosition</a>() and <a href="qtexttablecell.html#lastCursorPosition">lastCursorPosition</a>() functions are used to obtain the extent of the cell in the document.</p> <p>See also <a href="qtexttable.html">QTextTable</a> and <a href="qtexttableformat.html">QTextTableFormat</a>.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QTextTableCell/QTextTableCell"></a> <h3 class="fn"><a name="QTextTableCell"></a>QTextTableCell::QTextTableCell ()</h3> <p>Constructs an invalid table cell.</p> <p>See also <a href="qtexttablecell.html#isValid">isValid</a>().</p> <h3 class="fn"><a name="QTextTableCell-2"></a>QTextTableCell::QTextTableCell ( const QTextTableCell & <i>other</i> )</h3> <p>Copy constructor. Creates a new <a href="qtexttablecell.html">QTextTableCell</a> object based on the <i>other</i> cell.</p> <a name="//apple_ref/cpp/instm/QTextTableCell/~QTextTableCell"></a> <h3 class="fn"><a name="dtor.QTextTableCell"></a>QTextTableCell::~QTextTableCell ()</h3> <p>Destroys the table cell.</p> <a name="//apple_ref/cpp/instm/QTextTableCell/begin"></a> <h3 class="fn"><a name="begin"></a><a href="qtextframe-iterator.html">QTextFrame::iterator</a> QTextTableCell::begin () const</h3> <p>Returns a frame iterator pointing to the beginning of the table's cell.</p> <p>See also <a href="qtexttablecell.html#end">end</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/column"></a> <h3 class="fn"><a name="column"></a>int QTextTableCell::column () const</h3> <p>Returns the number of the column in the table that contains this cell.</p> <p>See also <a href="qtexttablecell.html#row">row</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/columnSpan"></a> <h3 class="fn"><a name="columnSpan"></a>int QTextTableCell::columnSpan () const</h3> <p>Returns the number of columns this cell spans. The default is 1.</p> <p>See also <a href="qtexttablecell.html#rowSpan">rowSpan</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/end"></a> <h3 class="fn"><a name="end"></a><a href="qtextframe-iterator.html">QTextFrame::iterator</a> QTextTableCell::end () const</h3> <p>Returns a frame iterator pointing to the end of the table's cell.</p> <p>See also <a href="qtexttablecell.html#begin">begin</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/firstCursorPosition"></a> <h3 class="fn"><a name="firstCursorPosition"></a><a href="qtextcursor.html">QTextCursor</a> QTextTableCell::firstCursorPosition () const</h3> <p>Returns the first valid cursor position in this cell.</p> <p>See also <a href="qtexttablecell.html#lastCursorPosition">lastCursorPosition</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/format"></a> <h3 class="fn"><a name="format"></a><a href="qtextcharformat.html">QTextCharFormat</a> QTextTableCell::format () const</h3> <p>Returns the cell's character format.</p> <p>See also <a href="qtexttablecell.html#setFormat">setFormat</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/isValid"></a> <h3 class="fn"><a name="isValid"></a>bool QTextTableCell::isValid () const</h3> <p>Returns true if this is a valid table cell; otherwise returns false.</p> <a name="//apple_ref/cpp/instm/QTextTableCell/lastCursorPosition"></a> <h3 class="fn"><a name="lastCursorPosition"></a><a href="qtextcursor.html">QTextCursor</a> QTextTableCell::lastCursorPosition () const</h3> <p>Returns the last valid cursor position in this cell.</p> <p>See also <a href="qtexttablecell.html#firstCursorPosition">firstCursorPosition</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/row"></a> <h3 class="fn"><a name="row"></a>int QTextTableCell::row () const</h3> <p>Returns the number of the row in the table that contains this cell.</p> <p>See also <a href="qtexttablecell.html#column">column</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/rowSpan"></a> <h3 class="fn"><a name="rowSpan"></a>int QTextTableCell::rowSpan () const</h3> <p>Returns the number of rows this cell spans. The default is 1.</p> <p>See also <a href="qtexttablecell.html#columnSpan">columnSpan</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/setFormat"></a> <h3 class="fn"><a name="setFormat"></a>void QTextTableCell::setFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> & <i>format</i> )</h3> <p>Sets the cell's character format to <i>format</i>. This can for example be used to change the background color of the entire cell:</p> <p><a href="qtexttablecell.html">QTextTableCell</a> cell = table->cellAt(2, 3); <a href="qtextcharformat.html">QTextCharFormat</a> format = cell.<a href="qtexttablecell.html#format">format</a>(); format.setBackground(<a href="qt.html#GlobalColor-enum">Qt::blue</a>); cell.setFormat(format);</p> <p>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.</p> <p>This function was introduced in Qt 4.2.</p> <p>See also <a href="qtexttablecell.html#format">format</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/tableCellFormatIndex"></a> <h3 class="fn"><a name="tableCellFormatIndex"></a>int QTextTableCell::tableCellFormatIndex () const</h3> <p>Returns the index of the tableCell's format in the document's internal list of formats.</p> <p>This function was introduced in Qt 4.5.</p> <p>See also <a href="qtextdocument.html#allFormats">QTextDocument::allFormats</a>().</p> <a name="//apple_ref/cpp/instm/QTextTableCell/operator!="></a> <h3 class="fn"><a name="operator-not-eq"></a>bool QTextTableCell::operator!= ( const QTextTableCell & <i>other</i> ) const</h3> <p>Returns true if this cell object and the <i>other</i> cell object describe different cells; otherwise returns false.</p> <a name="//apple_ref/cpp/instm/QTextTableCell/operator="></a> <h3 class="fn"><a name="operator-eq"></a>QTextTableCell & QTextTableCell::operator= ( const QTextTableCell & <i>other</i> )</h3> <p>Assigns the <i>other</i> table cell to this table cell.</p> <a name="//apple_ref/cpp/instm/QTextTableCell/operator=="></a> <h3 class="fn"><a name="operator-eq-eq"></a>bool QTextTableCell::operator== ( const QTextTableCell & <i>other</i> ) const</h3> <p>Returns true if this cell object and the <i>other</i> cell object describe the same cell; otherwise returns false.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>