[Interest] Model/view: DnD move w/o remove/insert.
Ch'Gans
chgans at gna.org
Sun Nov 27 11:25:36 CET 2016
Hi there,
I would like to know if it is possible to implement an internal move
(reorder) of items in a table model/view:
- using drag and drop
- without first removing the source item and then inserting it back
above/below the dest item.
My model supports moveRows (without relying on remove/insert), and i
have a small toolbar under my table view to move the selected item up
and down.
This works fine, but if you need to reshufle a lot the items it's a
pain to go and select an item, and then click up/down until you're
happy, select another one and repeat these steps until you get the
correct order.
None of these seems to be doable with a plain QTableView, no
combination of DragDropMode and DragDropOverwriteMode would prevent
the remove/insert during a "real" move sequence (not a
copy/overwrite).
Does anyone knows a way to achieve that without customising QTableView?
For what i found during my research, one can do that by
reimplementation startDrag and dropEvent, but i would prefer to not go
this way if possible.
There's a guy [1] that propose a hack, but it looks really too much of
a (dirty) hack to me.
Chris
[1] https://groups.google.com/forum/#!topic/python_inside_maya/a14k0ce70oo
More information about the Interest
mailing list