mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added a new class to handle the DivePlanner dialog
Added a new class named DivePlanner that is a QDialog, and renamed the old DivePlanner class to DivePlannerGraphics. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
8fcd465a65
commit
fdd8a4811b
3 changed files with 122 additions and 21 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsPathItem>
|
||||
#include <QDialog>
|
||||
|
||||
class DiveHandler : public QGraphicsEllipseItem{
|
||||
public:
|
||||
|
|
@ -34,10 +35,10 @@ private:
|
|||
double posEnd;
|
||||
};
|
||||
|
||||
class DivePlanner : public QGraphicsView {
|
||||
class DivePlannerGraphics : public QGraphicsView {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static DivePlanner *instance();
|
||||
DivePlannerGraphics(QWidget* parent = 0);
|
||||
protected:
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
virtual void showEvent(QShowEvent* event);
|
||||
|
|
@ -51,7 +52,7 @@ protected:
|
|||
bool isPointOutOfBoundaries(QPointF point);
|
||||
|
||||
private:
|
||||
DivePlanner(QWidget* parent = 0);
|
||||
|
||||
void moveActiveHandler(QPointF pos);
|
||||
QList<QGraphicsLineItem*> lines;
|
||||
QList<DiveHandler *> handles;
|
||||
|
|
@ -66,4 +67,19 @@ private:
|
|||
QGraphicsSimpleTextItem *depthString;
|
||||
|
||||
};
|
||||
|
||||
namespace Ui{
|
||||
class DivePlanner;
|
||||
}
|
||||
|
||||
class DivePlanner : public QDialog{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static DivePlanner *instance();
|
||||
struct dive* getDive();
|
||||
|
||||
private:
|
||||
DivePlanner();
|
||||
Ui::DivePlanner *ui;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue