Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3424

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qlistwidget.cpp -->
  <title>QListWidget Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QListWidget</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QListWidget Class</h1>
<!-- $$$QListWidget-brief -->
<p>The <a href="qlistwidget.html">QListWidget</a> class provides an item-based list widget. <a href="#details">More...</a></p>
<!-- @@@QListWidget -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QListWidget&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qlistview.html">QListView</a></td></tr></table></div><ul>
<li><a href="qlistwidget-members.html">List of all members, including inherited members</a></li>
<li><a href="qlistwidget-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qlistwidget.html#count-prop">count</a></b> : const int</li>
<li class="fn"><b><a href="qlistwidget.html#currentRow-prop">currentRow</a></b> : int</li>
<li class="fn"><b><a href="qlistwidget.html#sortingEnabled-prop">sortingEnabled</a></b> : bool</li>
</ul>
<ul>
<li class="fn">13 properties inherited from <a href="qlistview.html#properties">QListView</a></li>
<li class="fn">16 properties inherited from <a href="qabstractitemview.html#properties">QAbstractItemView</a></li>
<li class="fn">3 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#QListWidget">QListWidget</a></b>(QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#dtor.QListWidget">~QListWidget</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#addItem">addItem</a></b>(const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#addItem-1">addItem</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#addItems">addItems</a></b>(const QStringList &amp;<i>labels</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#count-prop">count</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentItem">currentItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentRow-prop">currentRow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#editItem">editItem</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QListWidgetItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#findItems">findItems</a></b>(const QString &amp;<i>text</i>, Qt::MatchFlags <i>flags</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#insertItem">insertItem</a></b>(int <i>row</i>, QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#insertItem-1">insertItem</a></b>(int <i>row</i>, const QString &amp;<i>label</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#insertItems">insertItems</a></b>(int <i>row</i>, const QStringList &amp;<i>labels</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#sortingEnabled-prop">isSortingEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#item">item</a></b>(int <i>row</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemAt">itemAt</a></b>(const QPoint &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemAt-1">itemAt</a></b>(int <i>x</i>, int <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemWidget">itemWidget</a></b>(QListWidgetItem *<i>item</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#removeItemWidget">removeItemWidget</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#row">row</a></b>(const QListWidgetItem *<i>item</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QListWidgetItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#selectedItems">selectedItems</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#setCurrentItem">setCurrentItem</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#setCurrentItem-1">setCurrentItem</a></b>(QListWidgetItem *<i>item</i>, QItemSelectionModel::SelectionFlags <i>command</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentRow-prop">setCurrentRow</a></b>(int <i>row</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#setCurrentRow-1">setCurrentRow</a></b>(int <i>row</i>, QItemSelectionModel::SelectionFlags <i>command</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#setItemWidget">setItemWidget</a></b>(QListWidgetItem *<i>item</i>, QWidget *<i>widget</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#sortingEnabled-prop">setSortingEnabled</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#sortItems">sortItems</a></b>(Qt::SortOrder <i>order</i> = Qt::AscendingOrder)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#takeItem">takeItem</a></b>(int <i>row</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#visualItemRect">visualItemRect</a></b>(const QListWidgetItem *<i>item</i>) const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#dropEvent">dropEvent</a></b>(QDropEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#setSelectionModel">setSelectionModel</a></b>(QItemSelectionModel *<i>selectionModel</i>)</td></tr>
</table></div>
<ul>
<li class="fn">32 public functions inherited from <a href="qlistview.html#public-functions">QListView</a></li>
<li class="fn">59 public functions inherited from <a href="qabstractitemview.html#public-functions">QAbstractItemView</a></li>
<li class="fn">20 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#scrollToItem">scrollToItem</a></b>(const QListWidgetItem *<i>item</i>, QAbstractItemView::ScrollHint <i>hint</i> = EnsureVisible)</td></tr>
</table></div>
<ul>
<li class="fn">9 public slots inherited from <a href="qabstractitemview.html#public-slots">QAbstractItemView</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentItemChanged">currentItemChanged</a></b>(QListWidgetItem *<i>current</i>, QListWidgetItem *<i>previous</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentRowChanged">currentRowChanged</a></b>(int <i>currentRow</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#currentTextChanged">currentTextChanged</a></b>(const QString &amp;<i>currentText</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemActivated">itemActivated</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemChanged">itemChanged</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemClicked">itemClicked</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemDoubleClicked">itemDoubleClicked</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemEntered">itemEntered</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemPressed">itemPressed</a></b>(QListWidgetItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemSelectionChanged">itemSelectionChanged</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">1 signal inherited from <a href="qlistview.html#signals">QListView</a></li>
<li class="fn">7 signals inherited from <a href="qabstractitemview.html#signals">QAbstractItemView</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#dropMimeData">dropMimeData</a></b>(int <i>index</i>, const QMimeData *<i>data</i>, Qt::DropAction <i>action</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#indexFromItem">indexFromItem</a></b>(QListWidgetItem *<i>item</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QListWidgetItem *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#itemFromIndex">itemFromIndex</a></b>(const QModelIndex &amp;<i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QListWidgetItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#items">items</a></b>(const QMimeData *<i>data</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMimeData *</td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#mimeData">mimeData</a></b>(const QList&lt;QListWidgetItem *&gt; <i>items</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#mimeTypes">mimeTypes</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::DropActions </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#supportedDropActions">supportedDropActions</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qlistwidget.html#event">event</a></b>(QEvent *<i>e</i>)</td></tr>
</table></div>
<ul>
<li class="fn">28 protected functions inherited from <a href="qlistview.html#protected-functions">QListView</a></li>
<li class="fn">37 protected functions inherited from <a href="qabstractitemview.html#protected-functions">QAbstractItemView</a></li>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected slots inherited from <a href="qabstractitemview.html#protected-slots">QAbstractItemView</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
<li class="fn">1 protected type inherited from <a href="../qtgui/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QListWidget-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qlistwidget.html">QListWidget</a> class provides an item-based list widget.</p>
<p class="centerAlign"><img src="images/windows-listview.png" alt="" /></p><p><a href="qlistwidget.html">QListWidget</a> is a convenience class that provides a list view similar to the one supplied by <a href="qlistview.html">QListView</a>, but with a classic item-based interface for adding and removing items. <a href="qlistwidget.html">QListWidget</a> uses an internal model to manage each <a href="qlistwidgetitem.html">QListWidgetItem</a> in the list.</p>
<p>For a more flexible list view widget, use the <a href="qlistview.html">QListView</a> class with a standard model.</p>
<p>List widgets are constructed in the same way as other widgets:</p>
<pre class="cpp">

      QListWidget *listWidget = new QListWidget(this);

</pre>
<p>The <a href="qabstractitemview.html#selectionMode-prop">selectionMode</a>() 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 <a href="qabstractitemview.html#selectionMode-prop">setSelectionMode</a>() function.</p>
<p>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:</p>
<pre class="cpp">

      <span class="keyword">new</span> <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span>(tr(<span class="string">&quot;Oak&quot;</span>)<span class="operator">,</span> listWidget);
      <span class="keyword">new</span> <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span>(tr(<span class="string">&quot;Fir&quot;</span>)<span class="operator">,</span> listWidget);
      <span class="keyword">new</span> <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span>(tr(<span class="string">&quot;Pine&quot;</span>)<span class="operator">,</span> listWidget);

</pre>
<p>If you need to insert a new item into the list at a particular position, then it should be constructed without a parent widget. The <a href="qlistwidget.html#insertItem">insertItem</a>() function should then be used to place it within the list. The list widget will take ownership of the item.</p>
<pre class="cpp">

      <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> <span class="operator">*</span>newItem <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span>;
      newItem<span class="operator">-</span><span class="operator">&gt;</span>setText(itemText);
      listWidget<span class="operator">-</span><span class="operator">&gt;</span>insertItem(row<span class="operator">,</span> newItem);

</pre>
<p>For multiple items, <a href="qlistwidget.html#insertItems">insertItems</a>() can be used instead. The number of items in the list is found with the <a href="qlistwidget.html#count-prop">count</a>() function. To remove items from the list, use <a href="qlistwidget.html#takeItem">takeItem</a>().</p>
<p>The current item in the list can be found with <a href="qlistwidget.html#currentItem">currentItem</a>(), and changed with <a href="qlistwidget.html#setCurrentItem">setCurrentItem</a>(). 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 <a href="qlistwidget.html#currentItemChanged">currentItemChanged</a>() signal is emitted with the new current item and the item that was previously current.</p>
</div>
<p><b>See also </b><a href="qlistwidgetitem.html">QListWidgetItem</a>, <a href="qlistview.html">QListView</a>, <a href="qtreeview.html">QTreeView</a>, <a href="model-view-programming.html">Model/View Programming</a>, and <a href="qtwidgets-dialogs-configdialog-example.html">Config Dialog Example</a>.</p>
<!-- @@@QListWidget -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$count-prop$$$count -->
<h3 class="fn" id="count-prop"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3>
<p>This property holds the number of items in the list including any hidden items.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>count</b></span>() const</td></tr>
</table></div>
<!-- @@@count -->
<!-- $$$currentRow-prop$$$currentRow$$$setCurrentRowint$$$setCurrentRowintQItemSelectionModel::SelectionFlags$$$currentRowChangedint -->
<h3 class="fn" id="currentRow-prop"><a name="currentRow-prop"></a><span class="name">currentRow</span> : <span class="type">int</span></h3>
<p>This property holds the row of the current item.</p>
<p>Depending on the current selection mode, the row may also be selected.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>currentRow</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentRow</b></span>(int <i>row</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qlistwidget.html#setCurrentRow-1">setCurrentRow</a></b></span>(int <i>row</i>, QItemSelectionModel::SelectionFlags <i>command</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qlistwidget.html#currentRowChanged">currentRowChanged</a></b></span>(int <i>currentRow</i>)</td></tr>
</table></div>
<!-- @@@currentRow -->
<!-- $$$sortingEnabled-prop$$$isSortingEnabled$$$setSortingEnabledbool -->
<h3 class="fn" id="sortingEnabled-prop"><a name="sortingEnabled-prop"></a><span class="name">sortingEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether sorting is enabled</p>
<p>If this property is <code>true</code>, sorting is enabled for the list; if the property is false, sorting is not enabled.</p>
<p>The default value is false.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isSortingEnabled</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSortingEnabled</b></span>(bool <i>enable</i>)</td></tr>
</table></div>
<!-- @@@sortingEnabled -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QListWidget[overload1]$$$QListWidgetQWidget* -->
<h3 class="fn" id="QListWidget"><a name="QListWidget"></a>QListWidget::<span class="name">QListWidget</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs an empty <a href="qlistwidget.html">QListWidget</a> with the given <i>parent</i>.</p>
<!-- @@@QListWidget -->
<!-- $$$~QListWidget[overload1]$$$~QListWidget -->
<h3 class="fn" id="dtor.QListWidget"><a name="dtor.QListWidget"></a>QListWidget::<span class="name">~QListWidget</span>()</h3>
<p>Destroys the list widget and all its items.</p>
<!-- @@@~QListWidget -->
<!-- $$$addItem[overload1]$$$addItemconstQString& -->
<h3 class="fn" id="addItem"><a name="addItem"></a><span class="type">void</span> QListWidget::<span class="name">addItem</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<p>Inserts an item with the text <i>label</i> at the end of the list widget.</p>
<!-- @@@addItem -->
<!-- $$$addItem$$$addItemQListWidgetItem* -->
<h3 class="fn" id="addItem-1"><a name="addItem-1"></a><span class="type">void</span> QListWidget::<span class="name">addItem</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Inserts the <i>item</i> at the end of the list widget.</p>
<p><b>Warning:</b> A <a href="qlistwidgetitem.html">QListWidgetItem</a> can only be added to a <a href="qlistwidget.html">QListWidget</a> once. Adding the same <a href="qlistwidgetitem.html">QListWidgetItem</a> multiple times to a <a href="qlistwidget.html">QListWidget</a> will result in undefined behavior.</p>
<p><b>See also </b><a href="qlistwidget.html#insertItem">insertItem</a>().</p>
<!-- @@@addItem -->
<!-- $$$addItems[overload1]$$$addItemsconstQStringList& -->
<h3 class="fn" id="addItems"><a name="addItems"></a><span class="type">void</span> QListWidget::<span class="name">addItems</span>(const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>labels</i>)</h3>
<p>Inserts items with the text <i>labels</i> at the end of the list widget.</p>
<p><b>See also </b><a href="qlistwidget.html#insertItems">insertItems</a>().</p>
<!-- @@@addItems -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><code>[slot] </code><span class="type">void</span> QListWidget::<span class="name">clear</span>()</h3>
<p>Removes all items and selections in the view.</p>
<p><b>Warning:</b> All items will be permanently deleted.</p>
<!-- @@@clear -->
<!-- $$$closePersistentEditor[overload1]$$$closePersistentEditorQListWidgetItem* -->
<h3 class="fn" id="closePersistentEditor"><a name="closePersistentEditor"></a><span class="type">void</span> QListWidget::<span class="name">closePersistentEditor</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Closes the persistent editor for the given <i>item</i>.</p>
<p><b>See also </b><a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a>().</p>
<!-- @@@closePersistentEditor -->
<!-- $$$currentItem[overload1]$$$currentItem -->
<h3 class="fn" id="currentItem"><a name="currentItem"></a><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">currentItem</span>() const</h3>
<p>Returns the current item.</p>
<p><b>See also </b><a href="qlistwidget.html#setCurrentItem">setCurrentItem</a>().</p>
<!-- @@@currentItem -->
<!-- $$$currentItemChanged[overload1]$$$currentItemChangedQListWidgetItem*QListWidgetItem* -->
<h3 class="fn" id="currentItemChanged"><a name="currentItemChanged"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">currentItemChanged</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>current</i>, <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>previous</i>)</h3>
<p>This signal is emitted whenever the current item changes.</p>
<p><i>previous</i> is the item that previously had the focus; <i>current</i> is the new current item.</p>
<!-- @@@currentItemChanged -->
<!-- $$$currentRowChanged -->
<h3 class="fn" id="currentRowChanged"><a name="currentRowChanged"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">currentRowChanged</span>(<span class="type">int</span> <i>currentRow</i>)</h3>
<p>This signal is emitted whenever the current item changes.</p>
<p><i>currentRow</i> is the row of the current item. If there is no current item, the <i>currentRow</i> is -1.</p>
<p><b>Note:</b> Notifier signal for property <a href="qlistwidget.html#currentRow-prop">currentRow</a>. </p><!-- @@@currentRowChanged -->
<!-- $$$currentTextChanged[overload1]$$$currentTextChangedconstQString& -->
<h3 class="fn" id="currentTextChanged"><a name="currentTextChanged"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">currentTextChanged</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>currentText</i>)</h3>
<p>This signal is emitted whenever the current item changes.</p>
<p><i>currentText</i> is the text data in the current item. If there is no current item, the <i>currentText</i> is invalid.</p>
<!-- @@@currentTextChanged -->
<!-- $$$dropEvent[overload1]$$$dropEventQDropEvent* -->
<h3 class="fn" id="dropEvent"><a name="dropEvent"></a><code>[virtual] </code><span class="type">void</span> QListWidget::<span class="name">dropEvent</span>(<span class="type"><a href="../qtgui/qdropevent.html">QDropEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget::dropEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$dropMimeData[overload1]$$$dropMimeDataintconstQMimeData*Qt::DropAction -->
<h3 class="fn" id="dropMimeData"><a name="dropMimeData"></a><code>[virtual protected] </code><span class="type">bool</span> QListWidget::<span class="name">dropMimeData</span>(<span class="type">int</span> <i>index</i>, const <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *<i>data</i>, <span class="type"><a href="../qtcore/qt.html#DropAction-enum">Qt::DropAction</a></span> <i>action</i>)</h3>
<p>Handles <i>data</i> supplied by an external drag and drop operation that ended with the given <i>action</i> in the given <i>index</i>. Returns <code>true</code> if <i>data</i> and <i>action</i> can be handled by the model; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qlistwidget.html#supportedDropActions">supportedDropActions</a>().</p>
<!-- @@@dropMimeData -->
<!-- $$$editItem[overload1]$$$editItemQListWidgetItem* -->
<h3 class="fn" id="editItem"><a name="editItem"></a><span class="type">void</span> QListWidget::<span class="name">editItem</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Starts editing the <i>item</i> if it is editable.</p>
<!-- @@@editItem -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QListWidget::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$findItems[overload1]$$$findItemsconstQString&Qt::MatchFlags -->
<h3 class="fn" id="findItems"><a name="findItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *&gt; QListWidget::<span class="name">findItems</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="../qtcore/qt.html#MatchFlag-enum">Qt::MatchFlags</a></span> <i>flags</i>) const</h3>
<p>Finds items with the text that matches the string <i>text</i> using the given <i>flags</i>.</p>
<!-- @@@findItems -->
<!-- $$$indexFromItem[overload1]$$$indexFromItemQListWidgetItem* -->
<h3 class="fn" id="indexFromItem"><a name="indexFromItem"></a><code>[protected] </code><span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> QListWidget::<span class="name">indexFromItem</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>) const</h3>
<p>Returns the <a href="../qtcore/qmodelindex.html">QModelIndex</a> associated with the given <i>item</i>.</p>
<!-- @@@indexFromItem -->
<!-- $$$insertItem[overload1]$$$insertItemintQListWidgetItem* -->
<h3 class="fn" id="insertItem"><a name="insertItem"></a><span class="type">void</span> QListWidget::<span class="name">insertItem</span>(<span class="type">int</span> <i>row</i>, <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Inserts the <i>item</i> at the position in the list given by <i>row</i>.</p>
<p><b>See also </b><a href="qlistwidget.html#addItem">addItem</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertItem$$$insertItemintconstQString& -->
<h3 class="fn" id="insertItem-1"><a name="insertItem-1"></a><span class="type">void</span> QListWidget::<span class="name">insertItem</span>(<span class="type">int</span> <i>row</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>label</i>)</h3>
<p>Inserts an item with the text <i>label</i> in the list widget at the position given by <i>row</i>.</p>
<p><b>See also </b><a href="qlistwidget.html#addItem">addItem</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertItems[overload1]$$$insertItemsintconstQStringList& -->
<h3 class="fn" id="insertItems"><a name="insertItems"></a><span class="type">void</span> QListWidget::<span class="name">insertItems</span>(<span class="type">int</span> <i>row</i>, const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &amp;<i>labels</i>)</h3>
<p>Inserts items from the list of <i>labels</i> into the list, starting at the given <i>row</i>.</p>
<p><b>See also </b><a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
<!-- @@@insertItems -->
<!-- $$$item[overload1]$$$itemint -->
<h3 class="fn" id="item"><a name="item"></a><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">item</span>(<span class="type">int</span> <i>row</i>) const</h3>
<p>Returns the item that occupies the given <i>row</i> in the list if one has been set; otherwise returns 0.</p>
<p><b>See also </b><a href="qlistwidget.html#row">row</a>().</p>
<!-- @@@item -->
<!-- $$$itemActivated[overload1]$$$itemActivatedQListWidgetItem* -->
<h3 class="fn" id="itemActivated"><a name="itemActivated"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemActivated</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted when the <i>item</i> is activated. The <i>item</i> is activated when the user clicks or double clicks on it, depending on the system configuration. It is also activated when the user presses the activation key (on Windows and X11 this is the <b>Return</b> key, on Mac OS X it is <b>Command+O</b>).</p>
<!-- @@@itemActivated -->
<!-- $$$itemAt[overload1]$$$itemAtconstQPoint& -->
<h3 class="fn" id="itemAt"><a name="itemAt"></a><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">itemAt</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p</i>) const</h3>
<p>Returns a pointer to the item at the coordinates <i>p</i>. The coordinates are relative to the list widget's <a href="qabstractscrollarea.html#viewport">viewport()</a>.</p>
<!-- @@@itemAt -->
<!-- $$$itemAt$$$itemAtintint -->
<h3 class="fn" id="itemAt-1"><a name="itemAt-1"></a><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">itemAt</span>(<span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a pointer to the item at the coordinates (<i>x</i>, <i>y</i>). The coordinates are relative to the list widget's <a href="qabstractscrollarea.html#viewport">viewport()</a>.</p>
<!-- @@@itemAt -->
<!-- $$$itemChanged[overload1]$$$itemChangedQListWidgetItem* -->
<h3 class="fn" id="itemChanged"><a name="itemChanged"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemChanged</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted whenever the data of <i>item</i> has changed.</p>
<!-- @@@itemChanged -->
<!-- $$$itemClicked[overload1]$$$itemClickedQListWidgetItem* -->
<h3 class="fn" id="itemClicked"><a name="itemClicked"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemClicked</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted with the specified <i>item</i> when a mouse button is clicked on an item in the widget.</p>
<p><b>See also </b><a href="qlistwidget.html#itemPressed">itemPressed</a>() and <a href="qlistwidget.html#itemDoubleClicked">itemDoubleClicked</a>().</p>
<!-- @@@itemClicked -->
<!-- $$$itemDoubleClicked[overload1]$$$itemDoubleClickedQListWidgetItem* -->
<h3 class="fn" id="itemDoubleClicked"><a name="itemDoubleClicked"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemDoubleClicked</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted with the specified <i>item</i> when a mouse button is double clicked on an item in the widget.</p>
<p><b>See also </b><a href="qlistwidget.html#itemClicked">itemClicked</a>() and <a href="qlistwidget.html#itemPressed">itemPressed</a>().</p>
<!-- @@@itemDoubleClicked -->
<!-- $$$itemEntered[overload1]$$$itemEnteredQListWidgetItem* -->
<h3 class="fn" id="itemEntered"><a name="itemEntered"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemEntered</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted when the mouse cursor enters an item. The <i>item</i> is the item entered. This signal is only emitted when <a href="qwidget.html#mouseTracking-prop">mouseTracking</a> is turned on, or when a mouse button is pressed while moving into an item.</p>
<p><b>See also </b><a href="qwidget.html#mouseTracking-prop">QWidget::setMouseTracking</a>().</p>
<!-- @@@itemEntered -->
<!-- $$$itemFromIndex[overload1]$$$itemFromIndexconstQModelIndex& -->
<h3 class="fn" id="itemFromIndex"><a name="itemFromIndex"></a><code>[protected] </code><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">itemFromIndex</span>(const <span class="type"><a href="../qtcore/qmodelindex.html">QModelIndex</a></span> &amp;<i>index</i>) const</h3>
<p>Returns a pointer to the <a href="qlistwidgetitem.html">QListWidgetItem</a> associated with the given <i>index</i>.</p>
<!-- @@@itemFromIndex -->
<!-- $$$itemPressed[overload1]$$$itemPressedQListWidgetItem* -->
<h3 class="fn" id="itemPressed"><a name="itemPressed"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemPressed</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>This signal is emitted with the specified <i>item</i> when a mouse button is pressed on an item in the widget.</p>
<p><b>See also </b><a href="qlistwidget.html#itemClicked">itemClicked</a>() and <a href="qlistwidget.html#itemDoubleClicked">itemDoubleClicked</a>().</p>
<!-- @@@itemPressed -->
<!-- $$$itemSelectionChanged[overload1]$$$itemSelectionChanged -->
<h3 class="fn" id="itemSelectionChanged"><a name="itemSelectionChanged"></a><code>[signal] </code><span class="type">void</span> QListWidget::<span class="name">itemSelectionChanged</span>()</h3>
<p>This signal is emitted whenever the selection changes.</p>
<p><b>See also </b><a href="qlistwidget.html#selectedItems">selectedItems</a>(), <a href="qlistwidgetitem.html#isSelected">QListWidgetItem::isSelected</a>(), and <a href="qlistwidget.html#currentItemChanged">currentItemChanged</a>().</p>
<!-- @@@itemSelectionChanged -->
<!-- $$$itemWidget[overload1]$$$itemWidgetQListWidgetItem* -->
<h3 class="fn" id="itemWidget"><a name="itemWidget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QListWidget::<span class="name">itemWidget</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>) const</h3>
<p>Returns the widget displayed in the given <i>item</i>.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qlistwidget.html#setItemWidget">setItemWidget</a>() and <a href="qlistwidget.html#removeItemWidget">removeItemWidget</a>().</p>
<!-- @@@itemWidget -->
<!-- $$$items[overload1]$$$itemsconstQMimeData* -->
<h3 class="fn" id="items"><a name="items"></a><code>[protected] </code><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *&gt; QListWidget::<span class="name">items</span>(const <span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *<i>data</i>) const</h3>
<p>Returns a list of pointers to the items contained in the <i>data</i> object. If the object was not created by a <a href="qlistwidget.html">QListWidget</a> in the same process, the list is empty.</p>
<!-- @@@items -->
<!-- $$$mimeData[overload1]$$$mimeDataconstQList<QListWidgetItem*> -->
<h3 class="fn" id="mimeData"><a name="mimeData"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qmimedata.html">QMimeData</a></span> *QListWidget::<span class="name">mimeData</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *&gt; <i>items</i>) const</h3>
<p>Returns an object that contains a serialized description of the specified <i>items</i>. The format used to describe the items is obtained from the <a href="qlistwidget.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of items is empty, 0 is returned instead of a serialized empty list.</p>
<!-- @@@mimeData -->
<!-- $$$mimeTypes[overload1]$$$mimeTypes -->
<h3 class="fn" id="mimeTypes"><a name="mimeTypes"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QListWidget::<span class="name">mimeTypes</span>() const</h3>
<p>Returns a list of MIME types that can be used to describe a list of listwidget items.</p>
<p><b>See also </b><a href="qlistwidget.html#mimeData">mimeData</a>().</p>
<!-- @@@mimeTypes -->
<!-- $$$openPersistentEditor[overload1]$$$openPersistentEditorQListWidgetItem* -->
<h3 class="fn" id="openPersistentEditor"><a name="openPersistentEditor"></a><span class="type">void</span> QListWidget::<span class="name">openPersistentEditor</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Opens an editor for the given <i>item</i>. The editor remains open after editing.</p>
<p><b>See also </b><a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a>().</p>
<!-- @@@openPersistentEditor -->
<!-- $$$removeItemWidget[overload1]$$$removeItemWidgetQListWidgetItem* -->
<h3 class="fn" id="removeItemWidget"><a name="removeItemWidget"></a><span class="type">void</span> QListWidget::<span class="name">removeItemWidget</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Removes the widget set on the given <i>item</i>.</p>
<p>To remove an item (row) from the list entirely, either delete the item or use <a href="qlistwidget.html#takeItem">takeItem</a>().</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qlistwidget.html#itemWidget">itemWidget</a>() and <a href="qlistwidget.html#setItemWidget">setItemWidget</a>().</p>
<!-- @@@removeItemWidget -->
<!-- $$$row[overload1]$$$rowconstQListWidgetItem* -->
<h3 class="fn" id="row"><a name="row"></a><span class="type">int</span> QListWidget::<span class="name">row</span>(const <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>) const</h3>
<p>Returns the row containing the given <i>item</i>.</p>
<p><b>See also </b><a href="qlistwidget.html#item">item</a>().</p>
<!-- @@@row -->
<!-- $$$scrollToItem[overload1]$$$scrollToItemconstQListWidgetItem*QAbstractItemView::ScrollHint -->
<h3 class="fn" id="scrollToItem"><a name="scrollToItem"></a><code>[slot] </code><span class="type">void</span> QListWidget::<span class="name">scrollToItem</span>(const <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>, <span class="type"><a href="qabstractitemview.html#ScrollHint-enum">QAbstractItemView::ScrollHint</a></span> <i>hint</i> = EnsureVisible)</h3>
<p>Scrolls the view if necessary to ensure that the <i>item</i> is visible.</p>
<p><i>hint</i> specifies where the <i>item</i> should be located after the operation.</p>
<!-- @@@scrollToItem -->
<!-- $$$selectedItems[overload1]$$$selectedItems -->
<h3 class="fn" id="selectedItems"><a name="selectedItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *&gt; QListWidget::<span class="name">selectedItems</span>() const</h3>
<p>Returns a list of all selected items in the list widget.</p>
<!-- @@@selectedItems -->
<!-- $$$setCurrentItem[overload1]$$$setCurrentItemQListWidgetItem* -->
<h3 class="fn" id="setCurrentItem"><a name="setCurrentItem"></a><span class="type">void</span> QListWidget::<span class="name">setCurrentItem</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>)</h3>
<p>Sets the current item to <i>item</i>.</p>
<p>Unless the selection mode is <a href="qabstractitemview.html#SelectionMode-enum">NoSelection</a>, the item is also selected.</p>
<p><b>See also </b><a href="qlistwidget.html#currentItem">currentItem</a>().</p>
<!-- @@@setCurrentItem -->
<!-- $$$setCurrentItem$$$setCurrentItemQListWidgetItem*QItemSelectionModel::SelectionFlags -->
<h3 class="fn" id="setCurrentItem-1"><a name="setCurrentItem-1"></a><span class="type">void</span> QListWidget::<span class="name">setCurrentItem</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qitemselectionmodel.html#SelectionFlag-enum">QItemSelectionModel::SelectionFlags</a></span> <i>command</i>)</h3>
<p>Set the current item to <i>item</i>, using the given <i>command</i>.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@setCurrentItem -->
<!-- $$$setCurrentRow -->
<h3 class="fn" id="setCurrentRow-1"><a name="setCurrentRow-1"></a><span class="type">void</span> QListWidget::<span class="name">setCurrentRow</span>(<span class="type">int</span> <i>row</i>, <span class="type"><a href="../qtcore/qitemselectionmodel.html#SelectionFlag-enum">QItemSelectionModel::SelectionFlags</a></span> <i>command</i>)</h3>
<p>Sets the current row to be the given <i>row</i>, using the given <i>command</i>,</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>Note:</b> Setter function for property <a href="qlistwidget.html#currentRow-prop">currentRow</a>. </p><!-- @@@setCurrentRow -->
<!-- $$$setItemWidget[overload1]$$$setItemWidgetQListWidgetItem*QWidget* -->
<h3 class="fn" id="setItemWidget"><a name="setItemWidget"></a><span class="type">void</span> QListWidget::<span class="name">setItemWidget</span>(<span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>)</h3>
<p>Sets the <i>widget</i> to be displayed in the given <i>item</i>.</p>
<p>This function should only be used to display static content in the place of a list widget item. If you want to display custom dynamic content or implement a custom editor widget, use <a href="qlistview.html">QListView</a> and subclass <a href="qitemdelegate.html">QItemDelegate</a> instead.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qlistwidget.html#itemWidget">itemWidget</a>(), <a href="qlistwidget.html#removeItemWidget">removeItemWidget</a>(), and <a href="model-view-programming.html#delegate-classes">Delegate Classes</a>.</p>
<!-- @@@setItemWidget -->
<!-- $$$setSelectionModel[overload1]$$$setSelectionModelQItemSelectionModel* -->
<h3 class="fn" id="setSelectionModel"><a name="setSelectionModel"></a><code>[virtual] </code><span class="type">void</span> QListWidget::<span class="name">setSelectionModel</span>(<span class="type"><a href="../qtcore/qitemselectionmodel.html">QItemSelectionModel</a></span> *<i>selectionModel</i>)</h3>
<p>Reimplemented from <a href="qabstractitemview.html#setSelectionModel">QAbstractItemView::setSelectionModel</a>().</p>
<!-- @@@setSelectionModel -->
<!-- $$$sortItems[overload1]$$$sortItemsQt::SortOrder -->
<h3 class="fn" id="sortItems"><a name="sortItems"></a><span class="type">void</span> QListWidget::<span class="name">sortItems</span>(<span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::AscendingOrder)</h3>
<p>Sorts all the items in the list widget according to the specified <i>order</i>.</p>
<!-- @@@sortItems -->
<!-- $$$supportedDropActions[overload1]$$$supportedDropActions -->
<h3 class="fn" id="supportedDropActions"><a name="supportedDropActions"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qt.html#DropAction-enum">Qt::DropActions</a></span> QListWidget::<span class="name">supportedDropActions</span>() const</h3>
<p>Returns the drop actions supported by this view.</p>
<p><b>See also </b><a href="../qtcore/qt.html#DropAction-enum">Qt::DropActions</a>.</p>
<!-- @@@supportedDropActions -->
<!-- $$$takeItem[overload1]$$$takeItemint -->
<h3 class="fn" id="takeItem"><a name="takeItem"></a><span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *QListWidget::<span class="name">takeItem</span>(<span class="type">int</span> <i>row</i>)</h3>
<p>Removes and returns the item from the given <i>row</i> in the list widget; otherwise returns 0.</p>
<p>Items removed from a list widget will not be managed by Qt, and will need to be deleted manually.</p>
<p><b>See also </b><a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
<!-- @@@takeItem -->
<!-- $$$visualItemRect[overload1]$$$visualItemRectconstQListWidgetItem* -->
<h3 class="fn" id="visualItemRect"><a name="visualItemRect"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QListWidget::<span class="name">visualItemRect</span>(const <span class="type"><a href="qlistwidgetitem.html">QListWidgetItem</a></span> *<i>item</i>) const</h3>
<p>Returns the rectangle on the viewport occupied by the item at <i>item</i>.</p>
<!-- @@@visualItemRect -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>