From 6b10bf28265250ae9438d2db03db628ce4ff8ad7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 16 Jul 2020 16:40:46 +0200 Subject: [PATCH] emit countChanged when we get a new source model the source model is set asyncronously so onComponentcomplete count is 0, and when the proper source is set the notify is not emitted. furthermore the source canchange at runtime, so count needs to be reevaluated every time this happens --- libtaskmanager/tasksmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtaskmanager/tasksmodel.cpp b/libtaskmanager/tasksmodel.cpp index c29b0e8fa..3a68f16fb 100644 --- a/libtaskmanager/tasksmodel.cpp +++ b/libtaskmanager/tasksmodel.cpp @@ -1024,6 +1024,8 @@ TasksModel::TasksModel(QObject *parent) // Start sorting. sort(0); + connect(this, &TasksModel::sourceModelChanged, this, &TasksModel::countChanged); + // Private::updateGroupInline() sets our source model, populating the model. We // delay running this until the QML runtime had a chance to call our implementation // of QQmlParserStatus::classBegin(), setting Private::usedByQml to true. If used