<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/table/qtable.cpp:194 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QTableSelection Class</title> <style type="text/css"><!-- fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td 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="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QTableSelection Class Reference<br><small>[<a href="table.html">table module</a>]</small></h1> <p>The QTableSelection class provides access to a selected area in a QTable. <a href="#details">More...</a> <p><tt>#include <<a href="qtable-h.html">qtable.h</a>></tt> <p><a href="qtableselection-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li class=fn><a href="#QTableSelection"><b>QTableSelection</b></a> ()</li> <li class=fn><a href="#QTableSelection-2"><b>QTableSelection</b></a> ( int start_row, int start_col, int end_row, int end_col )</li> <li class=fn>void <a href="#init"><b>init</b></a> ( int row, int col )</li> <li class=fn>void <a href="#expandTo"><b>expandTo</b></a> ( int row, int col )</li> <li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QTableSelection & s ) const</li> <li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QTableSelection & s ) const</li> <li class=fn>int <a href="#topRow"><b>topRow</b></a> () const</li> <li class=fn>int <a href="#bottomRow"><b>bottomRow</b></a> () const</li> <li class=fn>int <a href="#leftCol"><b>leftCol</b></a> () const</li> <li class=fn>int <a href="#rightCol"><b>rightCol</b></a> () const</li> <li class=fn>int <a href="#anchorRow"><b>anchorRow</b></a> () const</li> <li class=fn>int <a href="#anchorCol"><b>anchorCol</b></a> () const</li> <li class=fn>int <a href="#numRows"><b>numRows</b></a> () const</li> <li class=fn>int <a href="#numCols"><b>numCols</b></a> () const</li> <li class=fn>bool <a href="#isActive"><b>isActive</b></a> () const</li> <li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The QTableSelection class provides access to a selected area in a <a href="qtable.html">QTable</a>. <p> <p> The selection is a rectangular set of cells in a QTable. One of the rectangle's cells is called the anchor cell; this is the cell that was selected first. The <a href="#init">init</a>() function sets the anchor and the selection rectangle to exactly this cell; the <a href="#expandTo">expandTo</a>() function expands the selection rectangle to include additional cells. <p> There are various access functions to find out about the area: <a href="#anchorRow">anchorRow</a>() and <a href="#anchorCol">anchorCol</a>() return the anchor's position; <a href="#leftCol">leftCol</a>(), <a href="#rightCol">rightCol</a>(), <a href="#topRow">topRow</a>() and <a href="#bottomRow">bottomRow</a>() return the rectangle's four edges. All four are part of the selection. <p> A newly created QTableSelection is inactive -- <a href="#isActive">isActive</a>() returns FALSE. You must use init() and expandTo() to activate it. <p> <p>See also <a href="qtable.html">QTable</a>, <a href="qtable.html#addSelection">QTable::addSelection</a>(), <a href="qtable.html#selection">QTable::selection</a>(), <a href="qtable.html#selectCells">QTable::selectCells</a>(), <a href="qtable.html#selectRow">QTable::selectRow</a>(), <a href="qtable.html#selectColumn">QTable::selectColumn</a>(), and <a href="advanced.html">Advanced Widgets</a>. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QTableSelection"></a>QTableSelection::QTableSelection () </h3> Creates an inactive selection. Use <a href="#init">init</a>() and <a href="#expandTo">expandTo</a>() to activate it. <h3 class=fn><a name="QTableSelection-2"></a>QTableSelection::QTableSelection ( int start_row, int start_col, int end_row, int end_col ) </h3> Creates an active selection, starting at <em>start_row</em> and <em>start_col</em>, ending at <em>end_row</em> and <em>end_col</em>. <h3 class=fn>int <a name="anchorCol"></a>QTableSelection::anchorCol () const </h3> <p> Returns the anchor column of the selection. <p> <p>See also <a href="#anchorRow">anchorRow</a>() and <a href="#expandTo">expandTo</a>(). <h3 class=fn>int <a name="anchorRow"></a>QTableSelection::anchorRow () const </h3> <p> Returns the anchor row of the selection. <p> <p>See also <a href="#anchorCol">anchorCol</a>() and <a href="#expandTo">expandTo</a>(). <h3 class=fn>int <a name="bottomRow"></a>QTableSelection::bottomRow () const </h3> <p> Returns the bottom row of the selection. <p> <p>See also <a href="#topRow">topRow</a>(), <a href="#leftCol">leftCol</a>(), and <a href="#rightCol">rightCol</a>(). <h3 class=fn>void <a name="expandTo"></a>QTableSelection::expandTo ( int row, int col ) </h3> Expands the selection to include cell <em>row</em>, <em>col</em>. The new selection rectangle is the bounding rectangle of <em>row</em>, <em>col</em> and the previous selection rectangle. After calling this function the selection is active. <p> If you haven't called <a href="#init">init</a>(), this function does nothing. <p> <p>See also <a href="#init">init</a>() and <a href="#isActive">isActive</a>(). <h3 class=fn>void <a name="init"></a>QTableSelection::init ( int row, int col ) </h3> Sets the selection anchor to cell <em>row</em>, <em>col</em> and the selection to only contain this cell. The selection is not active until <a href="#expandTo">expandTo</a>() is called. <p> To extend the selection to include additional cells, call expandTo(). <p> <p>See also <a href="#isActive">isActive</a>(). <h3 class=fn>bool <a name="isActive"></a>QTableSelection::isActive () const </h3> <p> Returns whether the selection is active or not. A selection is active after <a href="#init">init</a>() <em>and</em> <a href="#expandTo">expandTo</a>() have been called. <h3 class=fn>bool <a name="isEmpty"></a>QTableSelection::isEmpty () const </h3> <p> Returns whether the selection is empty or not. <p> <p>See also <a href="#numRows">numRows</a>() and <a href="#numCols">numCols</a>(). <h3 class=fn>int <a name="leftCol"></a>QTableSelection::leftCol () const </h3> <p> Returns the left column of the selection. <p> <p>See also <a href="#topRow">topRow</a>(), <a href="#bottomRow">bottomRow</a>(), and <a href="#rightCol">rightCol</a>(). <h3 class=fn>int <a name="numCols"></a>QTableSelection::numCols () const </h3> Returns the number of columns in the selection. <p> <p>See also <a href="#numRows">numRows</a>(). <h3 class=fn>int <a name="numRows"></a>QTableSelection::numRows () const </h3> <p> Returns the number of rows in the selection. <p> <p>See also <a href="#numCols">numCols</a>(). <h3 class=fn>bool <a name="operator!-eq"></a>QTableSelection::operator!= ( const <a href="qtableselection.html">QTableSelection</a> & s ) const </h3> <p> Returns TRUE if <em>s</em> does not include the same cells as the selection; otherwise returns FALSE. <h3 class=fn>bool <a name="operator-eq-eq"></a>QTableSelection::operator== ( const <a href="qtableselection.html">QTableSelection</a> & s ) const </h3> Returns TRUE if <em>s</em> includes the same cells as the selection; otherwise returns FALSE. <h3 class=fn>int <a name="rightCol"></a>QTableSelection::rightCol () const </h3> <p> Returns the right column of the selection. <p> <p>See also <a href="#topRow">topRow</a>(), <a href="#bottomRow">bottomRow</a>(), and <a href="#leftCol">leftCol</a>(). <h3 class=fn>int <a name="topRow"></a>QTableSelection::topRow () const </h3> <p> Returns the top row of the selection. <p> <p>See also <a href="#bottomRow">bottomRow</a>(), <a href="#leftCol">leftCol</a>(), and <a href="#rightCol">rightCol</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2007 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2007 <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> <td align=right><div align=right>Qt 3.3.8</div> </table></div></address></body> </html>