projects
/
harbour-pedalo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add graph animation; support for line graphs
[harbour-pedalo.git]
/
src
/
statsmodel.cpp
diff --git
a/src/statsmodel.cpp
b/src/statsmodel.cpp
index
b6a2ef8
..
5bc8155
100644
(file)
--- a/
src/statsmodel.cpp
+++ b/
src/statsmodel.cpp
@@
-1,8
+1,11
@@
#include "statsmodel.h"
#include "statsmodel.h"
-StatsModel::StatsModel(QObject *parent) : QAbstractListModel(parent) {
+StatsModel::StatsModel(QObject *parent) : QAbstractListModel(parent),
+ visibleIndex(-1)
+{
roles[TitleRole] = "title";
roles[TitleRole] = "title";
- roles[ValuesRole] = "values";
+ roles[BarValuesRole] = "barvalues";
+ roles[LineValuesRole] = "linevalues";
roles[LabelsRole] = "labels";
roles[UnitsRole] = "units";
roles[MinValRole] = "minval";
roles[LabelsRole] = "labels";
roles[UnitsRole] = "units";
roles[MinValRole] = "minval";
@@
-30,8
+33,10
@@
QVariant StatsModel::data(const QModelIndex & index, int role) const {
const Stats *stat = stats[index.row()];
if (role == TitleRole)
return stat->getTitle();
const Stats *stat = stats[index.row()];
if (role == TitleRole)
return stat->getTitle();
- else if (role == ValuesRole)
- return QVariant::fromValue<QList<float>>(stat->getValues());
+ else if (role == BarValuesRole)
+ return QVariant::fromValue<QList<float>>(stat->getBarValues());
+ else if (role == LineValuesRole)
+ return QVariant::fromValue<QList<float>>(stat->getLineValues());
else if (role == LabelsRole)
return stat->getLabels();
else if (role == UnitsRole)
else if (role == LabelsRole)
return stat->getLabels();
else if (role == UnitsRole)