Drag'n'Drop between two lists
The goal of this tutorial is to detailled the steps for creating two lists whose elements can be moved from one list to the others.
Instantiation
The first step is the creation of the two collections which will be used as data for the lists.
The two ListModel
widgets can then be created
Drag and Drop settings
In this section, we will see the settings needed for activating the
drag and drop mechanism.
The settings will be only explicited for the list list1
,
but a symetrical implementation for list2
is required.
For the sake of brievety, this code will not be exposed here.
The totality of the code can be found here.
Conclusion
The tutorial covers the basics of the drag and drop mechanism supported by Spec,
and provides an example of how to use it.
I want to personally thank Thierry Goubier and Martin Walk whose discussion on the mailing-list inspired me for this tutorial.