Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QListBoxItem class is the base class of all list box items. More...
#include <qlistbox.h>
Inherited by QListBoxText and QListBoxPixmap.
The QListBoxItem class is the base class of all list box items.
This class is an abstract base class used for all list box items. If you need to insert customized items into a QListBox you must inherit this class and reimplement paint(), height() and width().
See also QListBox and Advanced Widgets.
Implement this function to return the height of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.
Reimplemented in QListBoxText and QListBoxPixmap.
See also QListBox::currentItem, QListBox::item() and isSelected().
See also setSelectable().
See also QListBox::isSelected() and isCurrent().
Example: listboxcombo/listboxcombo.cpp.
See also prev().
Implement this function to draw your item. You will need to pass the QPainter that will draw the item in p.
See also height() and width().
Example: listboxcombo/listboxcombo.cpp.
Reimplemented in QListBoxText and QListBoxPixmap.
The default implementation returns a null pointer.
Example: listboxcombo/listboxcombo.cpp.
Reimplemented in QListBoxPixmap.
See also next().
Although often frowned upon by purists, Run Time Type Identification is very useful in this case, as it allows a QListBox to be an efficient indexed storage mechanism.
Make your derived classes return their own values for rtti(), and you can distinguish between listbox items. You should use values greater than 1000 preferably a large random number, to allow for extensions to this class.
If b is FALSE (the default), the list box will draw some default highlight indicator before calling paint().
See also selected() and paint().
See also isSelectable().
Sets the text of the QListBoxItem to text. This text is also used for sorting. The text is not shown unless explicitly drawn in paint().
See also text().
See also setText().
Example: listboxcombo/listboxcombo.cpp.
Implement this function to return the width of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.
See also paint() and height().
Reimplemented in QListBoxText and QListBoxPixmap.
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.4
|