summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-27 16:45:58 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-27 16:45:58 -0300
commitc7c5ca7c3e1f4f9fb3d6a49a4b6eb2bcfdf2fb24 (patch)
treef78fd8be2b1e72b1db9b4552aa4ce8c58dd2587b /qt-ui/diveplanner.h
parent1244438b017f71be466ace7df9cad9462287fd30 (diff)
downloadsubsurface-c7c5ca7c3e1f4f9fb3d6a49a4b6eb2bcfdf2fb24.tar.gz
Added the Ok / Cancel buttons on the dive planner canvas.
Added the ok / cancel buttons on the dive planner canvas. I still need to hook the esc button to cancel it too, but since I removed the 'floating dialog' option and merged it into the mainwindow, it's necessary. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r--qt-ui/diveplanner.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 4029a6875..f2073515d 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -5,14 +5,20 @@
#include <QGraphicsPathItem>
#include <QDialog>
-class Button : public QObject, public QGraphicsPixmapItem {
+class Button : public QObject, public QGraphicsRectItem {
Q_OBJECT
public:
explicit Button(QObject* parent = 0);
+ void setText(const QString& text);
+ void setPixmap(const QPixmap& pixmap);
+
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
signals:
void clicked();
+private:
+ QGraphicsPixmapItem *icon;
+ QGraphicsSimpleTextItem *text;
};
class DiveHandler : public QGraphicsEllipseItem{
@@ -66,6 +72,8 @@ protected:
private slots:
void increaseTime();
void increaseDepth();
+ void okClicked();
+ void cancelClicked();
private:
@@ -86,7 +94,8 @@ private:
Button *plusDepth;
Button *lessTime;
Button *lessDepth;
-
+ Button *okBtn;
+ Button *cancelBtn;
QPointF lastValidPos;
};