aboutsummaryrefslogtreecommitdiffstats
path: root/stats/chartlistmodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-13 08:55:47 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-13 11:39:36 -0800
commite610fb248115cb70bc3ded65ad3ac6985658a4a9 (patch)
tree61359d4845599fd50fa5294a17ca15efc5ac22b9 /stats/chartlistmodel.cpp
parent46bb242c69c999575b4d67f262bb5676f243651f (diff)
downloadsubsurface-e610fb248115cb70bc3ded65ad3ac6985658a4a9.tar.gz
statistics: add count property to chart list
In order to be able to correctly size the chart type popup, we'll need access to the total count or rows as a property that signals changes to QML. The hack to use rowCount() as the READ function requires that rowCount() can be called without argument, therefore the addition of a default parent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'stats/chartlistmodel.cpp')
-rw-r--r--stats/chartlistmodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/stats/chartlistmodel.cpp b/stats/chartlistmodel.cpp
index bce54ce25..7f7afe4d0 100644
--- a/stats/chartlistmodel.cpp
+++ b/stats/chartlistmodel.cpp
@@ -7,7 +7,7 @@
#include <QPainter>
ChartListModel::ChartListModel() :
- itemFont(defaultModelFont()),
+ itemFont(defaultModelFont()),
headerFont(itemFont.family(), itemFont.pointSize(), itemFont.weight(), true)
{
QFontMetrics fm(itemFont);
@@ -127,5 +127,6 @@ int ChartListModel::update(const StatsState::ChartList &charts)
items.push_back({ false, chart.subtypeName, fullName, chart.subtype, chart.id, chart.warning });
}
endResetModel();
+ emit countChanged();
return res;
}