Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QSmoothList class provides a view onto a model using a finger scrollable user interface. More...
#include <QSmoothList>
Inherits QWidget.
Inherited by CallContactListView, QFavoriteServicesList, QSmoothContactListView, QSmoothListWidget, and QSpeedDialList.
The QSmoothList class provides a view onto a model using a finger scrollable user interface.
QSmoothList implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class. A QSmoothList presents items stored in a model as a simple non-hierarchical list, or in a single-column hierarchical tree. If QSmoothList is provided with a hierarchical model, it will correctly reflect the hierarchy of model items, but only row zero of each QModelIndex is used to present a view of the items.
QSmoothList is designed to offer a similar interface to QListView; the primary difference is that QSmoothList allows the list position to be manipulated with a finger, facilitating use in touch-screen devices. QSmoothList also offers a subset of the QTreeView interface; items can be programmatically expanded or collapsed. Unlike QTreeView, however, QSmoothList does not support the use of a QHeaderView, and does not support multiple-column presentation.
The location of the QSmoothList can be manipulated by dragging, or by a 'flick' gesture. A flick occurs when a vertical movement is interrupted by a release - a momentum is then imparted to the list which continues to move in the initial direction, subject to a deceleration. The list can also be moved by key events if a suitable input device is available.
A QSmoothList can be used in single-selection mode, or in no-selection mode. Multiple selection is not supported, and must instead be implemented outside the QSmoothList, via a 'checkable' property of the model's items, or similar. Since multiple selection is not supported, QSmoothList does not differentiate between 'selected' and 'current' indices.
QSmoothList supports items of variable heights, as reported by the sizeHint() function of the delegate used to present the list items. However, QSmoothList does not support grid spacing. It is recommended that the delegate used with the QSmoothList should enforce height constraints, to achieve a presentation where items with variable sizes are displayed with uniform space allocations.
Constant | Value | Description |
---|---|---|
QSmoothList::EnsureVisible | 0 | Scroll to ensure that the item is visible. |
QSmoothList::PositionAtTop | 1 | Scroll to position the item at the top of the viewport. |
QSmoothList::PositionAtBottom | 2 | Scroll to position the item at the bottom of the viewport. |
QSmoothList::PositionAtCenter | 3 | Scroll to position the item at the center of the viewport. |
QSmoothList::ImmediateVisible | 4 | Reposition the list without animation to ensure that the item is visible. |
This enum indicates how the list responds to user selections:
Constant | Value | Description |
---|---|---|
QSmoothList::SingleSelection | 0 | When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item. |
QSmoothList::NoSelection | 1 | Items cannot be selected. |
Creates a new QSmoothList with the given parent and flags to view a model. Use setModel() to set the model.
Destroys the list.
This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.
See also clicked(), doubleClicked(), and pressed().
Deselects the selected item, if any.
This signal is emitted when a mouse button is clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.
See also activated(), doubleClicked(), and pressed().
Collapses the model item specified by the index.
See also collapsed().
Collapses all expanded items.
See also expandAll(), expand(), collapse(), and setExpanded().
This signal is emitted when the item specified by index is collapsed.
See also expanded() and setExpanded().
This signal is emitted when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.
See also currentIndex() and setCurrentIndex().
Returns the model index of the current item, if any.
See also setCurrentIndex().
This signal is emitted when a mouse button is double-clicked. The item the mouse was double-clicked on is specified by index. The signal is only emitted when the index is valid.
See also clicked() and activated().
Expands the model item specified by the index.
See also expanded().
Expands all expandable items.
See also collapseAll(), expand(), collapse(), and setExpanded().
This signal is emitted when the item specified by index is expanded.
See also collapsed() and setExpanded().
Returns true if the list has been set to paint items with opaque backgrounds.
Returns the size at which icons should be drawn when painting list items.
See also setIconSize().
Returns the model index of the item at the viewport coordinates point.
See also visualRect().
Returns true if the model item index is expanded; otherwise returns false.
See also expand(), expanded(), and setExpanded().
Returns the item delegate used by this view and model. This is either one set with setItemDelegate(), or the default one.
See also setItemDelegate().
Returns the model that this list is viewing.
See also setModel().
This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by index. The signal is only emitted when the index is valid.
Use the QApplication::mouseButtons() function to get the state of the mouse buttons.
See also activated(), clicked(), and doubleClicked().
Reset the internal state of the list.
Scrolls the list if necessary to ensure that the item at index is visible. The list will try to position the item according to the given hint.
Scrolls the list to the bottom.
See also scrollTo() and scrollToTop().
Scrolls the list to the top.
See also scrollTo() and scrollToBottom().
Returns the selection mode of the list.
See also setSelectionMode().
Sets the current item to be the item at index, and if necessary scrolls the list to position the item according to hint. The item will be selected unless selectionMode() is NoSelection.
See also currentIndex(), currentChanged(), and selectionMode().
Sets the string text to be displayed instead of the list, when no items are present.
Sets the item referred to by index to either collapsed or expanded, depending on the value of set.
See also expanded(), expand(), and isExpanded().
Sets the size at which icons should be drawn when painting list items to size.
Setting this property when the view is visible will cause the items to be laid out again.
See also iconSize().
Sets the item delegate for this list to delegate. This is useful if you want complete control over the editing and display of items.
Setting this property when the view is visible will cause the items to be laid out again.
See also itemDelegate().
Sets the model for the list to present.
The current selection index is reset.
See also model().
Sets the list items to be painted with opaque backgrounds, if opaque is true. Otherwise, the list items will be painted with transparent backgrounds.
See also hasOpaqueItemBackground().
Sets the selection mode of the list to mode. Multiple-item selection modes are not supported by QSmoothList.
See also selectionMode().
Sets the mode used to elide text when painting list items to mode.
See also textElideMode().
Returns the mode used to elide text when painting list items.
See also setTextElideMode().
Updates the area occupied by the given index.
Returns the rectangle on the viewport occupied by the item at index.
See also indexAt().
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |