mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1244438b01
commit
c7c5ca7c3e
2 changed files with 71 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue