1 #ifndef WEIGHTGRAPHVIEW_H
2 #define WEIGHTGRAPHVIEW_H
6 #include "weightdata.h"
9 class WeightGraphView : public QWidget
13 explicit WeightGraphView(WeightDataModel *wdm, const QString &id, QWidget *parent = 0);
14 QSize sizeHint() const;
18 void paintEvent(QPaintEvent *);
21 grabZoomKeys(Settings::grabZoomKeys());
25 void grabZoomKeys(bool grab);
28 period = wdm->getWeights().first().date.daysTo(wdm->getWeights().last().date) + 1;
35 period = wdm->getWeights().first().date.daysTo(wdm->getWeights().last().date) - 1;
37 period = qMax(1, period-1);
40 void setPeriod(int period) { this->period = period; update(); }
42 void mousePressEvent(QMouseEvent *);
43 void keyPressEvent(QKeyEvent* event);
50 #endif // WEIGHTGRAPHVIEW_H