source: trunk/doc/html/qcombotableitem.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 9.6 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/table/qtable.cpp:1154 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QComboTableItem Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QComboTableItem Class Reference<br><small>[<a href="table.html">table module</a>]</small></h1>
33
34<p>The QComboTableItem class provides a means of using
35comboboxes in QTables.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qtable-h.html">qtable.h</a>&gt;</tt>
38<p>Inherits <a href="qtableitem.html">QTableItem</a>.
39<p><a href="qcombotableitem-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QComboTableItem"><b>QComboTableItem</b></a> ( QTable&nbsp;*&nbsp;table, const&nbsp;QStringList&nbsp;&amp;&nbsp;list, bool&nbsp;editable = FALSE )</li>
43<li class=fn><a href="#~QComboTableItem"><b>~QComboTableItem</b></a> ()</li>
44<li class=fn>virtual void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( int&nbsp;i )</li>
45<li class=fn>virtual void <a href="#setCurrentItem-2"><b>setCurrentItem</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;s )</li>
46<li class=fn>int <a href="#currentItem"><b>currentItem</b></a> () const</li>
47<li class=fn>QString <a href="#currentText"><b>currentText</b></a> () const</li>
48<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
49<li class=fn>QString <a href="#text"><b>text</b></a> ( int&nbsp;i ) const</li>
50<li class=fn>virtual void <a href="#setEditable"><b>setEditable</b></a> ( bool&nbsp;b )</li>
51<li class=fn>bool <a href="#isEditable"><b>isEditable</b></a> () const</li>
52<li class=fn>virtual void <a href="#setStringList"><b>setStringList</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;l )</li>
53<li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
54</ul>
55<hr><a name="details"></a><h2>Detailed Description</h2>
56
57
58The QComboTableItem class provides a means of using
59comboboxes in QTables.
60
61<p>
62
63<p> A QComboTableItem is a table item which looks and behaves like a
64combobox. The advantage of using QComboTableItems rather than real
65comboboxes is that a QComboTableItem uses far less resources than
66real comboboxes in <a href="qtable.html">QTable</a>s. When the cell has the focus it
67displays a real combobox which the user can interact with. When
68the cell does not have the focus the cell <em>looks</em> like a
69combobox. Only text items (i.e. no pixmaps) may be used in
70QComboTableItems.
71<p> QComboTableItem items have the edit type <a href="qtableitem.html#EditType-enum">WhenCurrent</a> (see
72<a href="qtableitem.html#EditType-enum">EditType</a>). The QComboTableItem's list of items is provided by
73a <a href="qstringlist.html">QStringList</a> passed to the constructor.
74<p> The list of items may be changed using <a href="#setStringList">setStringList</a>(). The
75current item can be set with <a href="#setCurrentItem">setCurrentItem</a>() and retrieved with
76<a href="#currentItem">currentItem</a>(). The text of the current item can be obtained with
77<a href="#currentText">currentText</a>(), and the text of a particular item can be retrieved
78with <a href="#text">text</a>().
79<p> If <a href="#isEditable">isEditable</a>() is TRUE the QComboTableItem will permit the user
80to either choose an existing list item, or create a new list item
81by entering their own text; otherwise the user may only choose one
82of the existing list items.
83<p> To populate a table cell with a QComboTableItem use
84<a href="qtable.html#setItem">QTable::setItem</a>().
85<p> QComboTableItems may be deleted with <a href="qtable.html#clearCell">QTable::clearCell</a>().
86<p> QComboTableItems can be distinguished from <a href="qtableitem.html">QTableItem</a>s and
87<a href="qchecktableitem.html">QCheckTableItem</a>s using their Run Time Type Identification
88number (see <a href="#rtti">rtti</a>()).
89<p> <center><img src="qtableitems.png" alt="Table Items"></center>
90<p> <p>See also <a href="qchecktableitem.html">QCheckTableItem</a>, <a href="qtableitem.html">QTableItem</a>, <a href="qcombobox.html">QComboBox</a>, and <a href="advanced.html">Advanced Widgets</a>.
91
92<hr><h2>Member Function Documentation</h2>
93<h3 class=fn><a name="QComboTableItem"></a>QComboTableItem::QComboTableItem ( <a href="qtable.html">QTable</a>&nbsp;*&nbsp;table, const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;list, bool&nbsp;editable = FALSE )
94</h3>
95Creates a combo table item for the table <em>table</em>. The combobox's
96list of items is passed in the <em>list</em> argument. If <em>editable</em> is
97TRUE the user may type in new list items; if <em>editable</em> is FALSE
98the user may only select from the list of items provided.
99<p> By default QComboTableItems cannot be replaced by other table
100items since <a href="qtableitem.html#isReplaceable">isReplaceable</a>() returns FALSE by default.
101<p> <p>See also <a href="qtable.html#clearCell">QTable::clearCell</a>() and <a href="qtableitem.html#EditType-enum">EditType</a>.
102
103<h3 class=fn><a name="~QComboTableItem"></a>QComboTableItem::~QComboTableItem ()
104</h3>
105QComboTableItem destructor.
106
107<h3 class=fn>int <a name="count"></a>QComboTableItem::count () const
108</h3>
109Returns the total number of list items in the combo table item.
110
111<h3 class=fn>int <a name="currentItem"></a>QComboTableItem::currentItem () const
112</h3>
113Returns the index of the combo table item's current list item.
114<p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>().
115
116<h3 class=fn><a href="qstring.html">QString</a> <a name="currentText"></a>QComboTableItem::currentText () const
117</h3>
118Returns the text of the combo table item's current list item.
119<p> <p>See also <a href="#currentItem">currentItem</a>() and <a href="#text">text</a>().
120
121<h3 class=fn>bool <a name="isEditable"></a>QComboTableItem::isEditable () const
122</h3>
123Returns TRUE if the user can add their own list items to the
124combobox's list of items; otherwise returns FALSE.
125<p> <p>See also <a href="#setEditable">setEditable</a>().
126
127<h3 class=fn>int <a name="rtti"></a>QComboTableItem::rtti () const<tt> [virtual]</tt>
128</h3>
129
130<p> Returns 1.
131<p> Make your derived classes return their own values for <a href="#rtti">rtti</a>()to
132distinguish between different table item subclasses. You should
133use values greater than 1000, preferably a large random number, to
134allow for extensions to this class.
135<p> <p>See also <a href="qtableitem.html#rtti">QTableItem::rtti</a>().
136
137<p>Reimplemented from <a href="qtableitem.html#rtti">QTableItem</a>.
138<h3 class=fn>void <a name="setCurrentItem"></a>QComboTableItem::setCurrentItem ( int&nbsp;i )<tt> [virtual]</tt>
139</h3>
140Sets the list item <em>i</em> to be the combo table item's current list
141item.
142<p> <p>See also <a href="#currentItem">currentItem</a>().
143
144<p>Example: <a href="small-table-example-example.html#x2797">table/small-table-demo/main.cpp</a>.
145<h3 class=fn>void <a name="setCurrentItem-2"></a>QComboTableItem::setCurrentItem ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;s )<tt> [virtual]</tt>
146</h3>
147This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
148<p> Sets the list item whose text is <em>s</em> to be the combo table item's
149current list item. Does nothing if no list item has the text <em>s</em>.
150<p> <p>See also <a href="#currentItem">currentItem</a>().
151
152<h3 class=fn>void <a name="setEditable"></a>QComboTableItem::setEditable ( bool&nbsp;b )<tt> [virtual]</tt>
153</h3>
154If <em>b</em> is TRUE the combo table item can be edited, i.e. the user
155may enter a new text item themselves. If <em>b</em> is FALSE the user may
156may only choose one of the existing items.
157<p> <p>See also <a href="#isEditable">isEditable</a>().
158
159<h3 class=fn>void <a name="setStringList"></a>QComboTableItem::setStringList ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;l )<tt> [virtual]</tt>
160</h3>
161Sets the list items of this QComboTableItem to the strings in the
162string list <em>l</em>.
163
164<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QComboTableItem::text ( int&nbsp;i ) const
165</h3>
166Returns the text of the combo's list item at index <em>i</em>.
167<p> <p>See also <a href="#currentText">currentText</a>().
168
169<!-- eof -->
170<hr><p>
171This file is part of the <a href="index.html">Qt toolkit</a>.
172Copyright &copy; 1995-2007
173<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
174<table width=100% cellspacing=0 border=0><tr>
175<td>Copyright &copy; 2007
176<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
177<td align=right><div align=right>Qt 3.3.8</div>
178</table></div></address></body>
179</html>
Note: See TracBrowser for help on using the repository browser.