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.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'seriestreewidget.cpp') diff --git a/seriestreewidget.cpp b/seriestreewidget.cpp index 7e5d41f..b5a48be 100644 --- a/seriestreewidget.cpp +++ b/seriestreewidget.cpp @@ -70,18 +70,6 @@ SeriesTreeWidget::SeriesTreeWidget(QWidget *parent) : QWidget(parent){ } -QModelIndexList SeriesTreeWidget::mapToSource(const QModelIndexList &indexes) const{ - QModelIndexList retval; - foreach(QModelIndex i, indexes){ - retval << mProxy->mapToSource(i); - } - return retval; -} - -QModelIndex SeriesTreeWidget::mapToSource(const QModelIndex &index) const{ - return mProxy->mapToSource(index); -} - void SeriesTreeWidget::newSeries(){ QList data; data << tr("") << QVariant() << QVariant() << QVariant() << SeriesTreeModel::NewSeries; -- cgit v1.2.3-70-g09d2