QListWidget reorder with Drag and Drop
-
Do you use QListWidget or QListWidget inherited widget? If you inherit from listWidget and use mouse or drag events and didn't pass event to QListWidget, drag and drop will not work.
-
I made it with Qt Designer and I changed the drag and drop properties a lot, but now I changed them back to just dragDropMode = internalMove and put the others back to default. The selection mode is ExtendedSelection, but I tried the default, too.
-
That should work. I tried this with designer and could move the items in the preview mode (Ctrl-R/Cmd-R). That should work in the real code too, if you do not change other drag/drop settings there too.
-
Even stranger news:
I created a new project, copied and pasted all of the code / widgets, and now its working!
Any ideas why this happened and how to prevent it in the future?
-
Sorry, I do not have any clue what's happening there. Maybe some alien code from outer space? :-)
-
Here is my scenario: You use visual studio. Your code had little error. Complier didn't compile code and ran old executable.
-
Actually, I use Qt Creator.
-
this helped me a lot! thanks
-
helped me too, thanks!
-
Worked for me!
-
The viewMode should be ListMode(default) but not IconMode, even items have icons.