diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-21 16:44:38 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-21 16:44:38 -0300 |
commit | 28f48227f72bf7db16b1f53b4d50df7fb5a54131 (patch) | |
tree | 5f5995632b27d41bc282704c2b027ce26528e781 /qt-ui/diveplanner.h | |
parent | 01d1a49d9448a2b4fd6363cf69260cc305b5e9f3 (diff) | |
download | subsurface-28f48227f72bf7db16b1f53b4d50df7fb5a54131.tar.gz |
Added a new class to handle the pseudo-buttons on the canvas.
Added a new class, named Button, that has a clicked() signal,
and can be connected to the view to emulate buttons. While
I know that Qt supports widgets on canvas - I think it's too
nineties to have such square controls on something that can have
rounded borders.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r-- | qt-ui/diveplanner.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 621e8a2a5..c3ae3eb60 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -5,6 +5,16 @@ #include <QGraphicsPathItem> #include <QDialog> +class Button : public QObject, public QGraphicsPixmapItem { + Q_OBJECT +public: + explicit Button(QObject* parent = 0); +protected: + virtual void mousePressEvent(QGraphicsSceneMouseEvent* event); +signals: + void clicked(); +}; + class DiveHandler : public QGraphicsEllipseItem{ public: DiveHandler(); @@ -52,7 +62,6 @@ protected: void clear_generated_deco(); void create_deco_stop(); bool isPointOutOfBoundaries(const QPointF& point); - private: void moveActiveHandler(const QPointF& pos); @@ -68,6 +77,11 @@ private: Ruler *depthLine; QGraphicsSimpleTextItem *depthString; + Button *plusTime; + Button *plusDepth; + Button *lessTime; + Button *lessDepth; + }; namespace Ui{ |