~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3combotableitem.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/itemviews/q3table.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3ComboTableItem Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<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="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3ComboTableItem Class Reference</h1>
 
21
<p>The Q3ComboTableItem class provides a means of using comboboxes in Q3Tables. <a href="#details">More...</a></p>
 
22
<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 the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="q3tableitem.html">Q3TableItem</a>.</p>
 
25
<ul>
 
26
<li><a href="q3combotableitem-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3combotableitem.html#Q3ComboTableItem">Q3ComboTableItem</a></b> ( Q3Table * <i>table</i>, const QStringList &amp; <i>list</i>, bool <i>editable</i> = false )</li>
 
32
<li><div class="fn"/><b><a href="q3combotableitem.html#dtor.Q3ComboTableItem">~Q3ComboTableItem</a></b> ()</li>
 
33
<li><div class="fn"/>int <b><a href="q3combotableitem.html#count">count</a></b> () const</li>
 
34
<li><div class="fn"/>int <b><a href="q3combotableitem.html#currentItem">currentItem</a></b> () const</li>
 
35
<li><div class="fn"/>QString <b><a href="q3combotableitem.html#currentText">currentText</a></b> () const</li>
 
36
<li><div class="fn"/>bool <b><a href="q3combotableitem.html#isEditable">isEditable</a></b> () const</li>
 
37
<li><div class="fn"/>virtual int <b><a href="q3combotableitem.html#rtti">rtti</a></b> () const</li>
 
38
<li><div class="fn"/>virtual void <b><a href="q3combotableitem.html#setCurrentItem">setCurrentItem</a></b> ( int <i>i</i> )</li>
 
39
<li><div class="fn"/>virtual void <b><a href="q3combotableitem.html#setCurrentItem-2">setCurrentItem</a></b> ( const QString &amp; <i>s</i> )</li>
 
40
<li><div class="fn"/>virtual void <b><a href="q3combotableitem.html#setEditable">setEditable</a></b> ( bool <i>b</i> )</li>
 
41
<li><div class="fn"/>virtual void <b><a href="q3combotableitem.html#setStringList">setStringList</a></b> ( const QStringList &amp; <i>l</i> )</li>
 
42
<li><div class="fn"/>QString <b><a href="q3combotableitem.html#text">text</a></b> ( int <i>i</i> ) const</li>
 
43
</ul>
 
44
<ul>
 
45
<li><div class="fn"/>26 public functions inherited from <a href="q3tableitem.html#public-functions">Q3TableItem</a></li>
 
46
</ul>
 
47
<a name="details"></a>
 
48
<hr />
 
49
<h2>Detailed Description</h2>
 
50
<p>The Q3ComboTableItem class provides a means of using comboboxes in Q3Tables.</p>
 
51
<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. no pixmaps) may be used in Q3ComboTableItems.</p>
 
52
<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>
 
53
<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>
 
54
<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>
 
55
<p>To populate a table cell with a Q3ComboTableItem use <a href="q3table.html#setItem">Q3Table::setItem</a>().</p>
 
56
<p>Q3ComboTableItems may be deleted with <a href="q3table.html#clearCell">Q3Table::clearCell</a>().</p>
 
57
<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>
 
58
<center><img src="images/qtableitems.png" alt="Table Items" /></center><p>See also <a href="q3checktableitem.html">Q3CheckTableItem</a>, <a href="q3tableitem.html">Q3TableItem</a>, and <a href="qcombobox.html">QComboBox</a>.</p>
 
59
<hr />
 
60
<h2>Member Function Documentation</h2>
 
61
<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>
 
62
<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>
 
63
<p>By default Q3ComboTableItems cannot be replaced by other table items since <a href="q3tableitem.html#isReplaceable">isReplaceable</a>() returns false by default.</p>
 
64
<p>See also <a href="q3table.html#clearCell">Q3Table::clearCell</a>() and <a href="q3tableitem.html#EditType-enum">EditType</a>.</p>
 
65
<h3 class="fn"><a name="dtor.Q3ComboTableItem"></a>Q3ComboTableItem::~Q3ComboTableItem ()</h3>
 
66
<p><a href="q3combotableitem.html">Q3ComboTableItem</a> destructor.</p>
 
67
<h3 class="fn"><a name="count"></a>int Q3ComboTableItem::count () const</h3>
 
68
<p>Returns the total number of list items in the combo table item.</p>
 
69
<h3 class="fn"><a name="currentItem"></a>int Q3ComboTableItem::currentItem () const</h3>
 
70
<p>Returns the index of the combo table item's current list item.</p>
 
71
<p>See also <a href="q3combotableitem.html#setCurrentItem">setCurrentItem</a>().</p>
 
72
<h3 class="fn"><a name="currentText"></a><a href="qstring.html">QString</a> Q3ComboTableItem::currentText () const</h3>
 
73
<p>Returns the text of the combo table item's current list item.</p>
 
74
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>() and <a href="q3combotableitem.html#text">text</a>().</p>
 
75
<h3 class="fn"><a name="isEditable"></a>bool Q3ComboTableItem::isEditable () const</h3>
 
76
<p>Returns true if the user can add their own list items to the combobox's list of items; otherwise returns false.</p>
 
77
<p>See also <a href="q3combotableitem.html#setEditable">setEditable</a>().</p>
 
78
<h3 class="fn"><a name="rtti"></a>int Q3ComboTableItem::rtti () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
79
<p>Returns 1.</p>
 
80
<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>
 
81
<p>Reimplemented from <a href="q3tableitem.html#rtti">Q3TableItem</a>.</p>
 
82
<p>See also <a href="q3tableitem.html#rtti">Q3TableItem::rtti</a>().</p>
 
83
<h3 class="fn"><a name="setCurrentItem"></a>void Q3ComboTableItem::setCurrentItem ( int <i>i</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
84
<p>Sets the list item <i>i</i> to be the combo table item's current list item.</p>
 
85
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>().</p>
 
86
<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>
 
87
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
88
<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>
 
89
<p>See also <a href="q3combotableitem.html#currentItem">currentItem</a>().</p>
 
90
<h3 class="fn"><a name="setEditable"></a>void Q3ComboTableItem::setEditable ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
91
<p>If <i>b</i> is true the combo table item can be edited, i.e. 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>
 
92
<p>See also <a href="q3combotableitem.html#isEditable">isEditable</a>().</p>
 
93
<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>
 
94
<p>Sets the list items of this <a href="q3combotableitem.html">Q3ComboTableItem</a> to the strings in the string list <i>l</i>.</p>
 
95
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> Q3ComboTableItem::text ( int <i>i</i> ) const</h3>
 
96
<p>Returns the text of the combo's list item at index <i>i</i>.</p>
 
97
<p>See also <a href="q3combotableitem.html#currentText">currentText</a>().</p>
 
98
<p /><address><hr /><div align="center">
 
99
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
100
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
101
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
102
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
103
</tr></table></div></address></body>
 
104
</html>