Skip to content

Commit d56bd88

Browse files
authored
Merge pull request #17 from micuintus/bugs/Issue9_reSort_Not_working
Add a workaround to Collection::reSort()
2 parents 7ef641d + 3163971 commit d56bd88

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

collection.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,16 @@ QJSValue Collection::at(int row) const
119119

120120
void Collection::reSort()
121121
{
122-
sort(0);
122+
if (dynamicSortFilter())
123+
{
124+
// Workaround: If dynamic_sortfilter == true, sort(0) will not (always)
125+
// result in d->sort() being called, but setDynamicSortFilter(true) will.
126+
setDynamicSortFilter(true);
127+
}
128+
else
129+
{
130+
sort(0);
131+
}
123132
}
124133

125134
void Collection::reFilter()
@@ -128,4 +137,3 @@ void Collection::reFilter()
128137
}
129138

130139
} } }
131-

0 commit comments

Comments
 (0)