diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-27 15:14:42 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-27 09:15:28 -0800 |
commit | c99089e1fa3b7eaccf3a49ea35bae0dacad04060 (patch) | |
tree | 49b6491b19ca1bd2feb9dbb245cc4269626add0a /qt-ui/profile/divecartesianaxis.h | |
parent | a57f950b302cdd54e9a71736aaa9e761070ece41 (diff) | |
download | subsurface-c99089e1fa3b7eaccf3a49ea35bae0dacad04060.tar.gz |
Add settings awareness for the PP graph
This commit is rather big, and I forgot to cut it in pieces.
The first part creates a new 'calculate_gas_information' that will not
fill the profile_info->maxpp member ( that should be removed from it as
soon as the new dialog is finished ). The reason for that is that all of
the profile data will be calculated and the graph needs to update
dynamically, so whenever the settings changes, I ask for the model which
is the biggest graph and replot only the ones we need.
The second part adds a new animation function 'animdelete' to fade-out and
delete the item when it's done. the old function 'hide' did just that but
a hide shouldn't delete anything.
The third part is preferenes awareness for the PP graphs. I created two
new functions that receive the settings key for visibility and use the
QSettings to show / hide them. This also works quite well for the axis;
if no graph is visible, the axis will also hide itself.
The fourth part is colors. The pp graphs now have the correct colors.
And a bit of code cleanup too.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.h')
-rw-r--r-- | qt-ui/profile/divecartesianaxis.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h index 507d0349c..e4366eaf4 100644 --- a/qt-ui/profile/divecartesianaxis.h +++ b/qt-ui/profile/divecartesianaxis.h @@ -7,6 +7,7 @@ class QPropertyAnimation; class DiveTextItem; class DiveLineItem; +class DivePlotDataModel; class DiveCartesianAxis : public QObject, public QGraphicsLineItem{ Q_OBJECT @@ -38,6 +39,7 @@ public slots: void updateTicks(); signals: void sizeChanged(); + void maxChanged(); protected: virtual QString textForValue(double value); virtual QColor colorForValue(double value); @@ -75,6 +77,17 @@ protected: QString textForValue(double value); }; +class PartialGasPressureAxis : public DiveCartesianAxis{ + Q_OBJECT +public: + PartialGasPressureAxis(); + void setModel(DivePlotDataModel *model); +public slots: + void preferencesChanged(); +private: + DivePlotDataModel *model; +}; + // This is a try. Maybe the CartesianPlane should have the X and Y // axis and handle things internally? class DiveCartesianPlane :public QObject, public QGraphicsRectItem{ |