QListBoxItem(3qt)

NAME
QListBoxItem - This is the base class of all list box items

#include <qlistbox.h>

Inherited by QListBoxPixmap and QListBoxText.

  Public Members
QListBoxItem ( QListBox * listbox = 0 )
QListBoxItem ( QListBox * listbox, QListBoxItem * after )
virtual ~QListBoxItem ()
virtual QString text () const
virtual const QPixmap* pixmap () const
virtual int height ( const QListBox * ) const
virtual int width ( const QListBox * ) const
bool selected () const
bool current () const
QListBox* listBox () const
void setSelectable ( bool b )
bool isSelectable () const
QListBoxItem* next () const
QListBoxItem* prev () const

  Protected Members
virtual void paint ( QPainter * )
virtual void setText ( const QString & text )
void setCustomHighlighting ( bool )

DESCRIPTION
This is the base class of all list box items.

This class is the abstract base class of 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.

MEMBER FUNCTION DOCUMENTATION

QListBoxItem::QListBoxItem ( QListBox * listbox = 0 )
Constructs an empty list box item in the listbox listbox

QListBoxItem::QListBoxItem ( QListBox * listbox, QListBoxItem * after )
Constructs an empty list box item in the listbox listbox and inserts it after the item after.

QListBoxItem::~QListBoxItem () [virtual]
Destroys the list box item.

bool QListBoxItem::current () const
Returns TRUE if the item is the current item, else FALSE.

See also QListBox::currentItem(), QListBox::item() and selected().

int QListBoxItem::height ( const QListBox * lb ) const [virtual]
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.

See also paint() and width().

Reimplemented in QListBoxText and QListBoxPixmap.

bool QListBoxItem::isSelectable () const
Returns if this item is selectable or not.

See also setSelectable().

QListBox * QListBoxItem::listBox () const
Returns a pointer to the listbox containing this item.

QListBoxItem * QListBoxItem::next () const
Returns the item which comes after this in the listbox. If this is the last item, 0 is returned.

void QListBoxItem::paint ( QPainter * p ) [virtual protected]
Implement this function to draw your item.

See also height() and width().

Reimplemented in QListBoxPixmap and QListBoxText.

const QPixmap * QListBoxItem::pixmap () const [virtual]
Returns the pixmap connected with the item, if any.

The default implementation of this function returns a null pointer.

Reimplemented in QListBoxPixmap.

QListBoxItem * QListBoxItem::prev () const
Returns the item which comes before this in the listbox. If this is the first item, 0 is returned.

bool QListBoxItem::selected () const
Returns TRUE if the item is selected, else FALSE.

See also QListBox::isSelected() and current().

void QListBoxItem::setCustomHighlighting ( bool b ) [protected]
Defines whether the list box items is responsible to draw itself in a highlighted state when being selected.

If b is FALSE (the default), then the listbox will draw some default highlight indicator before calling paint().

See also selected() and paint().

void QListBoxItem::setSelectable ( bool b )
Specifies if this item may be selected by the user or not.

See also isSelectable().

void QListBoxItem::setText ( const QString & text ) [virtual protected]
Sets the text of the widget, which is used for sorting too. The text is not shown unless explicitly drawn in paint().

See also text().

QString QListBoxItem::text () const [virtual]
Returns the text of the item, which is used for sorting too.

See also setText().

int QListBoxItem::width ( const QListBox * lb ) const [virtual]
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.

SEE ALSO
http://doc.trolltech.com/qlistboxitem.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qlistboxitem.3qt) and the Qt version (2.3.3).