Unsolved Reordering rows of QTableView with drag and drop
-
@kshegunov said in Reordering rows of QTableView with drag and drop:
So, I'd say yes, but you have to reimplement the dropEvent handler in the view and not delegate to the model.
Agreed. Which wouldn't be so bad, except the part one really wants to re-use is private (
d->dropOn()
) which further calls some other private utility methods and also updates a private member variable (dropIndicatorPosition
). Everything except setting that private member could just be copied over (I think, and I"m not sure what the fallout would be from not settingdropIndicatorPosition
properly), but... blech. I get why stuff should stay private (ind
), but something likedropOn()
(and a few other utilities) could be protected members of the main class w/out much danger of breaking BC down the line.-Max
-
Which gets me to my original position. I'd rather have this whole d&d ripped out of the model, and probably out of the view and put inside a delegate (i.e. one that's aggregated) which handles the logic and propagates down to the model how and what should be modified. But as said, such things aren't happening any time soon.