1QListBoxItem(3qt)                                            QListBoxItem(3qt)
2
3
4

NAME

6       QListBoxItem - The base class of all list box items
7

SYNOPSIS

9       #include <qlistbox.h>
10
11       Inherited by QListBoxText and QListBoxPixmap.
12
13   Public Members
14       QListBoxItem ( QListBox * listbox = 0 )
15       QListBoxItem ( QListBox * listbox, QListBoxItem * after )
16       virtual ~QListBoxItem ()
17       virtual QString text () const
18       virtual const QPixmap * pixmap () const
19       virtual int height ( const QListBox * lb ) const
20       virtual int width ( const QListBox * lb ) const
21       bool isSelected () const
22       bool isCurrent () const
23       bool selected () const  (obsolete)
24       bool current () const  (obsolete)
25       QListBox * listBox () const
26       void setSelectable ( bool b )
27       bool isSelectable () const
28       QListBoxItem * next () const
29       QListBoxItem * prev () const
30       virtual int rtti () const
31
32   Protected Members
33       virtual void paint ( QPainter * p ) = 0
34       virtual void setText ( const QString & text )
35       void setCustomHighlighting ( bool b )
36

DESCRIPTION

38       The QListBoxItem class is the base class of all list box items.
39
40       This class is an abstract base class used for all list box items. If
41       you need to insert customized items into a QListBox you must inherit
42       this class and reimplement paint(), height() and width().
43
44       See also QListBox.
45

MEMBER FUNCTION DOCUMENTATION

QListBoxItem::QListBoxItem ( QListBox * listbox = 0 )

48       Constructs an empty list box item in the list box listbox.
49

QListBoxItem::QListBoxItem ( QListBox * listbox, QListBoxItem * after )

51       Constructs an empty list box item in the list box listbox and inserts
52       it after the item after or at the beginning if after is 0.
53

QListBoxItem::~QListBoxItem () [virtual]

55       Destroys the list box item.
56

bool QListBoxItem::current () const

58       This function is obsolete. It is provided to keep old source working.
59       We strongly advise against using it in new code.
60

int QListBoxItem::height ( const QListBox * lb ) const [virtual]

62       Implement this function to return the height of your item. The lb
63       parameter is the same as listBox() and is provided for convenience and
64       compatibility.
65
66       The default implementation returns QApplication::globalStrut()'s
67       height.
68
69       See also paint() and width().
70
71       Reimplemented in QListBoxText and QListBoxPixmap.
72

bool QListBoxItem::isCurrent () const

74       Returns TRUE if the item is the current item; otherwise returns FALSE.
75
76       See also QListBox::currentItem, QListBox::item(), and isSelected().
77

bool QListBoxItem::isSelectable () const

79       Returns TRUE if this item is selectable (the default); otherwise
80       returns FALSE.
81
82       See also setSelectable().
83

bool QListBoxItem::isSelected () const

85       Returns TRUE if the item is selected; otherwise returns FALSE.
86
87       See also QListBox::isSelected() and isCurrent().
88
89       Example: listboxcombo/listboxcombo.cpp.
90

QListBox * QListBoxItem::listBox () const

92       Returns a pointer to the list box containing this item.
93

QListBoxItem * QListBoxItem::next () const

95       Returns the item that comes after this in the list box. If this is the
96       last item, 0 is returned.
97
98       See also prev().
99

void QListBoxItem::paint ( QPainter * p ) [pure virtual protected]

101       Implement this function to draw your item. The painter, p, is already
102       open for painting.
103
104       See also height() and width().
105
106       Example: listboxcombo/listboxcombo.cpp.
107
108       Reimplemented in QListBoxText and QListBoxPixmap.
109

const QPixmap * QListBoxItem::pixmap () const [virtual]

111       Returns the pixmap associated with the item, or 0 if there isn't one.
112
113       The default implementation returns 0.
114
115       Example: listboxcombo/listboxcombo.cpp.
116
117       Reimplemented in QListBoxPixmap.
118

QListBoxItem * QListBoxItem::prev () const

120       Returns the item which comes before this in the list box. If this is
121       the first item, 0 is returned.
122
123       See also next().
124

int QListBoxItem::rtti () const [virtual]

126       Returns 0.
127
128       Make your derived classes return their own values for rtti(), and you
129       can distinguish between listbox items. You should use values greater
130       than 1000 preferably a large random number, to allow for extensions to
131       this class.
132

bool QListBoxItem::selected () const

134       This function is obsolete. It is provided to keep old source working.
135       We strongly advise against using it in new code.
136

void QListBoxItem::setCustomHighlighting ( bool b ) [protected]

138       Defines whether the list box item is responsible for drawing itself in
139       a highlighted state when being selected.
140
141       If b is FALSE (the default), the list box will draw some default
142       highlight indicator before calling paint().
143
144       See also selected() and paint().
145

void QListBoxItem::setSelectable ( bool b )

147       If b is TRUE (the default) then this item can be selected by the user;
148       otherwise this item cannot be selected by the user.
149
150       See also isSelectable().
151

void QListBoxItem::setText ( const QString & text ) [virtual protected]

153       Sets the text of the QListBoxItem to text. This text is also used for
154       sorting. The text is not shown unless explicitly drawn in paint().
155
156       See also text().
157

QString QListBoxItem::text () const [virtual]

159       Returns the text of the item. This text is also used for sorting.
160
161       See also setText().
162
163       Example: listboxcombo/listboxcombo.cpp.
164

int QListBoxItem::width ( const QListBox * lb ) const [virtual]

166       Reimplement this function to return the width of your item. The lb
167       parameter is the same as listBox() and is provided for convenience and
168       compatibility.
169
170       The default implementation returns QApplication::globalStrut()'s width.
171
172       See also paint() and height().
173
174       Reimplemented in QListBoxText and QListBoxPixmap.
175
176

SEE ALSO

178       http://doc.trolltech.com/qlistboxitem.html
179       http://www.trolltech.com/faq/tech.html
180
182       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
183       license file included in the distribution for a complete license
184       statement.
185

AUTHOR

187       Generated automatically from the source code.
188

BUGS

190       If you find a bug in Qt, please report it as described in
191       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
192       help you. Thank you.
193
194       The definitive Qt documentation is provided in HTML format; it is
195       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
196       web browser. This man page is provided as a convenience for those users
197       who prefer man pages, although this format is not officially supported
198       by Trolltech.
199
200       If you find errors in this manual page, please report them to qt-
201       bugs@trolltech.com.  Please include the name of the manual page
202       (qlistboxitem.3qt) and the Qt version (3.3.8).
203
204
205
206Trolltech AS                    2 February 2007              QListBoxItem(3qt)
Impressum