From d27a1ac45fddeeb4a0bc1220f3858534f5aeca37 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 29 Jul 2010 20:03:26 +0200 Subject: Fix selection madness in ArchiveTreeWidget First try on fixing this. Still use QItemSelectionModel::selectionChanged, but ignore the QItemSelections. Use QItemSelectionModel::selectedRows() instead and compute the seriesPartIds on every change. Hopefully this guarantees having valid QModelIndexes all the time. This fix also obsoletes the quite awkward function SeriesTreeWidget::mapToSource(). Make the QSortProxyModel of SeriesTreeWidget available through SeriesTreeWidget::seriesProxy() instead. --- seriestreewidget.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'seriestreewidget.h') diff --git a/seriestreewidget.h b/seriestreewidget.h index fd850b4..578edef 100644 --- a/seriestreewidget.h +++ b/seriestreewidget.h @@ -28,8 +28,7 @@ class SeriesTreeWidget : public QWidget { public: explicit SeriesTreeWidget(QWidget *parent = 0); SeriesTreeView *seriesTree() { return mView; } - QModelIndexList mapToSource(const QModelIndexList &indexes) const; - QModelIndex mapToSource(const QModelIndex &index) const; + SeriesTreeSortModel *seriesProxy() { return mProxy; } public slots: void newSeries(); -- cgit v1.2.3-70-g09d2