From c42d979a56702efe8e02d81877f9a4c3ce021500 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 9 Oct 2012 11:29:30 +0200 Subject: [PATCH] turns out we have to set the role names constantly to make sorting actually work even just setting the sort/filter roles is not enough. role names must also be set again! gaaaah. thankfully this seems to be very fast, though would still be nice to avoid it if possible somehow. CCBUG:308101 --- declarativeimports/core/datamodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/declarativeimports/core/datamodel.cpp b/declarativeimports/core/datamodel.cpp index 80974893f..d257e5e5e 100644 --- a/declarativeimports/core/datamodel.cpp +++ b/declarativeimports/core/datamodel.cpp @@ -47,17 +47,17 @@ SortFilterModel::~SortFilterModel() void SortFilterModel::syncRoleNames() { - if (!sourceModel() || sourceModel()->roleNames() == roleNames()) { + if (!sourceModel()) { return; } m_roleIds.clear(); - - setRoleNames(sourceModel()->roleNames()); QHash::const_iterator i; for (i = roleNames().constBegin(); i != roleNames().constEnd(); ++i) { m_roleIds[i.value()] = i.key(); } + + setRoleNames(sourceModel()->roleNames()); setFilterRole(m_filterRole); setSortRole(m_sortRole); }