QListBox Class Reference


QListBox provides a single-column list of items. (details) (complete member list)

#include <qlistbox.h>

Inherits QTableWidget.

Public Members

Signals

Protected Members


Detailed Description

QListBox provides a single-column list of items.


Member Function Documentation

QListBox::QListBox (QWidget *parent=0, const char *name=0)

Constructs a list box. The arguments are passed to the parent class as usual.

QListBox::~QListBox ()

Deletes the list box and frees the memory used.

int QListBox::cellHeight (long l)

Returns the height of the item at position l in pixels.

int QListBox::cellWidth (long l)

Returns the walue set by setCellWidth().

See also: cellHeight().

void QListBox::centerCurrentItem ()

Scrolls the list box so the highlighted item is in the middle of the visible box.

void QListBox::changeItem (const char *string, int index)

Replaces the item at posistion index with string. If index is negative or too large, changeItem() does nothing.

See also: insertItem(), removeItem().

void QListBox::changeItem (const QPixmap *pixmap, int index)

Replaces the item at posistion index with pixmap. If index is negative or too large, changeItem() does nothing.

See also: insertItem(), removeItem().

void QListBox::changeItem (const QLBItem *lbi, int index)

Replaces the item at posistion index with lbi. If index is negative or too large, changeItem() does nothing.

See also: insertItem(), removeItem().

void QListBox::clear ()

Deletes all items in the list.

See also: removeItems(), setStrList().

void QListBox::clearList ()

Deletes all items in the list box.

int QListBox::count () const

Returns the number of items in the list box.

void QListBox::inSort (const char *string)

Inserts string into the list and sorts the list.

See also: insertItem().

void QListBox::insertItem (const char *string, int index=-1)

Inserts string into the list at index. If index is negative, string is inserted at the end of the list.

See also: insertStrList().

void QListBox::insertItem (const QPixmap *pixmap, int index=-1)

Inserts pixmap into the list at index. If index is negative, pixmap is inserted at the end of the list.

See also: insertStrList().

void QListBox::insertItem (const QLBItem *lbi, int index=-1)

Inserts lbi into the list at index. If index is negative, lbi is inserted at the end of the list.

See also: insertStrList().

void QListBox::insertStrList (const QStrList *l, int index=-1)

Inserts the string list l into the list at item index. If index is negative, l is inserted at the end of the list. If index is too large, insertStrList() doesn't do anything.

See also: insertItem(), inSort().

void QListBox::insertStrList (const char **strs, int numStrings, int index=-1)

Inserts the numStrings strings at strs into the list at item index. If index is negative, l is inserted at the end of the list. If index is too large, insertStrList() doesn't do anything.

See also: insertItem(), inSort().

QLBItem * QListBox::item (int index) const

Returns a pointer to the item at position index.

int QListBox::itemHeight (QLBItem *lbi)

This virtual function returns 0 in QListBox and must be reimplemented by subclasses that use other types.

bool QListBox::itemVisible (int index)

Returns TRUE if the item at position index is at least partly visible.

int QListBox::itemWidth (QLBItem *lbi)

This virtual function returns 0 in QListBox and must be reimplemented by subclasses that use other types.

void QListBox::keyPressEvent (QKeyEvent *e)

This event handler knows about the up and down arrow keys and about enter.

Up and down arrow keys make the highlighted item move and if necessary the list scroll.

Enter makes the list box emit the selected() signal.

See also: selected(), setTopItem().

void QListBox::mouseDoubleClickEvent (QMouseEvent *e)

This event handler emits the selected() signal for the double-clicked item. It ignores clicks that don't fall on an item.

void QListBox::mousePressEvent (QMouseEvent *e)

This event handler moves the highlight to the clicked item, and ignores mouse clicks that do not fall on an item.

int QListBox::numItemsVisible ()

Returns the number of visible items. This may change at any time since the user may resize the widget.

void QListBox::paintCell (QPainter *p, long row, long column)

Repaints the cell at position row using p. The column argument is ignored, it is present because QTableWidget is more general.

See also: QTableWidget::paintCell().

QPixmap * QListBox::pixmap (int index) const

Returns a pointer to the pixmap at position index, or a null pointer if the position either doesn't exist or doesn't contain a pixmap.

See also: string().

void QListBox::removeItem (int index)

Removes the item at position index.

See also: insertItem().

void QListBox::setCurrentItem (int index)

Sets the highlighted item to the item at position index. The highlighting is moved and list scrolled as necessary.

void QListBox::setStrList (const QStrList *l)

Sets the list box' contents to l. The list box is cleared in various ways; scrolled to the top of the list and so on.

See also: insertStrList(), insertItem().

void QListBox::setStrList (const char **strs,int numStrings)

Sets the list box' contents to the numStrings at l. The list box is cleared in various ways; scrolled to the top of the list and so on.

See also: insertStrList(), insertItem().

void QListBox::setUserItems (bool b)

Not implemented yet.

const char * QListBox::string (int index) const

Returns a pointer to the string at position index, or a null pointer if the position either doesn't exist or doesn't contain a string.

See also: pixmap().


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech