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.
Qt Code:
  1. emit layoutAboutToBeChanged();
  2.  
  3. QModelIndex from = ...;
  4. QModelIndex to = ...;
  5.  
  6. changePersistentIndex(from, to); // This call overwrites and does not exchange?
  7. changePersistentIndex(to, from);
  8.  
  9. emit layoutChanged();
To copy to clipboard, switch view to plain text mode 

Thanks.