Eneboo - Documentación para desarrolladores
Tipos públicos | Slots públicos | Señales | Métodos públicos | Slots protegidos | Métodos protegidos | Propiedades | Amigas
Referencia de la Clase QListBox

The QListBox widget provides a list of selectable, read-only items. Más...

#include <qlistbox.h>

Diagrama de herencias de QListBox
QScrollView QScrollView QFrame QFrame QFrame QFrame QWidget QWidget QWidget QWidget QWidget QWidget QWidget QWidget QFileListBox

Lista de todos los miembros.

Tipos públicos

enum  SelectionMode {
  Single, Multi, Extended, NoSelection,
  Single, Multi, Extended, NoSelection
}
enum  LayoutMode {
  FixedNumber, FitToWidth, FitToHeight = FitToWidth, Variable,
  FixedNumber, FitToWidth, FitToHeight = FitToWidth, Variable
}
enum  SelectionMode {
  Single, Multi, Extended, NoSelection,
  Single, Multi, Extended, NoSelection
}
enum  LayoutMode {
  FixedNumber, FitToWidth, FitToHeight = FitToWidth, Variable,
  FixedNumber, FitToWidth, FitToHeight = FitToWidth, Variable
}

Slots públicos

void clear ()
virtual void ensureCurrentVisible ()
virtual void clearSelection ()
virtual void selectAll (bool select)
virtual void invertSelection ()
void clear ()
virtual void ensureCurrentVisible ()
virtual void clearSelection ()
virtual void selectAll (bool select)
virtual void invertSelection ()

Señales

void highlighted (int index)
void selected (int index)
void highlighted (const QString &)
void selected (const QString &)
void highlighted (QListBoxItem *)
void selected (QListBoxItem *)
void selectionChanged ()
void selectionChanged (QListBoxItem *)
void currentChanged (QListBoxItem *)
void clicked (QListBoxItem *)
void clicked (QListBoxItem *, const QPoint &)
void pressed (QListBoxItem *)
void pressed (QListBoxItem *, const QPoint &)
void doubleClicked (QListBoxItem *)
void returnPressed (QListBoxItem *)
void rightButtonClicked (QListBoxItem *, const QPoint &)
void rightButtonPressed (QListBoxItem *, const QPoint &)
void mouseButtonPressed (int, QListBoxItem *, const QPoint &)
void mouseButtonClicked (int, QListBoxItem *, const QPoint &)
void contextMenuRequested (QListBoxItem *, const QPoint &)
void onItem (QListBoxItem *item)
void onViewport ()
void highlighted (int index)
void selected (int index)
void highlighted (const QString &)
void selected (const QString &)
void highlighted (QListBoxItem *)
void selected (QListBoxItem *)
void selectionChanged ()
void selectionChanged (QListBoxItem *)
void currentChanged (QListBoxItem *)
void clicked (QListBoxItem *)
void clicked (QListBoxItem *, const QPoint &)
void pressed (QListBoxItem *)
void pressed (QListBoxItem *, const QPoint &)
void doubleClicked (QListBoxItem *)
void returnPressed (QListBoxItem *)
void rightButtonClicked (QListBoxItem *, const QPoint &)
void rightButtonPressed (QListBoxItem *, const QPoint &)
void mouseButtonPressed (int, QListBoxItem *, const QPoint &)
void mouseButtonClicked (int, QListBoxItem *, const QPoint &)
void contextMenuRequested (QListBoxItem *, const QPoint &)
void onItem (QListBoxItem *item)
void onViewport ()

Métodos públicos

 QListBox (QWidget *parent=0, const char *name=0, WFlags f=0)
 ~QListBox ()
virtual void setFont (const QFont &)
uint count () const
void insertStringList (const QStringList &, int index=-1)
void insertStrList (const QStrList *, int index=-1)
void insertStrList (const QStrList &, int index=-1)
void insertStrList (const char **, int numStrings=-1, int index=-1)
void insertItem (const QListBoxItem *, int index=-1)
void insertItem (const QListBoxItem *, const QListBoxItem *after)
void insertItem (const QString &text, int index=-1)
void insertItem (const QPixmap &pixmap, int index=-1)
void insertItem (const QPixmap &pixmap, const QString &text, int index=-1)
void removeItem (int index)
QString text (int index) const
const QPixmappixmap (int index) const
void changeItem (const QListBoxItem *, int index)
void changeItem (const QString &text, int index)
void changeItem (const QPixmap &pixmap, int index)
void changeItem (const QPixmap &pixmap, const QString &text, int index)
void takeItem (const QListBoxItem *)
int numItemsVisible () const
int currentItem () const
QString currentText () const
virtual void setCurrentItem (int index)
virtual void setCurrentItem (QListBoxItem *)
void centerCurrentItem ()
int topItem () const
virtual void setTopItem (int index)
virtual void setBottomItem (int index)
long maxItemWidth () const
virtual void setSelectionMode (SelectionMode)
SelectionMode selectionMode () const
void setMultiSelection (bool multi)
bool isMultiSelection () const
virtual void setSelected (QListBoxItem *, bool)
void setSelected (int, bool)
bool isSelected (int) const
bool isSelected (const QListBoxItem *) const
QListBoxItemselectedItem () const
QSize sizeHint () const
QSize minimumSizeHint () const
QListBoxItemitem (int index) const
int index (const QListBoxItem *) const
QListBoxItemfindItem (const QString &text, ComparisonFlags compare=BeginsWith) const
void triggerUpdate (bool doLayout)
bool itemVisible (int index)
bool itemVisible (const QListBoxItem *)
virtual void setColumnMode (LayoutMode)
virtual void setColumnMode (int)
virtual void setRowMode (LayoutMode)
virtual void setRowMode (int)
LayoutMode columnMode () const
LayoutMode rowMode () const
int numColumns () const
int numRows () const
bool variableWidth () const
virtual void setVariableWidth (bool)
bool variableHeight () const
virtual void setVariableHeight (bool)
void viewportPaintEvent (QPaintEvent *)
bool dragSelect () const
void setDragSelect (bool)
bool autoScroll () const
void setAutoScroll (bool)
bool autoScrollBar () const
void setAutoScrollBar (bool enable)
bool scrollBar () const
void setScrollBar (bool enable)
bool autoBottomScrollBar () const
void setAutoBottomScrollBar (bool enable)
bool bottomScrollBar () const
void setBottomScrollBar (bool enable)
bool smoothScrolling () const
void setSmoothScrolling (bool)
bool autoUpdate () const
void setAutoUpdate (bool)
void setFixedVisibleLines (int lines)
int inSort (const QListBoxItem *)
int inSort (const QString &text)
int cellHeight (int i) const
int cellHeight () const
int cellWidth () const
int cellWidth (int i) const
int numCols () const
int itemHeight (int index=0) const
QListBoxItemitemAt (const QPoint &) const
QRect itemRect (QListBoxItem *item) const
QListBoxItemfirstItem () const
void sort (bool ascending=TRUE)
 QListBox (QWidget *parent=0, const char *name=0, WFlags f=0)
 ~QListBox ()
virtual void setFont (const QFont &)
uint count () const
void insertStringList (const QStringList &, int index=-1)
void insertStrList (const QStrList *, int index=-1)
void insertStrList (const QStrList &, int index=-1)
void insertStrList (const char **, int numStrings=-1, int index=-1)
void insertItem (const QListBoxItem *, int index=-1)
void insertItem (const QListBoxItem *, const QListBoxItem *after)
void insertItem (const QString &text, int index=-1)
void insertItem (const QPixmap &pixmap, int index=-1)
void insertItem (const QPixmap &pixmap, const QString &text, int index=-1)
void removeItem (int index)
QString text (int index) const
const QPixmappixmap (int index) const
void changeItem (const QListBoxItem *, int index)
void changeItem (const QString &text, int index)
void changeItem (const QPixmap &pixmap, int index)
void changeItem (const QPixmap &pixmap, const QString &text, int index)
void takeItem (const QListBoxItem *)
int numItemsVisible () const
int currentItem () const
QString currentText () const
virtual void setCurrentItem (int index)
virtual void setCurrentItem (QListBoxItem *)
void centerCurrentItem ()
int topItem () const
virtual void setTopItem (int index)
virtual void setBottomItem (int index)
long maxItemWidth () const
virtual void setSelectionMode (SelectionMode)
SelectionMode selectionMode () const
void setMultiSelection (bool multi)
bool isMultiSelection () const
virtual void setSelected (QListBoxItem *, bool)
void setSelected (int, bool)
bool isSelected (int) const
bool isSelected (const QListBoxItem *) const
QListBoxItemselectedItem () const
QSize sizeHint () const
QSize minimumSizeHint () const
QListBoxItemitem (int index) const
int index (const QListBoxItem *) const
QListBoxItemfindItem (const QString &text, ComparisonFlags compare=BeginsWith) const
void triggerUpdate (bool doLayout)
bool itemVisible (int index)
bool itemVisible (const QListBoxItem *)
virtual void setColumnMode (LayoutMode)
virtual void setColumnMode (int)
virtual void setRowMode (LayoutMode)
virtual void setRowMode (int)
LayoutMode columnMode () const
LayoutMode rowMode () const
int numColumns () const
int numRows () const
bool variableWidth () const
virtual void setVariableWidth (bool)
bool variableHeight () const
virtual void setVariableHeight (bool)
void viewportPaintEvent (QPaintEvent *)
bool dragSelect () const
void setDragSelect (bool)
bool autoScroll () const
void setAutoScroll (bool)
bool autoScrollBar () const
void setAutoScrollBar (bool enable)
bool scrollBar () const
void setScrollBar (bool enable)
bool autoBottomScrollBar () const
void setAutoBottomScrollBar (bool enable)
bool bottomScrollBar () const
void setBottomScrollBar (bool enable)
bool smoothScrolling () const
void setSmoothScrolling (bool)
bool autoUpdate () const
void setAutoUpdate (bool)
void setFixedVisibleLines (int lines)
int inSort (const QListBoxItem *)
int inSort (const QString &text)
int cellHeight (int i) const
int cellHeight () const
int cellWidth () const
int cellWidth (int i) const
int numCols () const
int itemHeight (int index=0) const
QListBoxItemitemAt (const QPoint &) const
QRect itemRect (QListBoxItem *item) const
QListBoxItemfirstItem () const
void sort (bool ascending=TRUE)

Slots protegidos

void clearInputString ()
void clearInputString ()

Métodos protegidos

void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void contentsContextMenuEvent (QContextMenuEvent *)
void keyPressEvent (QKeyEvent *e)
void focusInEvent (QFocusEvent *e)
void focusOutEvent (QFocusEvent *e)
void resizeEvent (QResizeEvent *)
void showEvent (QShowEvent *)
bool eventFilter (QObject *o, QEvent *e)
void updateItem (int index)
void updateItem (QListBoxItem *)
void updateCellWidth ()
int totalWidth () const
int totalHeight () const
virtual void paintCell (QPainter *, int row, int col)
void toggleCurrentItem ()
bool isRubberSelecting () const
void doLayout () const
void windowActivationChange (bool)
bool itemYPos (int index, int *yPos) const
int findItem (int yPos) const
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void contentsContextMenuEvent (QContextMenuEvent *)
void keyPressEvent (QKeyEvent *e)
void focusInEvent (QFocusEvent *e)
void focusOutEvent (QFocusEvent *e)
void resizeEvent (QResizeEvent *)
void showEvent (QShowEvent *)
bool eventFilter (QObject *o, QEvent *e)
void updateItem (int index)
void updateItem (QListBoxItem *)
void updateCellWidth ()
int totalWidth () const
int totalHeight () const
virtual void paintCell (QPainter *, int row, int col)
void toggleCurrentItem ()
bool isRubberSelecting () const
void doLayout () const
void windowActivationChange (bool)
bool itemYPos (int index, int *yPos) const
int findItem (int yPos) const

Propiedades

uint count
 the number of items in the list box
int numItemsVisible
 the number of visible items.
int currentItem
 the current highlighted item
QString currentText
 the text of the current item.
int topItem
 the index of an item at the top of the screen.
SelectionMode selectionMode
 the selection mode of the list box
bool multiSelection
 whether or not the list box is in Multi selection mode
LayoutMode columnMode
 the column layout mode for this list box.
LayoutMode rowMode
 the row layout mode for this list box
int numColumns
 the number of columns in the list box
int numRows
 the number of rows in the list box.
bool variableWidth
 whether this list box has variable-width columns
bool variableHeight
 whether this list box has variable-height rows

Amigas

class QListBoxItem
class QListBoxPrivate

Descripción detallada

The QListBox widget provides a list of selectable, read-only items.

This is typically a single-column list in which either no item or one item is selected, but it can also be used in many other ways.

QListBox will add scroll bars as necessary, but it isn't intended for really big lists. If you want more than a few thousand items, it's probably better to use a different widget mainly because the scroll bars won't provide very good navigation, but also because QListBox may become slow with huge lists. (See QListView and QTable for possible alternatives.)

There are a variety of selection modes described in the QListBox::SelectionMode documentation. The default is Single selection mode, but you can change it using setSelectionMode(). (setMultiSelection() is still provided for compatibility with Qt 1.x. We recommend using setSelectionMode() in all code.)

Because QListBox offers multiple selection it must display keyboard focus and selection state separately. Therefore there are functions both to set the selection state of an item, i.e. setSelected(), and to set which item displays keyboard focus, i.e. setCurrentItem().

The list box normally arranges its items in a single column and adds a vertical scroll bar if required. It is possible to have a different fixed number of columns (setColumnMode()), or as many columns as will fit in the list box's assigned screen space (setColumnMode(FitToWidth)), or to have a fixed number of rows (setRowMode()) or as many rows as will fit in the list box's assigned screen space (setRowMode(FitToHeight)). In all these cases QListBox will add scroll bars, as appropriate, in at least one direction.

If multiple rows are used, each row can be as high as necessary (the normal setting), or you can request that all items will have the same height by calling setVariableHeight(FALSE). The same applies to a column's width, see setVariableWidth().

The QListBox's items are QListBoxItem objects. QListBox provides methods to insert new items as strings, as pixmaps, and as QListBoxItem * (insertItem() with various arguments), and to replace an existing item with a new string, pixmap or QListBoxItem (changeItem() with various arguments). You can also remove items singly with removeItem() or clear() the entire list box. Note that if you create a QListBoxItem yourself and insert it, QListBox takes ownership of the item.

You can also create a QListBoxItem, such as QListBoxText or QListBoxPixmap, with the list box as first parameter. The item will then append itself. When you delete an item it is automatically removed from the list box.

The list of items can be arbitrarily large; QListBox will add scroll bars if necessary. QListBox can display a single-column (the common case) or multiple-columns, and offers both single and multiple selection. QListBox does not support multiple-column items (but QListView and QTable do), or tree hierarchies (but QListView does).

The list box items can be accessed both as QListBoxItem objects (recommended) and using integer indexes (the original QListBox implementation used an array of strings internally, and the API still supports this mode of operation). Everything can be done using the new objects, and most things can be done using indexes.

Each item in a QListBox contains a QListBoxItem. One of the items can be the current item. The currentChanged() signal and the highlighted() signal are emitted when a new item becomes current, e.g. because the user clicks on it or QListBox::setCurrentItem() is called. The selected() signal is emitted when the user double-clicks on an item or presses Enter on the current item.

If the user does not select anything, no signals are emitted and currentItem() returns -1.

A list box has WheelFocus as a default focusPolicy(), i.e. it can get keyboard focus by tabbing, clicking and through the use of the mouse wheel.

New items can be inserted using insertItem(), insertStrList() or insertStringList(). inSort() is obsolete because this method is quite inefficient. It's preferable to insert the items normally and call sort() afterwards, or to insert a sorted QStringList().

By default, vertical and horizontal scroll bars are added and removed as necessary. setHScrollBarMode() and setVScrollBarMode() can be used to change this policy.

If you need to insert types other than strings and pixmaps, you must define new classes which inherit QListBoxItem.

Atención:
The list box assumes ownership of all list box items and will delete them when it does not need them any more.
qlistbox-m.png
qlistbox-w.png
Ver también:
QListView QComboBox QButtonGroup GUI Design Handbook: List Box (two sections)

Documentación de las enumeraciones miembro de la clase

This enum type is used to specify how QListBox lays out its rows and columns.

FixedNumber There is a fixed number of rows (or columns).

FitToWidth There are as many columns as will fit on-screen.

FitToHeight There are as many rows as will fit on-screen.

Variable There are as many rows as are required by the column mode. (Or as many columns as required by the row mode.)

Example: When you call setRowMode( FitToHeight ), columnMode() automatically becomes Variable to accommodate the row mode you've set.

Valores de enumeraciones:
FixedNumber 
FitToWidth 
FitToHeight 
Variable 
FixedNumber 
FitToWidth 
FitToHeight 
Variable 
Valores de enumeraciones:
FixedNumber 
FitToWidth 
FitToHeight 
Variable 
FixedNumber 
FitToWidth 
FitToHeight 
Variable 
Valores de enumeraciones:
Single 
Multi 
Extended 
NoSelection 
Single 
Multi 
Extended 
NoSelection 

This enumerated type is used by QListBox to indicate how it reacts to selection by the user.

Single When the user selects an item, any already-selected item becomes unselected and the user cannot unselect the selected item. This means that the user can never clear the selection, even though the selection may be cleared by the application programmer using QListBox::clearSelection().

Multi When the user selects an item the selection status of that item is toggled and the other items are left alone. Also, multiple items can be selected by dragging the mouse while the left mouse button is kept pressed.

Extended When the user selects an item the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. And if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item get selected or unselected, depending on the state of the clicked item. Also, multiple items can be selected by dragging the mouse while the left mouse button is kept pressed.

NoSelection Items cannot be selected.

In other words, Single is a real single-selection list box, Multi is a real multi-selection list box, Extended is a list box in which users can select multiple items but usually want to select either just one or a range of contiguous items, and NoSelection is for a list box where the user can look but not touch.

Valores de enumeraciones:
Single 
Multi 
Extended 
NoSelection 
Single 
Multi 
Extended 
NoSelection 

Documentación del constructor y destructor

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

Constructs a new empty list box called name and with parent parent.

Performance is boosted by modifying the widget flags f so that only part of the QListBoxItem children is redrawn. This may be unsuitable for custom QListBoxItem classes, in which case WStaticContents and WNoAutoErase should be cleared immediately after construction.

Ver también:
QWidget::clearWFlags() Qt::WidgetFlags
QListBox::~QListBox ( )

Destroys the list box. Deletes all list box items.

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

Documentación de las funciones miembro

bool QListBox::autoBottomScrollBar ( ) const [inline]

Returns TRUE if hScrollBarMode() is Auto; otherwise returns FALSE.

bool QListBox::autoBottomScrollBar ( ) const [inline]
bool QListBox::autoScroll ( ) const [inline]
bool QListBox::autoScroll ( ) const [inline]
bool QListBox::autoScrollBar ( ) const [inline]

Returns TRUE if vScrollBarMode() is Auto; otherwise returns FALSE.

bool QListBox::autoScrollBar ( ) const [inline]
bool QListBox::autoUpdate ( ) const [inline]
bool QListBox::autoUpdate ( ) const [inline]
bool QListBox::bottomScrollBar ( ) const [inline]

Returns FALSE if vScrollBarMode() is AlwaysOff; otherwise returns TRUE.

bool QListBox::bottomScrollBar ( ) const [inline]
int QListBox::cellHeight ( int  i) const [inline]

Returns the item height of item i.

Ver también:
itemHeight()
int QListBox::cellHeight ( ) const [inline]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

Returns the item height of the first item, item 0.

Ver también:
itemHeight()
int QListBox::cellHeight ( int  i) const [inline]
int QListBox::cellHeight ( ) const [inline]
int QListBox::cellWidth ( ) const [inline]

Returns the maximum item width.

Ver también:
maxItemWidth()
int QListBox::cellWidth ( int  i) const [inline]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

int QListBox::cellWidth ( ) const [inline]
int QListBox::cellWidth ( int  i) const [inline]
void QListBox::centerCurrentItem ( ) [inline]
void QListBox::centerCurrentItem ( ) [inline]

This function does exactly the same as ensureCurrentVisible()

Ver también:
QListBox::ensureCurrentVisible()
void QListBox::changeItem ( const QString text,
int  index 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces the item at position index with a new list box text item with text text.

The operation is ignored if index is out of range.

Ver también:
insertItem(), removeItem()
void QListBox::changeItem ( const QPixmap pixmap,
int  index 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces the item at position index with a new list box pixmap item with pixmap pixmap.

The operation is ignored if index is out of range.

Ver también:
insertItem(), removeItem()
void QListBox::changeItem ( const QPixmap pixmap,
const QString text,
int  index 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Replaces the item at position index with a new list box pixmap item with pixmap pixmap and text text.

The operation is ignored if index is out of range.

Ver también:
insertItem(), removeItem()
void QListBox::changeItem ( const QListBoxItem ,
int  index 
)
void QListBox::changeItem ( const QString text,
int  index 
)
void QListBox::changeItem ( const QPixmap pixmap,
int  index 
)
void QListBox::changeItem ( const QPixmap pixmap,
const QString text,
int  index 
)
void QListBox::changeItem ( const QListBoxItem lbi,
int  index 
)

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

The item that has been changed will become selected.

Ver también:
insertItem(), removeItem()
void QListBox::clear ( void  ) [slot]

Deletes all the items in the list.

Ver también:
removeItem()
void QListBox::clear ( ) [slot]
void QListBox::clearInputString ( ) [protected, slot]
void QListBox::clearInputString ( ) [protected, slot]
void QListBox::clearSelection ( ) [virtual, slot]

Deselects all items, if possible.

Note that a Single selection list box will automatically select an item if it has keyboard focus.

virtual void QListBox::clearSelection ( ) [virtual, slot]
void QListBox::clicked ( QListBoxItem item) [signal]

This signal is emitted when the user clicks any mouse button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

void QListBox::clicked ( QListBoxItem item,
const QPoint pnt 
) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user clicks any mouse button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

pnt is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differs by a pixel or two, pnt is the position at release time.)

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

void QListBox::clicked ( QListBoxItem ) [signal]
void QListBox::clicked ( QListBoxItem ,
const QPoint  
) [signal]
LayoutMode QListBox::columnMode ( ) const
LayoutMode QListBox::columnMode ( ) const
void QListBox::contentsContextMenuEvent ( QContextMenuEvent e) [protected, virtual]

This event handler is called whenever the QScrollView receives a contextMenuEvent() in {e}: the mouse position is translated to be a point on the contents.

Reimplementado de QScrollView.

void QListBox::contentsContextMenuEvent ( QContextMenuEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::contextMenuRequested ( QListBoxItem item,
const QPoint pos 
) [signal]

This signal is emitted when the user invokes a context menu with the right mouse button or with special system keys, with item being the item under the mouse cursor or the current item, respectively.

pos is the position for the context menu in the global coordinate system.

void QListBox::contextMenuRequested ( QListBoxItem ,
const QPoint  
) [signal]
uint QListBox::count ( ) const
uint QListBox::count ( ) const
void QListBox::currentChanged ( QListBoxItem item) [signal]

This signal is emitted when the user makes a new item the current item. item is the new current list box item.

Ver también:
setCurrentItem() currentItem()
void QListBox::currentChanged ( QListBoxItem ) [signal]
int QListBox::currentItem ( ) const
int QListBox::currentItem ( ) const
QString QListBox::currentText ( ) const [inline]
QString QListBox::currentText ( ) const [inline]
void QListBox::doLayout ( ) const [protected]

This function does the hard layout work. You should never need to call it.

void QListBox::doLayout ( ) const [protected]
void QListBox::doubleClicked ( QListBoxItem item) [signal]

This signal is emitted whenever an item is double-clicked. It's emitted on the second button press, not the second button release. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

void QListBox::doubleClicked ( QListBoxItem ) [signal]
bool QListBox::dragSelect ( ) const [inline]
bool QListBox::dragSelect ( ) const [inline]
void QListBox::ensureCurrentVisible ( ) [virtual, slot]

Ensures that the current item is visible.

virtual void QListBox::ensureCurrentVisible ( ) [virtual, slot]
bool QListBox::eventFilter ( QObject obj,
QEvent e 
) [protected, virtual]

This event filter ensures the scroll bars are updated when a single contents widget is resized, shown, hidden or destroyed; it passes mouse events to the QScrollView. The event is in e and the object is in obj.

Reimplementado de QScrollView.

bool QListBox::eventFilter ( QObject o,
QEvent e 
) [protected, virtual]

Reimplementado de QScrollView.

int QListBox::findItem ( int  yPos) const [inline, protected]
int QListBox::findItem ( int  yPos) const [inline, protected]

Returns the index of the item a point (0, yPos).

Ver también:
index() itemAt()
QListBoxItem * QListBox::findItem ( const QString text,
ComparisonFlags  compare = BeginsWith 
) const

Finds the first list box item that has the text text and returns it, or returns 0 of no such item could be found. The search starts from the current item if the current item exists, otherwise it starts from the first list box item. If ComparisonFlags are specified in compare then these flags are used, otherwise the default is a case-insensitive, "begins with" search.

Ver también:
Qt::StringComparisonMode
QListBoxItem* QListBox::findItem ( const QString text,
ComparisonFlags  compare = BeginsWith 
) const
QListBoxItem * QListBox::firstItem ( ) const

Returns the first item in this list box. If the list box is empty, returns 0.

QListBoxItem* QListBox::firstItem ( ) const
void QListBox::focusInEvent ( QFocusEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget.

A widget normally must setFocusPolicy() to something other than NoFocus in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)

The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.

Ver también:
focusOutEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

Reimplementado de QWidget.

void QListBox::focusInEvent ( QFocusEvent e) [protected, virtual]

Reimplementado de QWidget.

void QListBox::focusOutEvent ( QFocusEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget.

A widget normally must setFocusPolicy() to something other than NoFocus in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)

The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.

Ver también:
focusInEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

Reimplementado de QWidget.

void QListBox::focusOutEvent ( QFocusEvent e) [protected, virtual]

Reimplementado de QWidget.

void QListBox::highlighted ( int  index) [signal]

This signal is emitted when the user makes a new item the current item. index is the index of the new current item.

Ver también:
currentChanged() selected() currentItem() selectionChanged()
void QListBox::highlighted ( const QString t0) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user makes a new item the current item and the item is (or has) a string. The argument is the text of the new current item.

Ver también:
currentChanged() selected() currentItem() selectionChanged()
void QListBox::highlighted ( QListBoxItem t0) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user makes a new item the current item. The argument is a pointer to the new current item.

Ver también:
currentChanged() selected() currentItem() selectionChanged()
void QListBox::highlighted ( int  index) [signal]
void QListBox::highlighted ( const QString ) [signal]
void QListBox::highlighted ( QListBoxItem ) [signal]
int QListBox::index ( const QListBoxItem lbi) const

Returns the index of lbi, or -1 if the item is not in this list box or lbi is 0.

Ver también:
item()
int QListBox::index ( const QListBoxItem ) const
void QListBox::insertItem ( const QListBoxItem lbi,
const QListBoxItem after 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts the item lbi into the list after the item after, or at the beginning if after is 0.

Ver también:
insertStrList()
void QListBox::insertItem ( const QListBoxItem ,
int  index = -1 
)
void QListBox::insertItem ( const QListBoxItem ,
const QListBoxItem after 
)
void QListBox::insertItem ( const QString text,
int  index = -1 
)
void QListBox::insertItem ( const QPixmap pixmap,
int  index = -1 
)
void QListBox::insertItem ( const QPixmap pixmap,
const QString text,
int  index = -1 
)
void QListBox::insertItem ( const QPixmap pixmap,
int  index = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts a new list box pixmap item with the pixmap pixmap into the list at position index.

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

Ver también:
insertStrList()
void QListBox::insertItem ( const QPixmap pixmap,
const QString text,
int  index = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts a new list box pixmap item with the pixmap pixmap and the text text into the list at position index.

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

Ver también:
insertStrList()
void QListBox::insertItem ( const QString text,
int  index = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts a new list box text item with the text text into the list at position index.

If index is negative, text is inserted at the end of the list.

Ver también:
insertStrList()
void QListBox::insertItem ( const QListBoxItem lbi,
int  index = -1 
)

Inserts the item lbi into the list at position index.

If index is negative or larger than the number of items in the list box, lbi is inserted at the end of the list.

Ver también:
insertStrList()
void QListBox::insertStringList ( const QStringList ,
int  index = -1 
)
void QListBox::insertStringList ( const QStringList list,
int  index = -1 
)

Inserts the string list list into the list at position index.

If index is negative, list is inserted at the end of the list. If index is too large, the operation is ignored.

Atención:
This function is never significantly faster than a loop around insertItem().
Ver también:
insertItem(), insertStrList()
void QListBox::insertStrList ( const QStrList ,
int  index = -1 
)
void QListBox::insertStrList ( const char **  ,
int  numStrings = -1,
int  index = -1 
)
void QListBox::insertStrList ( const QStrList ,
int  index = -1 
)
void QListBox::insertStrList ( const QStrList list,
int  index = -1 
)

Inserts the string list list into the list at position index.

If index is negative, list is inserted at the end of the list. If index is too large, the operation is ignored.

Atención:
This function uses {const char *} rather than QString, so we recommend against using it. It is provided so that legacy code will continue to work, and so that programs that certainly will not need to handle code outside a single 8-bit locale can use it. See insertStringList() which uses real QStrings.
This function is never significantly faster than a loop around insertItem().
Ver también:
insertItem(), insertStringList()
void QListBox::insertStrList ( const QStrList list,
int  index = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts the string list list into the list at position index.

If index is negative, list is inserted at the end of the list. If index is too large, the operation is ignored.

Atención:
This function uses {const char *} rather than QString, so we recommend against using it. It is provided so that legacy code will continue to work, and so that programs that certainly will not need to handle code outside a single 8-bit locale can use it. See insertStringList() which uses real QStrings.
This function is never significantly faster than a loop around insertItem().
Ver también:
insertItem(), insertStringList()
void QListBox::insertStrList ( const char **  strings,
int  numStrings = -1,
int  index = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Inserts the numStrings strings of the array strings into the list at position index.

If index is negative, insertStrList() inserts strings at the end of the list. If index is too large, the operation is ignored.

Atención:
This function uses {const char *} rather than QString, so we recommend against using it. It is provided so that legacy code will continue to work, and so that programs that certainly will not need to handle code outside a single 8-bit locale can use it. See insertStringList() which uses real QStrings.
This function is never significantly faster than a loop around insertItem().
Ver también:
insertItem(), insertStringList()
int QListBox::inSort ( const QListBoxItem lbi)

Using this method is quite inefficient. We suggest to use insertItem() for inserting and sort() afterwards.

Inserts lbi at its sorted position in the list box and returns the position.

All items must be inserted with inSort() to maintain the sorting order. inSort() treats any pixmap (or user-defined type) as lexicographically less than any string.

Ver también:
insertItem(), sort()
int QListBox::inSort ( const QString text)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Using this method is quite inefficient. We suggest to use insertItem() for inserting and sort() afterwards.

Inserts a new item of text at its sorted position in the list box and returns the position.

All items must be inserted with inSort() to maintain the sorting order. inSort() treats any pixmap (or user-defined type) as lexicographically less than any string.

Ver también:
insertItem(), sort()
int QListBox::inSort ( const QListBoxItem )
int QListBox::inSort ( const QString text)
void QListBox::invertSelection ( ) [virtual, slot]

Inverts the selection. Only works in Multi and Extended selection mode.

virtual void QListBox::invertSelection ( ) [virtual, slot]
bool QListBox::isMultiSelection ( ) const
bool QListBox::isMultiSelection ( ) const
bool QListBox::isRubberSelecting ( ) const [protected]

Returns TRUE if the user is selecting items using a rubber band rectangle; otherwise returns FALSE.

bool QListBox::isRubberSelecting ( ) const [protected]
bool QListBox::isSelected ( int  i) const

Returns TRUE if item i is selected; otherwise returns FALSE.

bool QListBox::isSelected ( const QListBoxItem i) const

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns TRUE if item i is selected; otherwise returns FALSE.

bool QListBox::isSelected ( int  ) const
bool QListBox::isSelected ( const QListBoxItem ) const
QListBoxItem * QListBox::item ( int  index) const

Returns a pointer to the item at position index, or 0 if index is out of bounds.

Ver también:
index()
QListBoxItem* QListBox::item ( int  index) const
QListBoxItem * QListBox::itemAt ( const QPoint p) const

Returns the item at point p, specified in viewport coordinates, or a 0 if there is no item at p.

Use contentsToViewport() to convert between widget coordinates and viewport coordinates.

QListBoxItem* QListBox::itemAt ( const QPoint ) const
int QListBox::itemHeight ( int  index = 0) const

Returns the height in pixels of the item with index index. index defaults to 0.

If index is too large, this function returns 0.

int QListBox::itemHeight ( int  index = 0) const
QRect QListBox::itemRect ( QListBoxItem item) const

Returns the rectangle on the screen that item occupies in viewport()'s coordinates, or an invalid rectangle if item is 0 or is not currently visible.

QRect QListBox::itemRect ( QListBoxItem item) const
bool QListBox::itemVisible ( int  index)

Returns TRUE if the item at position index is at least partly visible; otherwise returns FALSE.

bool QListBox::itemVisible ( const QListBoxItem item)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns TRUE if item is at least partly visible; otherwise returns FALSE.

bool QListBox::itemVisible ( int  index)
bool QListBox::itemVisible ( const QListBoxItem )
bool QListBox::itemYPos ( int  index,
int yPos 
) const [protected]

Returns the vertical pixel-coordinate in *yPos, of the list box item at position index in the list. Returns FALSE if the item is outside the visible area.

bool QListBox::itemYPos ( int  index,
int yPos 
) const [protected]
void QListBox::keyPressEvent ( QKeyEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.

A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.

If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.

The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.

Ver también:
keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event(), QKeyEvent

Reimplementado de QWidget.

void QListBox::keyPressEvent ( QKeyEvent e) [protected, virtual]

Reimplementado de QWidget.

long QListBox::maxItemWidth ( ) const
long QListBox::maxItemWidth ( ) const

Returns the width of the widest item in the list box.

QSize QListBox::minimumSizeHint ( ) const [virtual]

Reimplementado de QScrollView.

QSize QListBox::minimumSizeHint ( ) const [virtual]

Reimplementado de QScrollView.

void QListBox::mouseButtonClicked ( int  ,
QListBoxItem ,
const QPoint  
) [signal]
void QListBox::mouseButtonClicked ( int  button,
QListBoxItem item,
const QPoint pos 
) [signal]

This signal is emitted when the user clicks mouse button button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()). (If the click's press and release differs by a pixel or two, pos is the position at release time.)

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

void QListBox::mouseButtonPressed ( int  button,
QListBoxItem item,
const QPoint pos 
) [signal]

This signal is emitted when the user presses mouse button button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

pos is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()).

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

void QListBox::mouseButtonPressed ( int  ,
QListBoxItem ,
const QPoint  
) [signal]
void QListBox::mouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mouseMoveEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mouseMoveEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mousePressEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mousePressEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mouseReleaseEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::mouseReleaseEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QScrollView.

int QListBox::numCols ( ) const [inline]

Returns the number of columns.

Ver también:
numColumns()
int QListBox::numCols ( ) const [inline]
int QListBox::numColumns ( ) const
int QListBox::numColumns ( ) const
int QListBox::numItemsVisible ( ) const
int QListBox::numItemsVisible ( ) const
int QListBox::numRows ( ) const
int QListBox::numRows ( ) const
void QListBox::onItem ( QListBoxItem item) [signal]
void QListBox::onItem ( QListBoxItem i) [signal]

This signal is emitted when the user moves the mouse cursor onto an item, similar to the QWidget::enterEvent() function. i is the QListBoxItem that the mouse has moved on.

void QListBox::onViewport ( ) [signal]
void QListBox::onViewport ( ) [signal]

This signal is emitted when the user moves the mouse cursor from an item to an empty part of the list box.

void QListBox::paintCell ( QPainter p,
int  row,
int  col 
) [protected, virtual]

Provided for compatibility with the old QListBox. We recommend using QListBoxItem::paint() instead.

Repaints the cell at row, col using painter p.

virtual void QListBox::paintCell ( QPainter ,
int  row,
int  col 
) [protected, virtual]
const QPixmap* QListBox::pixmap ( int  index) const
const QPixmap * QListBox::pixmap ( int  index) const

Returns a pointer to the pixmap at position index, or 0 if there is no pixmap there.

Ver también:
text()
void QListBox::pressed ( QListBoxItem ,
const QPoint  
) [signal]
void QListBox::pressed ( QListBoxItem item) [signal]

This signal is emitted when the user presses any mouse button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

void QListBox::pressed ( QListBoxItem item,
const QPoint pnt 
) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user presses any mouse button. If item is not 0, the cursor is on item. If item is 0, the mouse cursor isn't on any item.

pnt is the position of the mouse cursor in the global coordinate system (QMouseEvent::globalPos()).

Note that you must not delete any QListBoxItem objects in slots connected to this signal.

Ver también:
mouseButtonPressed() rightButtonPressed() clicked()
void QListBox::pressed ( QListBoxItem ) [signal]
void QListBox::removeItem ( int  index)
void QListBox::removeItem ( int  index)

Removes and deletes the item at position index. If index is equal to currentItem(), a new item becomes current and the currentChanged() and highlighted() signals are emitted.

Ver también:
insertItem(), clear()
void QListBox::resizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::resizeEvent ( QResizeEvent event) [protected, virtual]

Reimplementado de QScrollView.

void QListBox::returnPressed ( QListBoxItem ) [signal]
void QListBox::returnPressed ( QListBoxItem t0) [signal]

This signal is emitted when Enter or Return is pressed. The argument is currentItem().

void QListBox::rightButtonClicked ( QListBoxItem t0,
const QPoint t1 
) [signal]

This signal is emitted when the right button is clicked (i.e. when it's released at the same point where it was pressed). The arguments are the relevant QListBoxItem (may be 0) and the point in global coordinates.

void QListBox::rightButtonClicked ( QListBoxItem ,
const QPoint  
) [signal]
void QListBox::rightButtonPressed ( QListBoxItem ,
const QPoint  
) [signal]
void QListBox::rightButtonPressed ( QListBoxItem t0,
const QPoint t1 
) [signal]

This signal is emitted when the right button is pressed. The arguments are the relevant QListBoxItem (may be 0) and the point in global coordinates.

LayoutMode QListBox::rowMode ( ) const
LayoutMode QListBox::rowMode ( ) const
bool QListBox::scrollBar ( ) const [inline]

Returns FALSE if vScrollBarMode() is AlwaysOff; otherwise returns TRUE.

bool QListBox::scrollBar ( ) const [inline]
void QListBox::selectAll ( bool  select) [virtual, slot]

In Multi and Extended modes, this function sets all items to be selected if select is TRUE, and to be unselected if select is FALSE.

In Single and NoSelection modes, this function only changes the selection status of currentItem().

virtual void QListBox::selectAll ( bool  select) [virtual, slot]
void QListBox::selected ( const QString t0) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user double-clicks on an item or presses Enter on the current item, and the item is (or has) a string. The argument is the text of the selected item.

Ver también:
currentChanged() highlighted() selectionChanged()
void QListBox::selected ( QListBoxItem t0) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the user double-clicks on an item or presses Enter on the current item. The argument is a pointer to the new selected item.

Ver también:
currentChanged() highlighted() selectionChanged()
void QListBox::selected ( int  index) [signal]
void QListBox::selected ( int  index) [signal]

This signal is emitted when the user double-clicks on an item or presses Enter on the current item. index is the index of the selected item.

Ver también:
currentChanged() highlighted() selectionChanged()
void QListBox::selected ( const QString ) [signal]
void QListBox::selected ( QListBoxItem ) [signal]
QListBoxItem * QListBox::selectedItem ( ) const

Returns the selected item if the list box is in single-selection mode and an item is selected.

If no items are selected or the list box is in another selection mode this function returns 0.

Ver también:
setSelected() setMultiSelection()
QListBoxItem* QListBox::selectedItem ( ) const
void QListBox::selectionChanged ( QListBoxItem ) [signal]
void QListBox::selectionChanged ( ) [signal]
void QListBox::selectionChanged ( ) [signal]

This signal is emitted when the selection set of a list box changes. This signal is emitted in each selection mode. If the user selects five items by drag-selecting, QListBox tries to emit just one selectionChanged() signal so the signal can be connected to computationally expensive slots.

Ver también:
selected() currentItem()
void QListBox::selectionChanged ( QListBoxItem item) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This signal is emitted when the selection in a Single selection list box changes. item is the newly selected list box item.

Ver también:
selected() currentItem()
SelectionMode QListBox::selectionMode ( ) const
SelectionMode QListBox::selectionMode ( ) const
void QListBox::setAutoBottomScrollBar ( bool  enable) [inline]
void QListBox::setAutoBottomScrollBar ( bool  enable) [inline]

If enable is TRUE sets setHScrollBarMode() to AlwaysOn; otherwise sets setHScrollBarMode() to AlwaysOff.

void QListBox::setAutoScroll ( bool  ) [inline]
void QListBox::setAutoScroll ( bool  ) [inline]
void QListBox::setAutoScrollBar ( bool  enable) [inline]

If enable is TRUE sets setVScrollBarMode() to AlwaysOn; otherwise sets setVScrollBarMode() to AlwaysOff.

void QListBox::setAutoScrollBar ( bool  enable) [inline]
void QListBox::setAutoUpdate ( bool  ) [inline]
void QListBox::setAutoUpdate ( bool  ) [inline]
virtual void QListBox::setBottomItem ( int  index) [virtual]
void QListBox::setBottomItem ( int  index) [virtual]

Scrolls the list box so the item at position index in the list is displayed in the bottom row of the list box.

Ver también:
setTopItem()
void QListBox::setBottomScrollBar ( bool  enable) [inline]

If enable is TRUE sets setHScrollBarMode() to AlwaysOn; otherwise sets setHScrollBarMode() to AlwaysOff.

void QListBox::setBottomScrollBar ( bool  enable) [inline]
virtual void QListBox::setColumnMode ( int  ) [virtual]
virtual void QListBox::setColumnMode ( LayoutMode  ) [virtual]
void QListBox::setColumnMode ( LayoutMode  mode) [virtual]
void QListBox::setColumnMode ( int  columns) [virtual]
void QListBox::setCurrentItem ( QListBoxItem i) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the current item to the QListBoxItem i.

void QListBox::setCurrentItem ( int  index) [virtual]
virtual void QListBox::setCurrentItem ( QListBoxItem ) [virtual]
virtual void QListBox::setCurrentItem ( int  index) [virtual]
void QListBox::setDragSelect ( bool  ) [inline]
void QListBox::setDragSelect ( bool  ) [inline]
void QListBox::setFixedVisibleLines ( int  lines) [inline]
void QListBox::setFixedVisibleLines ( int  lines) [inline]
virtual void QListBox::setFont ( const QFont ) [virtual]

Reimplementado de QWidget.

void QListBox::setFont ( const QFont font) [virtual]

Reimplementado de QWidget.

void QListBox::setMultiSelection ( bool  multi)
void QListBox::setMultiSelection ( bool  multi)
virtual void QListBox::setRowMode ( int  ) [virtual]
void QListBox::setRowMode ( int  rows) [virtual]
void QListBox::setRowMode ( LayoutMode  mode) [virtual]
virtual void QListBox::setRowMode ( LayoutMode  ) [virtual]
void QListBox::setScrollBar ( bool  enable) [inline]

If enable is TRUE sets setVScrollBarMode() to AlwaysOn; otherwise sets setVScrollBarMode() to AlwaysOff.

void QListBox::setScrollBar ( bool  enable) [inline]
void QListBox::setSelected ( QListBoxItem item,
bool  select 
) [virtual]

Selects item if select is TRUE or unselects it if select is FALSE, and repaints the item appropriately.

If the list box is a Single selection list box and select is TRUE, setSelected() calls setCurrentItem().

If the list box is a Single selection list box, select is FALSE, setSelected() calls clearSelection().

Ver también:
setMultiSelection(), setCurrentItem(), clearSelection(), currentItem()
virtual void QListBox::setSelected ( QListBoxItem ,
bool   
) [virtual]
void QListBox::setSelected ( int  index,
bool  select 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. If select is TRUE the item at position index is selected; otherwise the item is deselected.

void QListBox::setSelected ( int  ,
bool   
)
virtual void QListBox::setSelectionMode ( SelectionMode  ) [virtual]
void QListBox::setSelectionMode ( SelectionMode  mode) [virtual]
void QListBox::setSmoothScrolling ( bool  ) [inline]
void QListBox::setSmoothScrolling ( bool  ) [inline]
virtual void QListBox::setTopItem ( int  index) [virtual]
void QListBox::setTopItem ( int  index) [virtual]
virtual void QListBox::setVariableHeight ( bool  ) [virtual]
void QListBox::setVariableHeight ( bool  enable) [virtual]
void QListBox::setVariableWidth ( bool  enable) [virtual]
virtual void QListBox::setVariableWidth ( bool  ) [virtual]
void QListBox::showEvent ( QShowEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget show events.

Non-spontaneous show events are sent to widgets immediately before they are shown. The spontaneous show events of top-level widgets are delivered afterwards.

Ver también:
event(), QShowEvent

Reimplementado de QWidget.

void QListBox::showEvent ( QShowEvent ) [protected, virtual]

Reimplementado de QWidget.

QSize QListBox::sizeHint ( ) const [virtual]

Reimplementado de QScrollView.

QSize QListBox::sizeHint ( ) const [virtual]

Reimplementado de QScrollView.

bool QListBox::smoothScrolling ( ) const [inline]
bool QListBox::smoothScrolling ( ) const [inline]
void QListBox::sort ( bool  ascending = TRUE)

If ascending is TRUE sorts the items in ascending order; otherwise sorts in descending order.

To compare the items, the text (QListBoxItem::text()) of the items is used.

void QListBox::sort ( bool  ascending = TRUE)
void QListBox::takeItem ( const QListBoxItem item)

Removes item from the list box and causes an update of the screen display. The item is not deleted. You should normally not need to call this function because QListBoxItem::~QListBoxItem() calls it. The normal way to delete an item is with delete.

Ver también:
QListBox::insertItem()
void QListBox::takeItem ( const QListBoxItem )
QString QListBox::text ( int  index) const
QString QListBox::text ( int  index) const

Returns the text at position index, or QString::null if there is no text at that position.

Ver también:
pixmap()
void QListBox::toggleCurrentItem ( ) [protected]

Toggles the selection status of currentItem() and repaints if the list box is a Multi selection list box.

Ver también:
setMultiSelection()
void QListBox::toggleCurrentItem ( ) [protected]
int QListBox::topItem ( ) const
int QListBox::topItem ( ) const
int QListBox::totalHeight ( ) const [inline, protected]

Returns contentsHeight().

int QListBox::totalHeight ( ) const [inline, protected]
int QListBox::totalWidth ( ) const [inline, protected]
int QListBox::totalWidth ( ) const [inline, protected]

Returns contentsWidth().

void QListBox::triggerUpdate ( bool  doLayout)
void QListBox::triggerUpdate ( bool  doLayout)

Ensures that a single paint event will occur at the end of the current event loop iteration. If doLayout is TRUE, the layout is also redone.

void QListBox::updateCellWidth ( ) [inline, protected]
void QListBox::updateCellWidth ( ) [inline, protected]
void QListBox::updateItem ( QListBoxItem i) [protected]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Repaints the QListBoxItem i.

void QListBox::updateItem ( QListBoxItem ) [protected]
void QListBox::updateItem ( int  index) [protected]
void QListBox::updateItem ( int  index) [protected]

Repaints the item at position index in the list.

bool QListBox::variableHeight ( ) const
bool QListBox::variableHeight ( ) const
bool QListBox::variableWidth ( ) const
bool QListBox::variableWidth ( ) const
void QListBox::viewportPaintEvent ( QPaintEvent e) [virtual]

Reimplementado de QScrollView.

void QListBox::viewportPaintEvent ( QPaintEvent pe) [virtual]

This is a low-level painting routine that draws the viewport contents. Reimplement this if drawContents() is too high-level (for example, if you don't want to open a QPainter on the viewport). The paint event is passed in pe.

Reimplementado de QScrollView.

void QListBox::windowActivationChange ( bool  oldActive) [protected, virtual]

This virtual function is called for a widget when its window is activated or deactivated by the window system. oldActive is the previous state; you can get the new setting from isActiveWindow().

Reimplement this function if your widget needs to know when its window becomes activated or deactivated.

The default implementation updates the visible part of the widget if the inactive and the active colorgroup are different for colors other than the highlight and link colors.

Ver también:
setActiveWindow(), isActiveWindow(), update(), palette()

Reimplementado de QWidget.

void QListBox::windowActivationChange ( bool  oldActive) [protected, virtual]

Reimplementado de QWidget.


Documentación de las funciones relacionadas y clases amigas

QListBoxItem [friend]
QListBoxPrivate [friend]

Documentación de propiedades

LayoutMode QListBox::columnMode [read, write]

the column layout mode for this list box.

setColumnMode() sets the layout mode and adjusts the number of displayed columns. The row layout mode automatically becomes Variable, unless the column mode is Variable.

Ver también:
setRowMode() columnMode() rowMode numColumns
uint QListBox::count [read]

the number of items in the list box

int QListBox::currentItem [read, write]

the current highlighted item

When setting this property, the highlighting is moved to the item and the list box scrolled as necessary.

If no item is current, currentItem() returns -1.

QString QListBox::currentText [read]

the text of the current item.

This is equivalent to text(currentItem()).

bool QListBox::multiSelection [read, write]

whether or not the list box is in Multi selection mode

Consider using the QListBox::selectionMode property instead of this property.

When setting this property, Multi selection mode is used if set to TRUE and to Single selection mode if set to FALSE.

When getting this property, TRUE is returned if the list box is in Multi selection mode or Extended selection mode, and FALSE if it is in Single selection mode or NoSelection mode.

Ver también:
selectionMode
int QListBox::numColumns [read]

the number of columns in the list box

This is normally 1, but can be different if QListBox::columnMode or QListBox::rowMode has been set.

Ver también:
columnMode rowMode numRows
int QListBox::numItemsVisible [read]

the number of visible items.

Both partially and entirely visible items are counted.

int QListBox::numRows [read]

the number of rows in the list box.

This is equal to the number of items in the default single-column layout, but can be different.

Ver también:
columnMode rowMode numColumns
LayoutMode QListBox::rowMode [read, write]

the row layout mode for this list box

This property is normally Variable.

setRowMode() sets the layout mode and adjusts the number of displayed rows. The column layout mode automatically becomes Variable, unless the row mode is Variable.

Ver también:
columnMode rowMode
SelectionMode QListBox::selectionMode [read, write]

the selection mode of the list box

Sets the list box's selection mode, which may be one of Single (the default), Extended, Multi or NoSelection.

Ver también:
SelectionMode
int QListBox::topItem [read, write]

the index of an item at the top of the screen.

When getting this property and the listbox has multiple columns, an arbitrary item is selected and returned.

When setting this property, the list box is scrolled so the item at position index in the list is displayed in the top row of the list box.

bool QListBox::variableHeight [read, write]

whether this list box has variable-height rows

When the list box has variable-height rows (the default), each row is as high as the highest item in that row. When it has same-sized rows, all rows are as high as the highest item in the list box.

Ver también:
variableWidth
bool QListBox::variableWidth [read, write]

whether this list box has variable-width columns

When the list box has variable-width columns, each column is as wide as the widest item in that column. When it has same-sized columns (the default), all columns are as wide as the widest item in the list box.

Ver también:
variableHeight

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'