Unsolved Move items in a QSortFilterProxyModel
-
@VRonin said in Move items in a QSortFilterProxyModel:
Can you post the implementation?
I have already posted the implementation of the QSortFilterProxyModel. Are you seeking the implementation of the QAbstractTableModel?
-
@VRonin said in Move items in a QSortFilterProxyModel:
Did you reimplement moveRow?
@Valerian said in Move items in a QSortFilterProxyModel:
I re-implemeted it in the QSortFilterProxyModel.
I don't see an implementation of
FilterProxyModel::moveRow
(or ratherFilterProxyModel::moveRows
) above -
@JonB said in Move items in a QSortFilterProxyModel:
I now realise you got your code from https://stackoverflow.com/a/43683619/489865, didn't you? Wasn't actually confirmed to be correct solution. I still don't get where the + 2 comes from, but there you are.
Yes I did pick it from there.
Thanks for the other stackflow link. Will have a read on that.
-
@VRonin said in Move items in a QSortFilterProxyModel:
I don't see an implementation of FilterProxyModel::moveRow (or rather FilterProxyModel::moveRows) above
I haven't implement that. Not sure if I need to write that
-
@VRonin said in Move items in a QSortFilterProxyModel:
Did you reimplement moveRow?
@Valerian said in Move items in a QSortFilterProxyModel:
I re-implemeted it in the QSortFilterProxyModel
As I mentioned, the default implementation does nothing and returns false so calling it is pointless unless you reimplement it
-
@VRonin [I don't get what's happening in the pic? :( ]
-
-
@VRonin
Dear Mr VRonin,Thank you for that link. I opened it from Firefox from the Ubuntu I sit inside as a VirtualBox under Windows Server.
The video started, and then froze. My whole Linux guest box froze. Nothing other than a Windows TaskMan kill of the whole VBox was possible, killing my session and any work I had done but not committed!
Please remind me never to risk clicking on such a link again! :) I shall have to manage without knowing the meaning of the pic now...
-
@JonB Sorry mate, it was just a stupid YouTube video of a guy saying carrots are good for eyesight, another guy shoving 2 carrots in his eyes and then the image above
-
@VRonin Thank you for your feedback. Will re-implement those functions and try
-
@VRonin Ohhhhh, I would never have figured that's what it was! All OK :)
-
hi, can anybody tell me how to implement moveRows() for the class derived from QSortFilterProxyModel:
moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)it looks like we need to exchange the proxy indexes, but we can't access to the private members in the subclass