1QCheckListItem(3qt) QCheckListItem(3qt)
2
3
4
6 QCheckListItem - Checkable list view items
7
9 #include <qlistview.h>
10
11 Inherits QListViewItem.
12
13 Public Members
14 enum Type { RadioButton, CheckBox, Controller, RadioButtonController =
15 Controller, CheckBoxController }
16 enum ToggleState { Off, NoChange, On }
17 QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt
18 = RadioButtonController )
19 QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const
20 QString & text, Type tt = RadioButtonController )
21 QCheckListItem ( QListViewItem * parent, const QString & text, Type tt
22 = RadioButtonController )
23 QCheckListItem ( QListViewItem * parent, QListViewItem * after, const
24 QString & text, Type tt = RadioButtonController )
25 QCheckListItem ( QListView * parent, const QString & text, Type tt =
26 RadioButtonController )
27 QCheckListItem ( QListView * parent, QListViewItem * after, const
28 QString & text, Type tt = RadioButtonController )
29 QCheckListItem ( QListViewItem * parent, const QString & text, const
30 QPixmap & p )
31 QCheckListItem ( QListView * parent, const QString & text, const
32 QPixmap & p )
33 ~QCheckListItem ()
34 virtual void paintCell ( QPainter * p, const QColorGroup & cg, int
35 column, int width, int align )
36 virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const
37 QRect & r )
38 virtual void setOn ( bool b )
39 bool isOn () const
40 Type type () const
41 QString text () const
42 void setTristate ( bool b )
43 bool isTristate () const
44 ToggleState state () const
45 void setState ( ToggleState s )
46 virtual int rtti () const
47
48 Protected Members
49 virtual void activate ()
50 void turnOffChild ()
51 virtual void stateChange ( bool )
52
54 The QCheckListItem class provides checkable list view items.
55
56 QCheckListItems are used in QListViews to provide QListViewItems that
57 are checkboxes, radio buttons or controllers.
58
59 Checkbox and controller check list items may be inserted at any level
60 in a list view. Radio button check list items must be children of a
61 controller check list item.
62
63 The item can be checked or unchecked with setOn(). Its type can be
64 retrieved with type() and its text retrieved with text().
65
66 <center>
67 [Image Omitted]
68
69 </center>
70
71 See also QListViewItem, QListView, and Advanced Widgets.
72
73 Member Type Documentation
75 This enum specifies a QCheckListItem's toggle state.
76
77 QCheckListItem::Off
78
79 QCheckListItem::NoChange
80
81 QCheckListItem::On
82
84 This enum type specifies a QCheckListItem's type:
85
86 QCheckListItem::RadioButton
87
88 QCheckListItem::CheckBox
89
90 QCheckListItem::Controller - obsolete (use RadioButtonController
91 instead)
92
93 QCheckListItem::RadioButtonController
94
95 QCheckListItem::CheckBoxController
96
99 text, Type tt = RadioButtonController )
100 Constructs a checkable item with parent parent, text text and of type
101 tt. Note that a RadioButton must be the child of a
102 RadioButtonController, otherwise it will not toggle.
103
105 after, const QString & text, Type tt = RadioButtonController )
106 Constructs a checkable item with parent parent, which is after after in
107 the parent's list of children, and with text text and of type tt. Note
108 that a RadioButton must be the child of a RadioButtonController,
109 otherwise it will not toggle.
110
112 Type tt = RadioButtonController )
113 Constructs a checkable item with parent parent, text text and of type
114 tt. Note that this item must not be a RadioButton. Radio buttons must
115 be children of a RadioButtonController.
116
118 after, const QString & text, Type tt = RadioButtonController )
119 Constructs a checkable item with parent parent, which is after after in
120 the parent's list of children, with text text and of type tt. Note that
121 this item must not be a RadioButton. Radio buttons must be children of
122 a RadioButtonController.
123
125 Type tt = RadioButtonController )
126 Constructs a checkable item with parent parent, text text and of type
127 tt. Note that tt must not be RadioButton. Radio buttons must be
128 children of a RadioButtonController.
129
131 const QString & text, Type tt = RadioButtonController )
132 Constructs a checkable item with parent parent, which is after after in
133 the parent's list of children, with text text and of type tt. Note that
134 tt must not be RadioButton. Radio buttons must be children of a
135 RadioButtonController.
136
138 const QPixmap & p )
139 Constructs a RadioButtonController item with parent parent, text text
140 and pixmap p.
141
143 const QPixmap & p )
144 Constructs a RadioButtonController item with parent parent, text text
145 and pixmap p.
146
148 Destroys the item, and all its children to any depth, freeing up all
149 allocated resources.
150
152 Toggle check box or set radio button to on.
153
154 Reimplemented from QListViewItem.
155
157 Returns TRUE if the item is toggled on; otherwise returns FALSE.
158
160 Returns TRUE if the item is tristate; otherwise returns FALSE.
161
162 See also setTristate().
163
165 column, int width, int align ) [virtual]
166 Paints the item using the painter p and the color group cg. The item is
167 in column column, has width width and has alignment align. (See
168 Qt::AlignmentFlags for valid alignments.)
169
170 Reimplemented from QListViewItem.
171
173 QRect & r ) [virtual]
174 Draws the focus rectangle r using the color group cg on the painter p.
175
176 Reimplemented from QListViewItem.
177
179 Returns 1.
180
181 Make your derived classes return their own values for rtti(), and you
182 can distinguish between list view items. You should use values greater
183 than 1000, to allow for extensions to this class.
184
185 Reimplemented from QListViewItem.
186
188 Sets the button on if b is TRUE, otherwise sets it off. Maintains radio
189 button exclusivity.
190
192 Sets the toggle state of the checklistitem to s. s can be Off, NoChange
193 or On.
194
195 Tristate can only be enabled for CheckBox or CheckBoxController,
196 therefore the NoChange only applies to them.
197
198 Setting the state to On or Off on a CheckBoxController will recursivly
199 set the states of its children to the same state.
200
201 Setting the state to NoChange on a CheckBoxController will make it
202 recursivly recall the previous stored state of its children. If there
203 was no previous stored state the children are all set to On.
204
206 Sets tristate to b if the Type is either a CheckBoxController or a
207 CheckBox.
208
209 CheckBoxControllers are tristate by default.
210
211 See also state() and isTristate().
212
214 Returns the state of the item.
215
216 See also QCheckListItem::ToggleState.
217
219 This virtual function is called when the item changes its state.
220 NoChange (if tristate is enabled and the type is either CheckBox or
221 CheckBoxController) reports the same as Off, so use state() to
222 determine if the state is actually Off or NoChange.
223
225 Returns the item's text.
226
228 If this is a RadioButtonController that has RadioButton children, turn
229 off the child that is on.
230
232 Returns the type of this item.
233
234
236 http://doc.trolltech.com/qchecklistitem.html
237 http://www.trolltech.com/faq/tech.html
238
240 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
241 license file included in the distribution for a complete license
242 statement.
243
245 Generated automatically from the source code.
246
248 If you find a bug in Qt, please report it as described in
249 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
250 help you. Thank you.
251
252 The definitive Qt documentation is provided in HTML format; it is
253 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
254 web browser. This man page is provided as a convenience for those users
255 who prefer man pages, although this format is not officially supported
256 by Trolltech.
257
258 If you find errors in this manual page, please report them to qt-
259 bugs@trolltech.com. Please include the name of the manual page
260 (qchecklistitem.3qt) and the Qt version (3.3.8).
261
262
263
264Trolltech AS 2 February 2007 QCheckListItem(3qt)