Map selected indexes to source before modify the data

Changing the data may affect the layout of the sort/filter model, which in turn may invalidate the indexes previously obtained from selection model before we process them all. Therefore, we must map all the selected indexes to source before start processing them.

PR #19372.
Closes #19359.
This commit is contained in:
Vladimir Golovnev
2023-07-26 18:19:32 +03:00
committed by GitHub
parent 9975230dea
commit 006ad23d0d
2 changed files with 28 additions and 9 deletions

View File

@@ -119,6 +119,7 @@ private slots:
private:
void wheelEvent(QWheelEvent *event) override;
QModelIndex mapToSource(const QModelIndex &index) const;
QModelIndexList mapToSource(const QModelIndexList &indexes) const;
QModelIndex mapFromSource(const QModelIndex &index) const;
bool loadSettings();
QVector<BitTorrent::Torrent *> getSelectedTorrents() const;