|
Okay, I found a way to subclass QTreeView to overwrite startDrag and disallow any drag if the current selection is non-contiguous. That is what I am going to implement to prevent the bug from happening,
The current Qt QStandardItemModel code always assumes when multiple indexes are selected that they are contiguous and therefore generates the bug when they are not. The reason Qt does that is that when multiple selections are non-contiguous, it is not clear either where the destination for each should be or if gaps should somehow be preserved. It is also unclear what if any relative order should be kept by simultaneously dropping items at one spot.
This is exactly what DiapDealer was concerned about above.
I will try to have a fix implemented by tomorrow night or Friday that will prevent this bug from happening.
Last edited by KevinH; 07-22-2026 at 03:02 PM.
|