QListWidget Class Reference |
A Windows XP style list widget. | A Macintosh style list widget. | A Plastique style list widget. |
See also QListWidgetItem, QListView, QTreeView, Model/View Programming, and Config Dialog Example.
This property holds the number of items in the list including any hidden items.
Access functions:
This property holds the row of the current item.
Depending on the current selection mode, the row may also be selected.
Access functions:
This property holds whether sorting is enabled.
If this property is true, sorting is enabled for the list; if the property is false, sorting is not enabled. The default value is false.
This property was introduced in Qt Qt 4.2.
Access functions:
Constructs an empty QListWidget with the given parent.
Destroys the list widget and all its items.
Inserts an item with the text label at the end of the list widget.
This is an overloaded member function, provided for convenience.
Inserts the item at the the end of the list widget.
Warning: A QListWidgetItem can only be added to a QListWidget once. Adding the same QListWidgetItem multiple times to a QListWidget will result in undefined behavior.
See also insertItem().
Inserts items with the text labels at the end of the list widget.
See also insertItems().
Removes all items and selections in the view.
Closes the persistent editor for the given item.
See also openPersistentEditor().
Returns the current item.
See also setCurrentItem().
This signal is emitted whenever the current item changes. The previous item is the item that previously had the focus, current is the new current item.
This signal is emitted whenever the current item changes. The currentRow is the row of the current item. If there is no current item, the currentRow is -1.
This signal is emitted whenever the current item changes. The currentText is the text data in the current item. If there is no current item, the currentText is invalid.
Handles the data supplied by a drag and drop operation that ended with the given action in the given index. Returns true if the data and action can be handled by the model; otherwise returns false.
See also supportedDropActions().
Starts editing the item if it is editable.
Finds items with the text that matches the string text using the given flags.
Returns the QModelIndex assocated with the given item.
Inserts the item at the position in the list given by row.
See also addItem().
This is an overloaded member function, provided for convenience.
Inserts an item with the text label in the list widget at the position given by row.
See also addItem().
Inserts items from the list of labels into the list, starting at the given row.
See also insertItem() and addItem().
Returns the item that occupies the given row in the list if one has been set; otherwise returns 0.
See also row().
This signal is emitted when the item is activated. The item 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 Return key, on Mac OS X it is Ctrl+0).
Returns a pointer to the item at the coordinates p.
This is an overloaded member function, provided for convenience.
Returns a pointer to the item at the coordinates (x, y).
This signal is emitted whenever the data of item has changed.
This signal is emitted with the specified item when a mouse button is clicked on an item in the widget.
See also itemPressed() and itemDoubleClicked().
This signal is emitted with the specified item when a mouse button is double clicked on an item in the widget.
See also itemClicked() and itemPressed().
This signal is emitted when the mouse cursor enters an item. The item is the item entered. This signal is only emitted when mouseTracking is turned on, or when a mouse button is pressed while moving into an item.
Returns a pointer to the QListWidgetItem assocated with the given index.
This signal is emitted with the specified item when a mouse button is pressed on an item in the widget.
See also itemClicked() and itemDoubleClicked().
This signal is emitted whenever the selection changes.
See also selectedItems(), isItemSelected(), and currentItemChanged().
Returns the widget displayed in the given item.
This function was introduced in Qt 4.1.
See also setItemWidget().
Returns a list of pointers to the items contained in the data object. If the object was not created by a QListWidget in the same process, the list is empty.
Returns an object that contains a serialized description of the specified items. The format used to describe the items is obtained from the mimeTypes() function.
If the list of items is empty, 0 is returned rather than a serialized empty list.
Returns a list of MIME types that can be used to describe a list of listwidget items.
See also mimeData().
Opens an editor for the given item. The editor remains open after editing.
See also closePersistentEditor().
Removes the widget set on the given item.
This function was introduced in Qt 4.3.
Returns the row containing the given item.
See also item().
Scrolls the view if necessary to ensure that the item is visible. The hint parameter specifies more precisely where the item should be located after the operation.
Returns a list of all selected items in the list widget.
Sets the current item to item.
Depending on the current selection mode, the item may also be selected.
See also currentItem().
Sets the widget to be displayed in the give item.
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 QListView and subclass QItemDelegate instead.
This function was introduced in Qt 4.1.
See also itemWidget() and Delegate Classes.
Sorts all the items in the list widget according to the specified order.
Returns the drop actions supported by this view.
See also Qt::DropActions.
Removes and returns the item from the given row in the list widget; otherwise returns 0.
Items removed from a list widget will not be managed by Qt, and will need to be deleted manually.
See also insertItem() and addItem().
Returns the rectangle on the viewport occupied by the item at item.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.3 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com