ListItemDragHandle
Properties | |
Item | listItem |
ListView | listView |
Signals | |
void | dropped () |
void | moveRequested (int oldIndex, int newIndex) |
Additional Inherited Members | |
Public Member Functions inherited from QtQuick.Item | |
childAt (real x, real y) | |
bool | contains (point point) |
dumpItemTree () | |
forceActiveFocus () | |
forceActiveFocus (Qt::FocusReason reason) | |
bool | grabToImage (callback, targetSize) |
point | mapFromGlobal (real x, real y) |
point | mapFromItem (Item item, point p) |
point | mapFromItem (Item item, real x, real y) |
rect | mapFromItem (Item item, real x, real y, real width, real height) |
rect | mapFromItem (Item item, rect r) |
point | mapToGlobal (real x, real y) |
point | mapToItem (Item item, point p) |
point | mapToItem (Item item, real x, real y) |
rect | mapToItem (Item item, real x, real y, real width, real height) |
rect | mapToItem (Item item, rect r) |
nextItemInFocusChain (bool forward) | |
Detailed Description
Implements a drag handle supposed to be in items in ListViews to reorder items The ListView must visualize a model which supports item reordering, such as ListModel.move() or QAbstractItemModel instances with moveRows() correctly implemented.
In order for ListItemDragHandle to work correctly, the listItem that is being dragged should not directly be the delegate of the ListView, but a child of it.
It is recommended to use DelagateRecycler as base delegate like the following code:
- Since
- 2.5
Definition at line 73 of file ListItemDragHandle.qml.
Property Documentation
◆ listItem
|
read |
This property holds the delegate that will be dragged around.
This item must be a child of the actual ListView's delegate.
Definition at line 80 of file ListItemDragHandle.qml.
◆ listView
|
read |
This property holds the ListView that the delegate belong to.
Definition at line 84 of file ListItemDragHandle.qml.
Member Function Documentation
◆ dropped
|
signal |
This signal is emitted when the drag operation is complete and the item has been dropped in the new final position.
◆ moveRequested
|
signal |
This signal is emitted when the drag handle wants to move the item in the model.
The following example does the move in the case a ListModel is used:
- Parameters
-
oldIndex the index the item is currently at newIndex the index we want to move the item to
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.