Approach to fix "Q_ASSERT(found != end1);" assert as reported by RP

https://swift-project.slack.com/archives/G96QTUBEG/p1546880962000700
This commit is contained in:
Klaus Basan
2019-01-08 08:09:40 +01:00
committed by Mat Sutcliffe
parent ed2acf4d74
commit 33a3984588
2 changed files with 9 additions and 4 deletions

View File

@@ -466,12 +466,17 @@ namespace BlackGui
QModelIndexList CViewBaseNonTemplate::selectedRows() const
{
return this->selectionModel()->selectedRows();
// make sure this is ordered by row and wee keep the same order as in unselectedRows
// if we'd know for sure the indexes are always sorted we can remove the sorting here
// Qt docu selectedIndexes: Returns a list of all selected model item indexes. The list contains no duplicates, and is not sorted.
QModelIndexList indexes = this->selectionModel()->selectedRows();
qSort(indexes);
return indexes;
}
QModelIndexList CViewBaseNonTemplate::unselectedRows() const
{
QModelIndexList selected = this->selectedRows();
const QModelIndexList selected = this->selectedRows();
QModelIndexList unselected;
const int rows = this->rowCount();
for (int r = 0; r < rows; r++)