Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3330

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?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">
<!-- q3table.cpp -->
<head>
  <title>Qt 4.6: Q3ComboTableItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//Q3ComboTableItem"></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">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Q3ComboTableItem Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
</h1>
<p>The Q3ComboTableItem class provides a means of using comboboxes in Q3Tables. <a href="#details">More...</a></p>
<pre> #include &lt;Q3ComboTableItem&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p>
<p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<p>Inherits <a href="q3tableitem.html">Q3TableItem</a>.</p>
<ul>
<li><a href="q3combotableitem-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="q3combotableitem.html#Q3ComboTableItem">Q3ComboTableItem</a></b> ( Q3Table * <i>table</i>, const QStringList &amp; <i>list</i>, bool <i>editable</i> = false )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#dtor.Q3ComboTableItem">~Q3ComboTableItem</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#currentItem">currentItem</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#currentText">currentText</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#isEditable">isEditable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#setCurrentItem">setCurrentItem</a></b> ( int <i>i</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#setCurrentItem-2">setCurrentItem</a></b> ( const QString &amp; <i>s</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#setEditable">setEditable</a></b> ( bool <i>b</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#setStringList">setStringList</a></b> ( const QStringList &amp; <i>l</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#text-2">text</a></b> ( int <i>i</i> ) const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QWidget * </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#createEditor">createEditor</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#paint">paint</a></b> ( QPainter * <i>p</i>, const QColorGroup &amp; <i>cg</i>, const QRect &amp; <i>cr</i>, bool <i>selected</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#rtti">rtti</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#setContentFromEditor">setContentFromEditor</a></b> ( QWidget * <i>w</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#sizeHint">sizeHint</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QString </td><td class="memItemRight" valign="bottom"><b><a href="q3combotableitem.html#text">text</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>26 public functions inherited from <a href="q3tableitem.html#public-functions">Q3TableItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3ComboTableItem class provides a means of using comboboxes in Q3Tables.</p>
<p>A Q3ComboTableItem is a table item which looks and behaves like a combobox. The advantage of using Q3ComboTableItems rather than real comboboxes is that a Q3ComboTableItem uses far less resources than real comboboxes in <a href="q3table.html">Q3Table</a>s. When the cell has the focus it displays a real combobox which the user can interact with. When the cell does not have the focus the cell <i>looks</i> like a combobox. Only text items (i.e&#x2e; no pixmaps) may be used in Q3ComboTableItems.</p>
<p>Q3ComboTableItem items have the edit type <tt>WhenCurrent</tt> (see <a href="q3tableitem.html#EditType-enum">EditType</a>). The Q3ComboTableItem's list of items is provided by a <a href="qstringlist.html">QStringList</a> passed to the constructor.</p>
<p>The list of items may be changed using <a href="q3combotableitem.html#setStringList">setStringList</a>(). The current item can be set with <a href="q3combotableitem.html#setCurrentItem">setCurrentItem</a>() and retrieved with <a href="q3combotableitem.html#currentItem">currentItem</a>(). The text of the current item can be obtained with <a href="q3combotableitem.html#currentText">currentText</a>(), and the text of a particular item can be retrieved with <a href="q3combotableitem.html#text">text</a>().</p>
<p>If <a href="q3combotableitem.html#isEditable">isEditable</a>() is true the Q3ComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items.</p>
<p>To populate a table cell with a Q3ComboTableItem use <a href="q3table.html#setItem">Q3Table::setItem</a>().</p>
<p>Q3ComboTableItems may be deleted with <a href="q3table.html#clearCell">Q3Table::clearCell</a>().</p>
<p>Q3ComboTableItems can be distinguished from <a href="q3tableitem.html">Q3TableItem</a>s and <a href="q3checktableitem.html">Q3CheckTableItem</a>s using their Run Time Type Identification number (see <a href="q3combotableitem.html#rtti">rtti</a>()).</p>
<p align="center"><img src="images/qtableitems.png" alt="Table Items" /></p><p>See also <a href="q3checktableitem.html">Q3CheckTableItem</a>, <a href="q3tableitem.html">Q3TableItem</a>, and <a href="q3combobox.html">Q3ComboBox</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/Q3ComboTableItem"></a>
<h3 class="fn"><a name="Q3ComboTableItem"></a>Q3ComboTableItem::Q3ComboTableItem ( <a href="q3table.html">Q3Table</a> * <i>table</i>, const <a href="qstringlist.html">QStringList</a> &amp; <i>list</i>, bool <i>editable</i> = false )</h3>
<p>Creates a combo table item for the table <i>table</i>. The combobox's list of items is passed in the <i>list</i> argument. If <i>editable</i> is true the user may type in new list items; if <i>editable</i> is false the user may only select from the list of items provided.</p>
<p>By default Q3ComboTableItems cannot be replaced by other table items since <a href="q3tableitem.html#isReplaceable">isReplaceable</a>() returns false by default.</p>
<p>See also <a href="q3table.html#clearCell">Q3Table::clearCell</a>() and <a href="q3tableitem.html#EditType-enum">EditType</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/~Q3ComboTableItem"></a>
<h3 class="fn"><a name="dtor.Q3ComboTableItem"></a>Q3ComboTableItem::~Q3ComboTableItem ()</h3>
<p><a href="q3combotableitem.html" class="compat">Q3ComboTableItem</a> destructor.</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/count"></a>
<h3 class="fn"><a name="count"></a>int Q3ComboTableItem::count () const</h3>
<p>Returns the total number of list items in the combo table item.</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/createEditor"></a>
<h3 class="fn"><a name="createEditor"></a><a href="qwidget.html">QWidget</a> * Q3ComboTableItem::createEditor () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#createEditor">Q3TableItem::createEditor</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/currentItem"></a>
<h3 class="fn"><a name="currentItem"></a>int Q3ComboTableItem::currentItem () const</h3>
<p>Returns the index of the combo table item's current list item.</p>
<p>See also <a href="q3combotableitem.html#setCurrentItem">setCurrentItem</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/currentText"></a>
<h3 class="fn"><a name="currentText"></a><a href="qstring.html">QString</a> Q3ComboTableItem::currentText () const</h3>
<p>Returns the text of the combo table item's current list item.</p>
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>() and <a href="q3combotableitem.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/isEditable"></a>
<h3 class="fn"><a name="isEditable"></a>bool Q3ComboTableItem::isEditable () const</h3>
<p>Returns true if the user can add their own list items to the combobox's list of items; otherwise returns false.</p>
<p>See also <a href="q3combotableitem.html#setEditable">setEditable</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/paint"></a>
<h3 class="fn"><a name="paint"></a>void Q3ComboTableItem::paint ( <a href="qpainter.html">QPainter</a> * <i>p</i>, const <a href="qcolorgroup.html">QColorGroup</a> &amp; <i>cg</i>, const <a href="qrect.html">QRect</a> &amp; <i>cr</i>, bool <i>selected</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#paint">Q3TableItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/rtti"></a>
<h3 class="fn"><a name="rtti"></a>int Q3ComboTableItem::rtti () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#rtti">Q3TableItem::rtti</a>().</p>
<p>Returns 1.</p>
<p>Make your derived classes return their own values for rtti()to distinguish between different table item subclasses. You should use values greater than 1000, preferably a large random number, to allow for extensions to this class.</p>
<p>See also <a href="q3tableitem.html#rtti">Q3TableItem::rtti</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/setContentFromEditor"></a>
<h3 class="fn"><a name="setContentFromEditor"></a>void Q3ComboTableItem::setContentFromEditor ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#setContentFromEditor">Q3TableItem::setContentFromEditor</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/setCurrentItem"></a>
<h3 class="fn"><a name="setCurrentItem"></a>void Q3ComboTableItem::setCurrentItem ( int <i>i</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the list item <i>i</i> to be the combo table item's current list item.</p>
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>().</p>
<h3 class="fn"><a name="setCurrentItem-2"></a>void Q3ComboTableItem::setCurrentItem ( const <a href="qstring.html">QString</a> &amp; <i>s</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded function.</p>
<p>Sets the list item whose text is <i>s</i> to be the combo table item's current list item. Does nothing if no list item has the text <i>s</i>.</p>
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/setEditable"></a>
<h3 class="fn"><a name="setEditable"></a>void Q3ComboTableItem::setEditable ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>If <i>b</i> is true the combo table item can be edited, i.e&#x2e; the user may enter a new text item themselves. If <i>b</i> is false the user may may only choose one of the existing items.</p>
<p>See also <a href="q3combotableitem.html#isEditable">isEditable</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/setStringList"></a>
<h3 class="fn"><a name="setStringList"></a>void Q3ComboTableItem::setStringList ( const <a href="qstringlist.html">QStringList</a> &amp; <i>l</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the list items of this <a href="q3combotableitem.html" class="compat">Q3ComboTableItem</a> to the strings in the string list <i>l</i>.</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/sizeHint"></a>
<h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> Q3ComboTableItem::sizeHint () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#sizeHint">Q3TableItem::sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ComboTableItem/text"></a>
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> Q3ComboTableItem::text () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3tableitem.html#text">Q3TableItem::text</a>().</p>
<p>Returns the text of the table item or an empty string if there is no text.</p>
<p>See also <a href="q3tableitem.html#text">Q3TableItem::text</a>().</p>
<h3 class="fn"><a name="text-2"></a><a href="qstring.html">QString</a> Q3ComboTableItem::text ( int <i>i</i> ) const</h3>
<p>Returns the text of the combo's list item at index <i>i</i>.</p>
<p>See also <a href="q3combotableitem.html#currentText">currentText</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 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>