QListWidget is a convenience class that provides a list view similar to the one supplied by QListView, but with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each QListWidgetItem in the list.
For a more flexible list view widget, use the QListView class with a standard model.
List widgets are constructed in the same way as other widgets:
snippets/qlistwidget-using/mainwindow.cpp = new QListWidget = new
The selectionMode() of a list widget determines how many of the items in the list can be selected at the same time, and whether complex selections of items can be created. This can be set with the setSelectionMode() function.
There are two ways to add items to the list: they can be constructed with the list widget as their parent widget, or they can be constructed with no parent widget and added to the list later. If a list widget already exists when the items are constructed, the first method is easier to use:
new QListWidgetItem new QListWidgetItem(tr("Pine")
If you need to insert a new item into the list at a particular position, it is more required to construct the item without a parent widget and use the insertItem() function to place it within the list. The list widget will take ownership of the item.
QListWidgetItem *newItem newItem->setText listWidget->insertItem listWidget->insertItem
For multiple items, insertItems() can be used instead. The number of items in the list is found with the count() function. To remove items from the list, use takeItem().
The current item in the list can be found with currentItem(), and changed with setCurrentItem(). The user can also change the current item by navigating with the keyboard or clicking on a different item. When the current item changes, the currentItemChanged() signal is emitted with the new current item and the item that was previously current.
100% windowsxp-listview.png Screenshot of a Windows XP style list widget macintosh-listview.png Screenshot of a Macintosh style table widget plastique-listview.png Screenshot of a Plastique style table widget A {Windows XP Style Widget Gallery}{Windows XP style} list widget. A {Macintosh Style Widget Gallery}{Macintosh style} list widget. A {Plastique Style Widget Gallery}{Plastique style} list widget.
Definition at line 196 of file qlistwidget.h.
Public Types | |
enum | DragDropMode { NoDragDrop, DragOnly, DropOnly, DragDrop, InternalMove } |
enum | EditTrigger { NoEditTriggers = 0, CurrentChanged = 1, DoubleClicked = 2, SelectedClicked = 4, EditKeyPressed = 8, AnyKeyPressed = 16, AllEditTriggers = 31 } |
enum | Flow { LeftToRight, TopToBottom } |
enum | LayoutMode { SinglePass, Batched } |
enum | Movement { Static, Free, Snap } |
enum | PaintDeviceMetric { PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM, PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY, PdmPhysicalDpiX, PdmPhysicalDpiY } |
enum | RenderFlag { DrawWindowBackground = 0x1, DrawChildren = 0x2, IgnoreMask = 0x4 } |
enum | ResizeMode { Fixed, Adjust } |
enum | ScrollHint { EnsureVisible, PositionAtTop, PositionAtBottom, PositionAtCenter } |
enum | ScrollMode { ScrollPerItem, ScrollPerPixel } |
enum | SelectionBehavior { SelectItems, SelectRows, SelectColumns } |
enum | SelectionMode { NoSelection, SingleSelection, MultiSelection, ExtendedSelection, ContiguousSelection } |
enum | Shadow { Plain = 0x0010, Raised = 0x0020, Sunken = 0x0030 } |
enum | Shape { NoFrame = 0, Box = 0x0001, Panel = 0x0002, WinPanel = 0x0003, HLine = 0x0004, VLine = 0x0005, StyledPanel = 0x0006 } |
enum | StyleMask { Shadow_Mask = 0x00f0, Shape_Mask = 0x000f } |
enum | ViewMode { ListMode, IconMode } |
Public Slots | |
void | clear () |
void | clearSelection () |
bool | close () |
void | deleteLater () |
void | edit (const QModelIndex &index) |
void | hide () |
void | lower () |
void | raise () |
void | repaint () |
void | scrollToBottom () |
void | scrollToItem (const QListWidgetItem *item, QAbstractItemView::ScrollHint hint=EnsureVisible) |
void | scrollToTop () |
virtual void | selectAll () |
void | setCurrentIndex (const QModelIndex &index) |
void | setDisabled (bool) |
void | setEnabled (bool) |
void | setFocus () |
void | setHidden (bool hidden) |
QT_MOC_COMPAT void | setShown (bool shown) |
void | setStyleSheet (const QString &styleSheet) |
virtual void | setVisible (bool visible) |
void | setWindowModified (bool) |
void | setWindowTitle (const QString &) |
void | show () |
void | showFullScreen () |
void | showMaximized () |
void | showMinimized () |
void | showNormal () |
void | update () |
void | update (const QModelIndex &index) |
Signals | |
void | activated (const QModelIndex &index) |
void | clicked (const QModelIndex &index) |
void | currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous) |
void | currentRowChanged (int currentRow) |
void | currentTextChanged (const QString ¤tText) |
void | customContextMenuRequested (const QPoint &pos) |
void | destroyed (QObject *=0) |
void | doubleClicked (const QModelIndex &index) |
void | entered (const QModelIndex &index) |
void | indexesMoved (const QModelIndexList &indexes) |
void | itemActivated (QListWidgetItem *item) |
void | itemChanged (QListWidgetItem *item) |
void | itemClicked (QListWidgetItem *item) |
void | itemDoubleClicked (QListWidgetItem *item) |
void | itemEntered (QListWidgetItem *item) |
void | itemPressed (QListWidgetItem *item) |
void | itemSelectionChanged () |
void | pressed (const QModelIndex &index) |
void | viewportEntered () |
Public Member Functions | |
bool | acceptDrops () const |
QString | accessibleDescription () const |
QString | accessibleName () const |
QList< QAction * > | actions () const |
void | activateWindow () |
void | addAction (QAction *action) |
void | addActions (QList< QAction * > actions) |
void | addItem (QListWidgetItem *item) |
void | addItem (const QString &label) |
void | addItems (const QStringList &labels) |
void | addScrollBarWidget (QWidget *widget, Qt::Alignment alignment) |
void | adjustSize () |
bool | alternatingRowColors () const |
bool | autoFillBackground () const |
QPalette::ColorRole | backgroundRole () const |
QSize | baseSize () const |
int | batchSize () const |
bool | blockSignals (bool b) |
QWidget * | childAt (const QPoint &p) const |
QWidget * | childAt (int x, int y) const |
const QObjectList & | children () const |
QRect | childrenRect () const |
QRegion | childrenRegion () const |
void | clearFocus () |
void | clearMask () |
void | clearPropertyFlags () |
void | closePersistentEditor (const QModelIndex &index) |
void | closePersistentEditor (QListWidgetItem *item) |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
QRect | contentsRect () const |
Qt::ContextMenuPolicy | contextMenuPolicy () const |
QWidget * | cornerWidget () const |
int | count () const |
void | createWinId () |
QModelIndex | currentIndex () const |
QListWidgetItem * | currentItem () const |
int | currentRow () const |
QCursor | cursor () const |
int | depth () const |
int | devType () const |
bool | disconnect (const QObject *receiver, const char *member=0) |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
void | doItemsLayout () |
DragDropMode | dragDropMode () const |
bool | dragDropOverwriteMode () const |
bool | dragEnabled () const |
void | dropEvent (QDropEvent *event) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
void | editItem (QListWidgetItem *item) |
EditTriggers | editTriggers () const |
void | ensurePolished () const |
virtual bool | eventFilter (QObject *, QEvent *) |
template<typename T> | |
T | findChild (const QString &name=QString()) const |
template<typename T> | |
QList< T > | findChildren (const QRegExp &re) const |
template<typename T> | |
QList< T > | findChildren (const QString &name=QString()) const |
QList< QListWidgetItem * > | findItems (const QString &text, Qt::MatchFlags flags) const |
Flow | flow () const |
Qt::FocusPolicy | focusPolicy () const |
QWidget * | focusProxy () const |
QWidget * | focusWidget () const |
const QFont & | font () const |
QFontInfo | fontInfo () const |
QFontMetrics | fontMetrics () const |
QPalette::ColorRole | foregroundRole () const |
QRect | frameGeometry () const |
QRect | frameRect () const |
Shadow | frameShadow () const |
Shape | frameShape () const |
QSize | frameSize () const |
int | frameStyle () const |
int | frameWidth () const |
const QRect & | geometry () const |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const |
void | grabKeyboard () |
void | grabMouse (const QCursor &) |
void | grabMouse () |
int | grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut) |
QSize | gridSize () const |
Qt::HANDLE | handle () const |
bool | hasAutoScroll () const |
bool | hasFocus () const |
bool | hasMouseTracking () const |
int | height () const |
virtual int | heightForWidth (int) const |
int | heightMM () const |
QScrollBar * | horizontalScrollBar () const |
Qt::ScrollBarPolicy | horizontalScrollBarPolicy () const |
ScrollMode | horizontalScrollMode () const |
QSize | iconSize () const |
QModelIndex | indexAt (const QPoint &p) const |
QWidget * | indexWidget (const QModelIndex &index) const |
bool | inherits (const char *classname) const |
QInputContext * | inputContext () |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
void | insertAction (QAction *before, QAction *action) |
void | insertActions (QAction *before, QList< QAction * > actions) |
void | insertItem (int row, const QString &label) |
void | insertItem (int row, QListWidgetItem *item) |
void | insertItems (int row, const QStringList &labels) |
void | installEventFilter (QObject *) |
WId | internalWinId () const |
bool | isActiveWindow () const |
bool | isAncestorOf (const QWidget *child) const |
bool | isEnabled () const |
bool | isEnabledTo (QWidget *) const |
bool | isEnabledToTLW () const |
bool | isFullScreen () const |
bool | isHidden () const |
bool | isItemHidden (const QListWidgetItem *item) const |
bool | isItemSelected (const QListWidgetItem *item) const |
bool | isLeftToRight () const |
bool | isMaximized () const |
bool | isMinimized () const |
bool | isModal () const |
bool | isRightToLeft () const |
bool | isRowHidden (int row) const |
bool | isSelectionRectVisible () const |
bool | isSortingEnabled () const |
bool | isTopLevel () const |
bool | isVisible () const |
bool | isVisibleTo (QWidget *) const |
bool | isWidgetType () const |
bool | isWindow () const |
bool | isWindowModified () const |
bool | isWrapping () const |
QListWidgetItem * | item (int row) const |
QListWidgetItem * | itemAt (int x, int y) const |
QListWidgetItem * | itemAt (const QPoint &p) const |
QAbstractItemDelegate * | itemDelegate (const QModelIndex &index) const |
QAbstractItemDelegate * | itemDelegate () const |
QAbstractItemDelegate * | itemDelegateForColumn (int column) const |
QAbstractItemDelegate * | itemDelegateForRow (int row) const |
QWidget * | itemWidget (QListWidgetItem *item) const |
virtual void | keyboardSearch (const QString &search) |
void | killTimer (int id) |
QLayout * | layout () const |
Qt::LayoutDirection | layoutDirection () const |
LayoutMode | layoutMode () const |
int | lineWidth () const |
QLocale | locale () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
QPoint | mapFrom (QWidget *, const QPoint &) const |
QPoint | mapFromGlobal (const QPoint &) const |
QPoint | mapFromParent (const QPoint &) const |
QPoint | mapTo (QWidget *, const QPoint &) const |
QPoint | mapToGlobal (const QPoint &) const |
QPoint | mapToParent (const QPoint &) const |
QRegion | mask () const |
int | maximumHeight () const |
QSize | maximumSize () const |
QSize | maximumViewportSize () const |
int | maximumWidth () const |
int | midLineWidth () const |
int | minimumHeight () const |
QSize | minimumSize () const |
QSize | minimumSizeHint () const |
int | minimumWidth () const |
QAbstractItemModel * | model () const |
int | modelColumn () const |
void | move (const QPoint &) |
void | move (int x, int y) |
Movement | movement () const |
void | moveToThread (QThread *thread) |
QWidget * | nextInFocusChain () const |
QRect | normalGeometry () const |
int | numColors () const |
QString | objectName () const |
void | openPersistentEditor (const QModelIndex &index) |
void | openPersistentEditor (QListWidgetItem *item) |
void | overrideWindowFlags (Qt::WindowFlags type) |
void | overrideWindowState (Qt::WindowStates state) |
QPaintEngine * | paintEngine () const |
bool | paintingActive () const |
const QPalette & | palette () const |
QObject * | parent () const |
QWidget * | parentWidget () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
QPoint | pos () const |
QVariant | property (const char *name) const |
QListWidget (QWidget *parent=0) | |
QRect | rect () const |
void | releaseKeyboard () |
void | releaseMouse () |
void | releaseShortcut (int id) |
void | removeAction (QAction *action) |
void | removeEventFilter (QObject *) |
void | removeItemWidget (QListWidgetItem *item) |
void | render (QPaintDevice *target, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren)) |
void | repaint (const QRegion &) |
void | repaint (const QRect &) |
void | repaint (int x, int y, int w, int h) |
void | reset () |
void | resize (const QSize &) |
void | resize (int w, int h) |
ResizeMode | resizeMode () const |
bool | restoreGeometry (const QByteArray &geometry) |
QModelIndex | rootIndex () const |
int | row (const QListWidgetItem *item) const |
QByteArray | saveGeometry () const |
void | scroll (int dx, int dy, const QRect &) |
void | scroll (int dx, int dy) |
QWidgetList | scrollBarWidgets (Qt::Alignment alignment) |
void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) |
QList< QListWidgetItem * > | selectedItems () const |
QAbstractItemView::SelectionBehavior | selectionBehavior () const |
QAbstractItemView::SelectionMode | selectionMode () const |
QItemSelectionModel * | selectionModel () const |
void | setAcceptDrops (bool on) |
void | setAccessibleDescription (const QString &description) |
void | setAccessibleName (const QString &name) |
void | setAlternatingRowColors (bool enable) |
void | setAttribute (Qt::WidgetAttribute, bool on=true) |
void | setAutoFillBackground (bool enabled) |
void | setAutoScroll (bool enable) |
void | setBackgroundRole (QPalette::ColorRole) |
void | setBaseSize (int basew, int baseh) |
void | setBaseSize (const QSize &) |
void | setBatchSize (int batchSize) |
void | setContentsMargins (int left, int top, int right, int bottom) |
void | setContextMenuPolicy (Qt::ContextMenuPolicy policy) |
void | setCornerWidget (QWidget *widget) |
void | setCurrentItem (QListWidgetItem *item) |
void | setCurrentRow (int row) |
void | setCursor (const QCursor &) |
void | setDragDropMode (DragDropMode behavior) |
void | setDragDropOverwriteMode (bool overwrite) |
void | setDragEnabled (bool enable) |
void | setDropIndicatorShown (bool enable) |
void | setEditTriggers (EditTriggers triggers) |
void | setFixedHeight (int h) |
void | setFixedSize (int w, int h) |
void | setFixedSize (const QSize &) |
void | setFixedWidth (int w) |
void | setFlow (Flow flow) |
void | setFocus (Qt::FocusReason reason) |
void | setFocusPolicy (Qt::FocusPolicy policy) |
void | setFocusProxy (QWidget *) |
void | setFont (const QFont &) |
void | setForegroundRole (QPalette::ColorRole) |
void | setFrameRect (const QRect &) |
void | setFrameShadow (Shadow) |
void | setFrameShape (Shape) |
void | setFrameStyle (int) |
void | setGeometry (const QRect &) |
void | setGeometry (int x, int y, int w, int h) |
void | setGridSize (const QSize &size) |
void | setHorizontalScrollBar (QScrollBar *scrollbar) |
void | setHorizontalScrollBarPolicy (Qt::ScrollBarPolicy) |
void | setHorizontalScrollMode (ScrollMode mode) |
void | setIconSize (const QSize &size) |
void | setIndexWidget (const QModelIndex &index, QWidget *widget) |
void | setInputContext (QInputContext *) |
void | setItemDelegate (QAbstractItemDelegate *delegate) |
void | setItemDelegateForColumn (int column, QAbstractItemDelegate *delegate) |
void | setItemDelegateForRow (int row, QAbstractItemDelegate *delegate) |
void | setItemHidden (const QListWidgetItem *item, bool hide) |
void | setItemSelected (const QListWidgetItem *item, bool select) |
void | setItemWidget (QListWidgetItem *item, QWidget *widget) |
void | setLayout (QLayout *) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setLayoutMode (LayoutMode mode) |
void | setLineWidth (int) |
void | setLocale (const QLocale &locale) |
void | setMask (const QRegion &) |
void | setMask (const QBitmap &) |
void | setMaximumHeight (int maxh) |
void | setMaximumSize (int maxw, int maxh) |
void | setMaximumSize (const QSize &) |
void | setMaximumWidth (int maxw) |
void | setMidLineWidth (int) |
void | setMinimumHeight (int minh) |
void | setMinimumSize (int minw, int minh) |
void | setMinimumSize (const QSize &) |
void | setMinimumWidth (int minw) |
void | setModelColumn (int column) |
void | setMouseTracking (bool enable) |
void | setMovement (Movement movement) |
void | setObjectName (const QString &name) |
void | setPalette (const QPalette &) |
void | setParent (QObject *) |
void | setParent (QWidget *parent, Qt::WindowFlags f) |
void | setParent (QWidget *parent) |
bool | setProperty (const char *name, const QVariant &value) |
void | setResizeMode (ResizeMode mode) |
void | setRootIndex (const QModelIndex &index) |
void | setRowHidden (int row, bool hide) |
void | setSelectionBehavior (QAbstractItemView::SelectionBehavior behavior) |
void | setSelectionMode (QAbstractItemView::SelectionMode mode) |
virtual void | setSelectionModel (QItemSelectionModel *selectionModel) |
void | setSelectionRectVisible (bool show) |
void | setShortcutAutoRepeat (int id, bool enable=true) |
void | setShortcutEnabled (int id, bool enable=true) |
void | setSizeIncrement (int w, int h) |
void | setSizeIncrement (const QSize &) |
void | setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) |
void | setSizePolicy (QSizePolicy) |
void | setSortingEnabled (bool enable) |
void | setSpacing (int space) |
void | setStatusTip (const QString &) |
void | setStyle (QStyle *) |
void | setTabKeyNavigation (bool enable) |
void | setTextElideMode (Qt::TextElideMode mode) |
void | setToolTip (const QString &) |
void | setUniformItemSizes (bool enable) |
void | setUpdatesEnabled (bool enable) |
void | setUserData (uint id, QObjectUserData *data) |
void | setVerticalScrollBar (QScrollBar *scrollbar) |
void | setVerticalScrollBarPolicy (Qt::ScrollBarPolicy) |
void | setVerticalScrollMode (ScrollMode mode) |
void | setViewMode (ViewMode mode) |
void | setViewport (QWidget *widget) |
void | setWhatsThis (const QString &) |
void | setWindowFlags (Qt::WindowFlags type) |
void | setWindowIcon (const QIcon &icon) |
void | setWindowIconText (const QString &) |
void | setWindowModality (Qt::WindowModality windowModality) |
void | setWindowOpacity (qreal level) |
void | setWindowRole (const QString &) |
void | setWindowState (Qt::WindowStates state) |
void | setWindowSurface (QWindowSurface *surface) |
void | setWordWrap (bool on) |
void | setWrapping (bool enable) |
bool | showDropIndicator () const |
bool | signalsBlocked () const |
QSize | size () const |
QSize | sizeHint () const |
virtual int | sizeHintForColumn (int column) const |
QSize | sizeHintForIndex (const QModelIndex &index) const |
virtual int | sizeHintForRow (int row) const |
QSize | sizeIncrement () const |
QSizePolicy | sizePolicy () const |
void | sortItems (Qt::SortOrder order=Qt::AscendingOrder) |
int | spacing () const |
void | stackUnder (QWidget *) |
int | startTimer (int interval) |
QString | statusTip () const |
QStyle * | style () const |
QString | styleSheet () const |
bool | tabKeyNavigation () const |
QListWidgetItem * | takeItem (int row) |
bool | testAttribute (Qt::WidgetAttribute) const |
Qt::TextElideMode | textElideMode () const |
QThread * | thread () const |
QString | toolTip () const |
QWidget * | topLevelWidget () const |
bool | underMouse () const |
bool | uniformItemSizes () const |
void | unsetCursor () |
void | unsetLayoutDirection () |
void | unsetLocale () |
void | update (const QRegion &) |
void | update (const QRect &) |
void | update (int x, int y, int w, int h) |
void | updateGeometry () |
bool | updatesEnabled () const |
QObjectUserData * | userData (uint id) const |
QScrollBar * | verticalScrollBar () const |
Qt::ScrollBarPolicy | verticalScrollBarPolicy () const |
ScrollMode | verticalScrollMode () const |
ViewMode | viewMode () const |
QWidget * | viewport () const |
QRegion | visibleRegion () const |
QRect | visualItemRect (const QListWidgetItem *item) const |
QRect | visualRect (const QModelIndex &index) const |
QString | whatsThis () const |
int | width () const |
int | widthMM () const |
QWidget * | window () const |
Qt::WindowFlags | windowFlags () const |
QIcon | windowIcon () const |
QString | windowIconText () const |
Qt::WindowModality | windowModality () const |
qreal | windowOpacity () const |
QString | windowRole () const |
Qt::WindowStates | windowState () const |
QWindowSurface * | windowSurface () const |
QString | windowTitle () const |
Qt::WindowType | windowType () const |
WId | winId () const |
bool | wordWrap () const |
int | x () const |
int | y () const |
~QListWidget () | |
Static Public Member Functions | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
static QWidget * | find (WId) |
static QWidget * | keyboardGrabber () |
static QWidget * | mouseGrabber () |
static uint | registerUserData () |
static void | setTabOrder (QWidget *, QWidget *) |
Protected Types | |
enum | CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, MoveHome, MoveEnd, MovePageUp, MovePageDown, MoveNext, MovePrevious } |
enum | DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport } |
enum | State { NoState, DraggingState, DragSelectingState, EditingState, ExpandingState, CollapsingState, AnimatingState } |
Protected Slots | |
virtual void | closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint) |
virtual void | commitData (QWidget *editor) |
virtual void | editorDestroyed (QObject *editor) |
virtual void | horizontalScrollbarAction (int action) |
virtual void | horizontalScrollbarValueChanged (int value) |
void | setupViewport (QWidget *viewport) |
virtual void | updateEditorData () |
virtual void | updateEditorGeometries () |
void | updateMicroFocus () |
virtual void | verticalScrollbarAction (int action) |
virtual void | verticalScrollbarValueChanged (int value) |
Protected Member Functions | |
virtual void | actionEvent (QActionEvent *) |
void | changeEvent (QEvent *) |
virtual void | childEvent (QChildEvent *) |
virtual void | closeEvent (QCloseEvent *) |
virtual void | connectNotify (const char *signal) |
QSize | contentsSize () const |
void | contextMenuEvent (QContextMenuEvent *) |
void | create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true) |
void | currentChanged (const QModelIndex ¤t, const QModelIndex &previous) |
virtual void | customEvent (QEvent *) |
void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
void | destroy (bool destroyWindow=true, bool destroySubWindows=true) |
QPoint | dirtyRegionOffset () const |
virtual void | disconnectNotify (const char *signal) |
void | doAutoScroll () |
void | dragEnterEvent (QDragEnterEvent *event) |
void | dragLeaveEvent (QDragLeaveEvent *e) |
void | dragMoveEvent (QDragMoveEvent *e) |
void | drawFrame (QPainter *) |
DropIndicatorPosition | dropIndicatorPosition () const |
virtual bool | dropMimeData (int index, const QMimeData *data, Qt::DropAction action) |
virtual bool | edit (const QModelIndex &index, EditTrigger trigger, QEvent *event) |
virtual void | enabledChange (bool) |
virtual void | enterEvent (QEvent *) |
bool | event (QEvent *e) |
void | executeDelayedItemsLayout () |
void | focusInEvent (QFocusEvent *event) |
bool | focusNextChild () |
bool | focusNextPrevChild (bool next) |
void | focusOutEvent (QFocusEvent *event) |
bool | focusPreviousChild () |
virtual void | fontChange (const QFont &) |
virtual void | hideEvent (QHideEvent *) |
int | horizontalOffset () const |
int | horizontalStepsPerItem () const |
QModelIndex | indexFromItem (QListWidgetItem *item) const |
void | inputMethodEvent (QInputMethodEvent *event) |
void | internalDrag (Qt::DropActions supportedActions) |
void | internalDrop (QDropEvent *e) |
bool | isIndexHidden (const QModelIndex &index) const |
QListWidgetItem * | itemFromIndex (const QModelIndex &index) const |
QList< QListWidgetItem * > | items (const QMimeData *data) const |
void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *) |
virtual void | languageChange () |
virtual void | leaveEvent (QEvent *) |
int | metric (PaintDeviceMetric) const |
virtual QMimeData * | mimeData (const QList< QListWidgetItem * > items) const |
virtual QStringList | mimeTypes () const |
void | mouseDoubleClickEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *e) |
void | mousePressEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *e) |
QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
virtual void | moveEvent (QMoveEvent *) |
void | paintEvent (QPaintEvent *e) |
virtual void | paletteChange (const QPalette &) |
int | receivers (const char *signal) const |
QRect | rectForIndex (const QModelIndex &index) const |
void | resetInputContext () |
void | resizeContents (int width, int height) |
void | resizeEvent (QResizeEvent *e) |
void | rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
void | rowsInserted (const QModelIndex &parent, int start, int end) |
void | scheduleDelayedItemsLayout () |
void | scrollContentsBy (int dx, int dy) |
void | scrollDirtyRegion (int dx, int dy) |
QModelIndexList | selectedIndexes () const |
void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) |
virtual QItemSelectionModel::SelectionFlags | selectionCommand (const QModelIndex &index, const QEvent *event=0) const |
QObject * | sender () const |
void | setDirtyRegion (const QRegion ®ion) |
void | setHorizontalStepsPerItem (int steps) |
void | setPositionForIndex (const QPoint &position, const QModelIndex &index) |
void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) |
void | setState (State state) |
void | setVerticalStepsPerItem (int steps) |
void | setViewportMargins (int left, int top, int right, int bottom) |
virtual void | showEvent (QShowEvent *) |
void | startAutoScroll () |
void | startDrag (Qt::DropActions supportedActions) |
State | state () const |
void | stopAutoScroll () |
virtual void | styleChange (QStyle &) |
virtual Qt::DropActions | supportedDropActions () const |
virtual void | tabletEvent (QTabletEvent *) |
void | timerEvent (QTimerEvent *e) |
void | updateGeometries () |
int | verticalOffset () const |
int | verticalStepsPerItem () const |
QStyleOptionViewItem | viewOptions () const |
bool | viewportEvent (QEvent *event) |
QRegion | visualRegionForSelection (const QItemSelection &selection) const |
void | wheelEvent (QWheelEvent *) |
virtual void | windowActivationChange (bool) |
Protected Attributes | |
QObjectData * | d_ptr |
ushort | painters |
Static Protected Attributes | |
static const QMetaObject | staticQtMetaObject |
Properties | |
bool | acceptDrops |
whether drop events are enabled for this widget | |
QString | accessibleDescription |
the widget's description as seen by assistive technologies | |
QString | accessibleName |
the widget's name as seen by assistive technologies | |
bool | alternatingRowColors |
whether to draw the background using alternating colors | |
bool | autoFillBackground |
whether the widget background is filled automatically | |
bool | autoScroll |
whether autoscrolling in drag move events is enabled | |
QSize | baseSize |
the base size of the widget | |
int | batchSize |
the number of items laid out in each batch if layoutMode is set to Batched | |
QRect | childrenRect |
the bounding rectangle of the widget's children | |
QRegion | childrenRegion |
the combined region occupied by the widget's children | |
Qt::ContextMenuPolicy | contextMenuPolicy |
how the widget shows a context menu | |
int | count |
the number of items in the list including any hidden items. | |
int | currentRow |
the row of the current item. | |
QCursor | cursor |
the cursor shape for this widget | |
DragDropMode | dragDropMode |
the drag and drop event the view will act upon | |
bool | dragDropOverwriteMode |
the view's drag and drop behavior | |
bool | dragEnabled |
whether the view supports dragging of its own items | |
EditTriggers | editTriggers |
which actions will initiate item editing | |
bool | enabled |
whether the widget is enabled | |
Flow | flow |
which direction the items layout should flow. | |
bool | focus |
whether this widget (or its focus proxy) has the keyboard input focus | |
Qt::FocusPolicy | focusPolicy |
the way the widget accepts keyboard focus | |
QFont | font |
the font currently set for the widget | |
QRect | frameGeometry |
geometry of the widget relative to its parent including any window frame | |
QRect | frameRect |
the frame's rectangle | |
Shadow | frameShadow |
the frame shadow value from the frame style | |
Shape | frameShape |
the frame shape value from the frame style | |
QSize | frameSize |
the size of the widget including any window frame | |
int | frameWidth |
the width of the frame that is drawn. | |
bool | fullScreen |
whether the widget is full screen | |
QRect | geometry |
the geometry of the widget relative to its parent and excluding the window frame | |
QSize | gridSize |
the size of the layout grid | |
int | height |
the height of the widget excluding any window frame | |
Qt::ScrollBarPolicy | horizontalScrollBarPolicy |
the policy for the horizontal scroll bar | |
ScrollMode | horizontalScrollMode |
how the view scrolls its contents in the horizontal direction | |
QSize | iconSize |
the size of items | |
bool | isActiveWindow |
whether this widget's window is the active window | |
bool | isWrapping |
whether the items layout should wrap. | |
Qt::LayoutDirection | layoutDirection |
the layout direction for this widget | |
LayoutMode | layoutMode |
whether the layout of items should happen immediately or be delayed. | |
int | lineWidth |
the line width | |
QLocale | locale |
the widget's locale | |
bool | maximized |
whether this widget is maximized | |
int | maximumHeight |
the widget's maximum height | |
QSize | maximumSize |
the widget's maximum size | |
int | maximumWidth |
the widget's maximum width | |
int | midLineWidth |
the width of the mid-line | |
bool | minimized |
whether this widget is minimized (iconified) | |
int | minimumHeight |
the widget's minimum height | |
QSize | minimumSize |
the widget's minimum size | |
QSize | minimumSizeHint |
the recommended minimum size for the widget | |
int | minimumWidth |
the widget's minimum width | |
bool | modal |
whether the widget is a modal widget | |
int | modelColumn |
the column in the model that is visible | |
bool | mouseTracking |
whether mouse tracking is enabled for the widget | |
Movement | movement |
whether the items can be moved freely, are snapped to a grid, or cannot be moved at all. | |
QRect | normalGeometry |
the geometry of the widget as it will appear when shown as a normal (not maximized or fullscreen) toplevel widget | |
QString | objectName |
the name of this object | |
QPalette | palette |
the widget's palette | |
QPoint | pos |
the position of the widget within its parent widget | |
QRect | rect |
the internal geometry of the widget excluding any window frame | |
ResizeMode | resizeMode |
whether the items are laid out again when the view is resized. | |
SelectionBehavior | selectionBehavior |
which selection behavior the view uses | |
SelectionMode | selectionMode |
which selection mode the view operates in | |
bool | selectionRectVisible |
if the selection rectangle should be visible | |
bool | showDropIndicator |
whether the drop indicator is shown when dragging items and dropping. | |
QSize | size |
the size of the widget excluding any window frame | |
QSize | sizeHint |
the recommended size for the widget | |
QSize | sizeIncrement |
the size increment of the widget | |
QSizePolicy | sizePolicy |
the default layout behavior of the widget | |
bool | sortingEnabled |
whether sorting is enabled | |
int | spacing |
the space between items in the layout | |
QString | statusTip |
the widget's status tip | |
QString | styleSheet |
the widget's style sheet | |
bool | tabKeyNavigation |
whether item navigation with tab and backtab is enabled. | |
Qt::TextElideMode | textElideMode |
the the position of the "..." in elided text. | |
QString | toolTip |
the widget's tooltip | |
bool | uniformItemSizes |
whether all items in the listview have the same size | |
bool | updatesEnabled |
whether updates are enabled | |
Qt::ScrollBarPolicy | verticalScrollBarPolicy |
the policy for the vertical scroll bar | |
ScrollMode | verticalScrollMode |
how the view scrolls its contents in the vertical direction | |
ViewMode | viewMode |
the view mode of the QListView. | |
bool | visible |
whether the widget is visible | |
QString | whatsThis |
the widget's What's This help text. | |
int | width |
the width of the widget excluding any window frame | |
QIcon | windowIcon |
the widget's icon | |
QString | windowIconText |
the widget's icon text | |
Qt::WindowModality | windowModality |
which windows are blocked by the modal widget | |
bool | windowModified |
whether the document shown in the window has unsaved changes | |
double | windowOpacity |
The level of opacity for the window. | |
QString | windowTitle |
the window title (caption) | |
bool | wordWrap |
the item text word-wrapping policy | |
int | x |
the x coordinate of the widget relative to its parent including any window frame | |
int | y |
the y coordinate of the widget relative to its parent and including any window frame | |
Private Member Functions | |
void void void void void void | _q_emitCurrentItemChanged (const QModelIndex &previous, const QModelIndex ¤t)) Q_PRIVATE_SLOT(d_func() |
void void void | _q_emitItemActivated (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() |
void void void void void | _q_emitItemChanged (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() |
void | _q_emitItemClicked (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() |
void void | _q_emitItemDoubleClicked (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() |
void void void void | _q_emitItemEntered (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() |
void void void void void void void | _q_sort ()) Q_PRIVATE_SLOT(d_func() |
Q_PRIVATE_SLOT (d_func(), void _q_emitItemPressed(const QModelIndex &index)) Q_PRIVATE_SLOT(d_func() | |
void | setModel (QAbstractItemModel *model) |
Qt::SortOrder | sortOrder () const |
Friends | |
class | QCoreApplication |
class | QCoreApplicationPrivate |
class | QListModel |
class | QListWidgetItem |
struct | QMetaObject |
class | QThreadData |
class | QWidget |
Related Functions | |
(Note that these are not member functions.) | |
T | qFindChild (const QObject *obj, const QString &name=QString(), T dummy=0) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
const Q_GUI_EXPORT QX11Info * | qt_x11Info (const QPaintDevice *pd) |
QWidgetList | |
WId |