Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QSmoothListWidget class provides an item-based list widget. More...
#include <QSmoothListWidget>
Inherits QSmoothList.
The QSmoothListWidget class provides an item-based list widget.
QSmoothListWidget 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. QSmoothListWidget uses an internal model to manage each QSmoothListWidgetItem in the list.
QSmoothListWidget is a drop-in replacement for QListWidget, but using a QSmoothList. This means that unlike a QListWidget a QSmoothListWidget does not handle editing, multiple selected items or drag and drop. The other noticable difference is that QSmoothListWidget::scrollToItem() takes a QSmoothList::ScrollHint as its second parameter, not a QAbstractItemView::ScrollHint.
For a more flexible list view widget, use the QSmoothList or the QListView class with a standard model.
There are two ways to add items to the list: they can be constructed with the smooth list widget as their parent widget, or they can be constructed with no parent widget and added to the list later. If a smooth list widget already exists when the items are constructed, the first method is easier to use:
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 smooth list widget will take ownership of the item.
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.
See also QSmoothListWidgetItem, QSmoothList, QListWidget, and Model/View Programming.
This property holds the number of items in the list.
Access functions:
This property holds the row of the current item.
The row will 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.
Access functions:
Constructs an empty QSmoothListWidget with the given parent.
Destroys the smooth list widget and all its items.
Inserts an item with the text label at the end of the smooth list widget.
This is an overloaded member function, provided for convenience.
Inserts the item at the the end of the smooth list widget.
Warning: A QSmoothListWidgetItem can only be added to a QSmoothListWidget once. Adding the same QSmoothListWidgetItem multiple times to a QSmoothListWidget will result in undefined behavior.
See also insertItem().
Inserts items with the text labels at the end of the smooth list widget.
See also insertItems().
Removes all items and selections in the view.
Note that all items will be permanently deleted.
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.
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 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().
Returns a pointer to the QSmoothListWidgetItem 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().
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.
Note that QSmoothList::ScrollHint is used instead of QAbstractItemView::ScrollHint
Sets the current item to item.
Depending on the current selection mode, the item may also be selected.
See also currentItem().
Sorts all the items in the list widget according to the specified order.
Removes and returns the item from the given row in the smooth list widget; otherwise returns 0.
Items removed from a smooth 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.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |