Hello folks!
Greetings.
I have created a part of my GUI application with an area where the files of a particular pattern in a directory are listed as list view items. I would like to be able to drag the items and drop them at a different order within that same listing. If I use icon view instead, the drag and drop reordering works.
The problem is in the list view. If I don't set the movement to "free" explicitly, the GUI shows that dragging and dropping is not working, as I move the mouse, different items get selected. But if I make the movement free, I can drag the item by clicking on it, but the cursor changes to "not allowed" icon and I cannot drop the item anywhere else in that list ... i.e. the item cannot be moved.
Here is a part of my statements that I am using to display the list view:
listFilesView = new QListView(this);
listFilesView->setViewMode(QListView::ListMode);
listFilesView->setMovement(QListView::Free);
listFilesView->setDragEnabled(true);
listFilesView->setAcceptDrops(true);
listFilesView->setSelectionMode(QAbstractItemView::ExtendedSelec tion);
listFilesView->setDropIndicatorShown(true);
listFilesView->setModel(modelFiles);
If hope these statements give enough info to allow somebody to tell me what I am missing in order to get the drag and drop reorder functionality.what I am missing here?
Thank you.
Bookmarks