1QComboTableItem(3qt) QComboTableItem(3qt)
2
3
4
6 QComboTableItem - Means of using comboboxes in QTables
7
9 #include <qtable.h>
10
11 Inherits QTableItem.
12
13 Public Members
14 QComboTableItem ( QTable * table, const QStringList & list, bool
15 editable = FALSE )
16 ~QComboTableItem ()
17 virtual void setCurrentItem ( int i )
18 virtual void setCurrentItem ( const QString & s )
19 int currentItem () const
20 QString currentText () const
21 int count () const
22 QString text ( int i ) const
23 virtual void setEditable ( bool b )
24 bool isEditable () const
25 virtual void setStringList ( const QStringList & l )
26 virtual int rtti () const
27
29 The QComboTableItem class provides a means of using comboboxes in
30 QTables.
31
32 A QComboTableItem is a table item which looks and behaves like a
33 combobox. The advantage of using QComboTableItems rather than real
34 comboboxes is that a QComboTableItem uses far less resources than real
35 comboboxes in QTables. When the cell has the focus it displays a real
36 combobox which the user can interact with. When the cell does not have
37 the focus the cell looks like a combobox. Only text items (i.e. no
38 pixmaps) may be used in QComboTableItems.
39
40 QComboTableItem items have the edit type WhenCurrent (see EditType).
41 The QComboTableItem's list of items is provided by a QStringList passed
42 to the constructor.
43
44 The list of items may be changed using setStringList(). The current
45 item can be set with setCurrentItem() and retrieved with currentItem().
46 The text of the current item can be obtained with currentText(), and
47 the text of a particular item can be retrieved with text().
48
49 If isEditable() is TRUE the QComboTableItem will permit the user to
50 either choose an existing list item, or create a new list item by
51 entering their own text; otherwise the user may only choose one of the
52 existing list items.
53
54 To populate a table cell with a QComboTableItem use QTable::setItem().
55
56 QComboTableItems may be deleted with QTable::clearCell().
57
58 QComboTableItems can be distinguished from QTableItems and
59 QCheckTableItems using their Run Time Type Identification number (see
60 rtti()).
61
62 <center>
63 [Image Omitted]
64
65 </center>
66
67 See also QCheckTableItem, QTableItem, QComboBox, and Advanced Widgets.
68
71 bool editable = FALSE )
72 Creates a combo table item for the table table. The combobox's list of
73 items is passed in the list argument. If editable is TRUE the user may
74 type in new list items; if editable is FALSE the user may only select
75 from the list of items provided.
76
77 By default QComboTableItems cannot be replaced by other table items
78 since isReplaceable() returns FALSE by default.
79
80 See also QTable::clearCell() and EditType.
81
83 QComboTableItem destructor.
84
86 Returns the total number of list items in the combo table item.
87
89 Returns the index of the combo table item's current list item.
90
91 See also setCurrentItem().
92
94 Returns the text of the combo table item's current list item.
95
96 See also currentItem() and text().
97
99 Returns TRUE if the user can add their own list items to the combobox's
100 list of items; otherwise returns FALSE.
101
102 See also setEditable().
103
105 Returns 1.
106
107 Make your derived classes return their own values for rtti()to
108 distinguish between different table item subclasses. You should use
109 values greater than 1000, preferably a large random number, to allow
110 for extensions to this class.
111
112 See also QTableItem::rtti().
113
114 Reimplemented from QTableItem.
115
117 Sets the list item i to be the combo table item's current list item.
118
119 See also currentItem().
120
121 Example: table/small-table-demo/main.cpp.
122
124 This is an overloaded member function, provided for convenience. It
125 behaves essentially like the above function.
126
127 Sets the list item whose text is s to be the combo table item's current
128 list item. Does nothing if no list item has the text s.
129
130 See also currentItem().
131
133 If b is TRUE the combo table item can be edited, i.e. the user may
134 enter a new text item themselves. If b is FALSE the user may may only
135 choose one of the existing items.
136
137 See also isEditable().
138
140 Sets the list items of this QComboTableItem to the strings in the
141 string list l.
142
144 Returns the text of the combo's list item at index i.
145
146 See also currentText().
147
148
150 http://doc.trolltech.com/qcombotableitem.html
151 http://www.trolltech.com/faq/tech.html
152
154 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
155 license file included in the distribution for a complete license
156 statement.
157
159 Generated automatically from the source code.
160
162 If you find a bug in Qt, please report it as described in
163 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
164 help you. Thank you.
165
166 The definitive Qt documentation is provided in HTML format; it is
167 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
168 web browser. This man page is provided as a convenience for those users
169 who prefer man pages, although this format is not officially supported
170 by Trolltech.
171
172 If you find errors in this manual page, please report them to qt-
173 bugs@trolltech.com. Please include the name of the manual page
174 (qcombotableitem.3qt) and the Qt version (3.3.8).
175
176
177
178Trolltech AS 2 February 2007 QComboTableItem(3qt)