- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends

# QListWidget Class Reference

Search for all occurrences

## Detailed Description

Definition at line 202 of file qlistwidget.h.

`#include <qlistwidget.h>`

Inheritance diagram for QListWidget:
[legend]

List of all members.

## Public Slots
void | scrollToItem (const QListWidgetItem *item, QAbstractItemView::ScrollHint hint=EnsureVisible)
void | clear ()
## Signals
void | itemPressed (QListWidgetItem *item)
void | itemClicked (QListWidgetItem *item)
void | itemDoubleClicked (QListWidgetItem *item)
void | itemActivated (QListWidgetItem *item)
void | itemEntered (QListWidgetItem *item)
void | itemChanged (QListWidgetItem *item)
void | currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous)
void | currentTextChanged (const QString &currentText)
void | currentRowChanged (int currentRow)
void | itemSelectionChanged ()
## Public Member Functions
| QListWidget (QWidget *parent=0)
| ~QListWidget ()
QListWidgetItem * | item (int row) const
int | row (const QListWidgetItem *item) const
void | insertItem (int row, QListWidgetItem *item)
void | insertItem (int row, const QString &label)
void | insertItems (int row, const QStringList &labels)
void | addItem (const QString &label)
void | addItem (QListWidgetItem *item)
void | addItems (const QStringList &labels)
QListWidgetItem * | takeItem (int row)
int | count () const
QListWidgetItem * | currentItem () const
void | setCurrentItem (QListWidgetItem *item)
void | setCurrentItem (QListWidgetItem *item, QItemSelectionModel::SelectionFlags command)
int | currentRow () const
void | setCurrentRow (int row)
void | setCurrentRow (int row, QItemSelectionModel::SelectionFlags command)
QListWidgetItem * | itemAt (const QPoint &p) const
QListWidgetItem * | itemAt (int x, int y) const
QRect | visualItemRect (const QListWidgetItem *item) const
void | sortItems (Qt::SortOrder order=Qt::AscendingOrder)
void | setSortingEnabled (bool enable)
bool | isSortingEnabled () const
void | editItem (QListWidgetItem *item)
void | openPersistentEditor (QListWidgetItem *item)
void | closePersistentEditor (QListWidgetItem *item)
QWidget * | itemWidget (QListWidgetItem *item) const
void | setItemWidget (QListWidgetItem *item, QWidget *widget)
void | removeItemWidget (QListWidgetItem *item)
bool | isItemSelected (const QListWidgetItem *item) const
void | setItemSelected (const QListWidgetItem *item, bool select)
QList< QListWidgetItem * > | selectedItems () const
QList< QListWidgetItem * > | findItems (const QString &text, Qt::MatchFlags flags) const
bool | isItemHidden (const QListWidgetItem *item) const
void | setItemHidden (const QListWidgetItem *item, bool hide)
void | dropEvent (QDropEvent *event)
## Protected Member Functions
bool | event (QEvent *e)
virtual QStringList | mimeTypes () const
virtual QMimeData * | mimeData (const QList< QListWidgetItem * > items) const
virtual bool | dropMimeData (int index, const QMimeData *data, Qt::DropAction action)
virtual Qt::DropActions | supportedDropActions () const
QList< QListWidgetItem * > | items (const QMimeData *data) const
QModelIndex | indexFromItem (QListWidgetItem *item) const
QListWidgetItem * | itemFromIndex (const QModelIndex &index) const
## Properties
int | count
int | currentRow
bool | sortingEnabled
## Friends
class | QListWidgetItem
class | QListModel

## Constructor & Destructor Documentation

QListWidget | ( | QWidget * | parent = `0` | ) | `[explicit]`

~QListWidget | ( |  | ) |

## Member Function Documentation

QListWidgetItem* item | ( | int | row | ) | const

Search for all occurrences

int row | ( | const QListWidgetItem * | item | ) | const

Search for all occurrences

void insertItem | ( | int | row,
|  | QListWidgetItem * | item
| ) |  |

Search for all occurrences

void insertItem | ( | int | row,
|  | const QString & | label
| ) |  |

Search for all occurrences

void insertItems | ( | int | row,
|  | const QStringList & | labels
| ) |  |

Search for all occurrences

void addItem | ( | const QString & | label | ) | `[inline]`

Search for all occurrences

Definition at line 220 of file qlistwidget.h.

    { insertItem(count(), label); }

void addItem | ( | QListWidgetItem * | item | ) | `[inline]`

Search for all occurrences

Definition at line 311 of file qlistwidget.h.

    { insertItem(count(), aitem); }

void addItems | ( | const QStringList & | labels | ) | `[inline]`

Search for all occurrences

Definition at line 222 of file qlistwidget.h.

    { insertItems(count(), labels); }

QListWidgetItem* takeItem | ( | int | row | ) |

Search for all occurrences

int count | ( |  | ) | const

Search for all occurrences

QListWidgetItem* currentItem | ( |  | ) | const

Search for all occurrences

void setCurrentItem | ( | QListWidgetItem * | item | ) |

Search for all occurrences

void setCurrentItem | ( | QListWidgetItem * | item,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  |

Search for all occurrences

int currentRow | ( |  | ) | const

Search for all occurrences

void setCurrentRow | ( | int | row | ) |

Search for all occurrences

void setCurrentRow | ( | int | row,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  |

Search for all occurrences

QListWidgetItem* itemAt | ( | const QPoint & | p | ) | const

Search for all occurrences

QListWidgetItem * itemAt | ( | int | x,
|  | int | y
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 314 of file qlistwidget.h.

    { return itemAt(QPoint(ax, ay)); }

QRect visualItemRect | ( | const QListWidgetItem * | item | ) | const

Search for all occurrences

void sortItems | ( | Qt::SortOrder | order = `Qt::AscendingOrder` | ) |

Search for all occurrences

void setSortingEnabled | ( | bool | enable | ) |

Search for all occurrences

bool isSortingEnabled | ( |  | ) | const

Search for all occurrences

void editItem | ( | QListWidgetItem * | item | ) |

Search for all occurrences

void openPersistentEditor | ( | QListWidgetItem * | item | ) |

Search for all occurrences

void closePersistentEditor | ( | QListWidgetItem * | item | ) |

Search for all occurrences

QWidget* itemWidget | ( | QListWidgetItem * | item | ) | const

Search for all occurrences

void setItemWidget | ( | QListWidgetItem * | item,
|  | QWidget * | widget
| ) |  |

Search for all occurrences

void removeItemWidget | ( | QListWidgetItem * | item | ) | `[inline]`

Search for all occurrences

Definition at line 308 of file qlistwidget.h.

    { setItemWidget(aItem, 0); }

bool isItemSelected | ( | const QListWidgetItem * | item | ) | const

Search for all occurrences

void setItemSelected | ( | const QListWidgetItem * | item,
|  | bool | select
| ) |  |

Search for all occurrences

QList<QListWidgetItem*> selectedItems | ( |  | ) | const

Search for all occurrences

QList<QListWidgetItem*> findItems | ( | const QString & | text,
|  | Qt::MatchFlags | flags
| ) |  | const

Search for all occurrences

bool isItemHidden | ( | const QListWidgetItem * | item | ) | const

Search for all occurrences

void setItemHidden | ( | const QListWidgetItem * | item,
|  | bool | hide
| ) |  |

Search for all occurrences

void dropEvent | ( | QDropEvent * | event | ) | `[virtual]`

Search for all occurrences

Reimplemented from QListView.

void scrollToItem | ( | const QListWidgetItem * | item,
|  | QAbstractItemView::ScrollHint | hint = `EnsureVisible`
| ) |  | `[slot]`

Search for all occurrences

void clear | ( |  | ) | `[slot]`

Search for all occurrences

void itemPressed | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemClicked | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemDoubleClicked | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemActivated | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemEntered | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemChanged | ( | QListWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void currentItemChanged | ( | QListWidgetItem * | current,
|  | QListWidgetItem * | previous
| ) |  | `[signal]`

Search for all occurrences

void currentTextChanged | ( | const QString & | currentText | ) | `[signal]`

Search for all occurrences

void currentRowChanged | ( | int | currentRow | ) | `[signal]`

Search for all occurrences

void itemSelectionChanged | ( |  | ) | `[signal]`

Search for all occurrences

bool event | ( | QEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QListView.

virtual QStringList mimeTypes | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

virtual QMimeData* mimeData | ( | const QList< QListWidgetItem * > | items | ) | const `[protected, virtual]`

Search for all occurrences

virtual bool dropMimeData | ( | int | index,
|  | const QMimeData * | data,
|  | Qt::DropAction | action
| ) |  | `[protected, virtual]`

Search for all occurrences

virtual Qt::DropActions supportedDropActions | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

QList<QListWidgetItem*> items | ( | const QMimeData * | data | ) | const `[protected]`

Search for all occurrences

QModelIndex indexFromItem | ( | QListWidgetItem * | item | ) | const `[protected]`

Search for all occurrences

QListWidgetItem* itemFromIndex | ( | const QModelIndex & | index | ) | const `[protected]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QListWidgetItem `[friend]`

Search for all occurrences

Definition at line 209 of file qlistwidget.h.

friend class QListModel `[friend]`

Search for all occurrences

Definition at line 210 of file qlistwidget.h.

## Property Documentation

int count `[read]`

Search for all occurrences

Definition at line 205 of file qlistwidget.h.

int currentRow `[read, write]`

Search for all occurrences

Definition at line 206 of file qlistwidget.h.

bool sortingEnabled `[read, write]`

Search for all occurrences

Definition at line 207 of file qlistwidget.h.

The documentation for this class was generated from the following file:

- QtGui/qlistwidget.h

QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget
QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget QListWidget