mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
46bb242c69
commit
e610fb2481
2 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue