zemlifr
21st March 2016, 21:57
Hi, I started working with Qt Model/View recently and have this problem:
I have QTreeView supported by my implementation of QAbstractItemModel. I want to enable reordering items by drag and drop operations.
I have set all flags to enable drag and drops and now I am at point where I got insertRows and removeRows called. So now, If I implement this, i got my items reordered, right?
But, I noticed, that there is method called moveRows (http://doc.qt.io/qt-5/qabstractitemmodel.html#moveRows). I wonder, is there a way to get this one called instead of these above and perform move in "one" step? Or I am missing something?
thanks
I have QTreeView supported by my implementation of QAbstractItemModel. I want to enable reordering items by drag and drop operations.
I have set all flags to enable drag and drops and now I am at point where I got insertRows and removeRows called. So now, If I implement this, i got my items reordered, right?
But, I noticed, that there is method called moveRows (http://doc.qt.io/qt-5/qabstractitemmodel.html#moveRows). I wonder, is there a way to get this one called instead of these above and perform move in "one" step? Or I am missing something?
thanks