[education/rkward] rkward/misc: Slightly smarter model reset
Thomas Friedrichsmeier
null at kde.org
Sat Oct 10 21:50:20 BST 2026
Git commit c147afd70fff8fa621063222236e32e82924e3b4 by Thomas Friedrichsmeier.
Committed on 10/10/2026 at 20:50.
Pushed by tfry into branch 'master'.
Slightly smarter model reset
M +2 -7 rkward/misc/rkobjectlistview.cpp
https://invent.kde.org/education/rkward/-/commit/c147afd70fff8fa621063222236e32e82924e3b4
diff --git a/rkward/misc/rkobjectlistview.cpp b/rkward/misc/rkobjectlistview.cpp
index 28093406b..671d9301f 100644
--- a/rkward/misc/rkobjectlistview.cpp
+++ b/rkward/misc/rkobjectlistview.cpp
@@ -373,14 +373,9 @@ bool RKObjectListViewSettings::filterAcceptsRow(int source_row, const QModelInde
if (!object) {
// FIXME: Properly debug when this condition is hit, rather than working around it.
// Somehow this happens with Qt version 6.11.2: The parent object's row count is not always updated in the proxy.
- // (Triggered on the next run of the filter; not 100% deterministic).
- // This is despite the source model properly emitting begin/EndRemoveRows().
+ // Not 100% deterministic. This is despite the source model properly emitting begin/EndRemoveRows().
RK_DEBUG(APP, DL_ERROR, "Proxy model wants invalid row %d of %d in %s. Triggering reset", source_row, sourceModel()->rowCount(source_parent) - 1, qPrintable(parent->getShortName()));
- QTimer::singleShot(0, this, [this]() {
- auto model = sourceModel();
- const_cast<RKObjectListViewSettings *>(this)->setSourceModel(nullptr);
- const_cast<RKObjectListViewSettings *>(this)->setSourceModel(model);
- });
+ QTimer::singleShot(0, this, &RKObjectListViewSettings::invalidate);
return false;
}
if (filterAcceptsObject(object)) return true;
More information about the rkward-tracker
mailing list