enigma-dev / RadialGM

A native IDE for ENIGMA written in C++ using the Qt Framework.
GNU General Public License v3.0
46 stars 22 forks source link

Drag and Drop Path Sort #148

Closed RobertBColton closed 1 year ago

RobertBColton commented 4 years ago

This is another small tweak I walked across in my research of the super model. Our sort in mimeData() acts as though all of the indexes we are dragging are of the same parent which causes them to become interspersed when dropped. I realized I could solve that with a custom comparator which this pull request does. I'm also still not sure why we sort during drag instead of drop, although I recall that being the way it was in the official Qt example. Master currently behaves like LateralGM and GM does not have multiple selection for the tree.

Anyway, create some paths and scripts in the subfolders and select them, then drag them to some other folder and drop. If you do this on master you will get the master behavior below. If you do this on this pull request you will get the pull behavior below. NOTE: If you double click the drop folder, it will change the selection, clicking the expand arrow does not! Select Master Pull
Select Paths & Scripts Drop Paths & Scripts Master Drop Paths & Scripts Pull
RobertBColton commented 1 year ago

It looks like this was fixed by the new tree model which sorts in mimeData.