Hello,
I'm trying to implement "move up" and "move down" for items in my model. I'm not using a QSortFilterProxyModel and I won't.
Is there a working way to do this?
From my understanding what the docs tell me, I would have to exchange the first row index with the second one and vice versa. But it won't work.
emit layoutAboutToBeChanged();
changePersistentIndex(from, to); // This call overwrites and does not exchange?
changePersistentIndex(to, from);
emit layoutChanged();
emit layoutAboutToBeChanged();
QModelIndex from = ...;
QModelIndex to = ...;
changePersistentIndex(from, to); // This call overwrites and does not exchange?
changePersistentIndex(to, from);
emit layoutChanged();
To copy to clipboard, switch view to plain text mode
Thanks.
Bookmarks