summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-27 20:09:57 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-27 20:09:57 -0800
commit76e6420f6b3503b76bd3eec00ab0e53d6ea17a20 (patch)
tree8b50298f41bd29d55bbd6f4301f36ad31dc0b008 /qt-ui/diveplanner.h
parent006265d7a088cff4fea665159dbb454956c2cd76 (diff)
downloadsubsurface-76e6420f6b3503b76bd3eec00ab0e53d6ea17a20.tar.gz
Massive automated whitespace cleanup
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r--qt-ui/diveplanner.h135
1 files changed, 80 insertions, 55 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 364d0396d..4679d0660 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -12,19 +12,30 @@
class QListView;
class QModelIndex;
-class DivePlannerPointsModel : public QAbstractTableModel{
+class DivePlannerPointsModel : public QAbstractTableModel {
Q_OBJECT
public:
- static DivePlannerPointsModel* instance();
- enum Sections{REMOVE, DEPTH, DURATION, GAS, CCSETPOINT, COLUMNS};
- enum Mode { NOTHING, PLAN, ADD };
- virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
- virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
- virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
+ static DivePlannerPointsModel *instance();
+ enum Sections {
+ REMOVE,
+ DEPTH,
+ DURATION,
+ GAS,
+ CCSETPOINT,
+ COLUMNS
+ };
+ enum Mode {
+ NOTHING,
+ PLAN,
+ ADD
+ };
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
- virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
- virtual Qt::ItemFlags flags(const QModelIndex& index) const;
- void removeSelectedPoints(const QVector<int>& rows);
+ virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
+ virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+ void removeSelectedPoints(const QVector<int> &rows);
void setPlanMode(Mode mode);
bool isPlanner();
void createSimpleDive();
@@ -37,35 +48,37 @@ public:
/**
* @return the row number.
*/
- void editStop(int row, divedatapoint newData );
+ void editStop(int row, divedatapoint newData);
divedatapoint at(int row);
int size();
struct diveplan getDiveplan();
QStringList &getGasList();
QVector<QPair<int, int> > collectGases(dive *d);
-public slots:
- int addStop(int millimeters = 0, int seconds = 0, int o2 = 0, int he = 0, int ccpoint = 0 );
+public
+slots:
+ int addStop(int millimeters = 0, int seconds = 0, int o2 = 0, int he = 0, int ccpoint = 0);
void addCylinder_clicked();
void setGFHigh(const int gfhigh);
void setGFLow(const int ghflow);
void setSurfacePressure(int pressure);
void setBottomSac(int sac);
void setDecoSac(int sac);
- void setStartTime(const QTime& t);
+ void setStartTime(const QTime &t);
void setLastStop6m(bool value);
void createPlan();
- void remove(const QModelIndex& index);
+ void remove(const QModelIndex &index);
void cancelPlan();
void createTemporaryPlan();
void deleteTemporaryPlan();
- void loadFromDive(dive* d);
+ void loadFromDive(dive *d);
void restoreBackupDive();
signals:
void planCreated();
void planCanceled();
+
private:
- explicit DivePlannerPointsModel(QObject* parent = 0);
+ explicit DivePlannerPointsModel(QObject *parent = 0);
bool addGas(int o2, int he);
struct diveplan diveplan;
Mode mode;
@@ -81,13 +94,15 @@ private:
class Button : public QObject, public QGraphicsRectItem {
Q_OBJECT
public:
- Button(QObject* parent = 0, QGraphicsItem *itemParent = 0);
- void setText(const QString& text);
- void setPixmap(const QPixmap& pixmap);
+ Button(QObject *parent = 0, QGraphicsItem *itemParent = 0);
+ void setText(const QString &text);
+ void setPixmap(const QPixmap &pixmap);
+
protected:
- virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
signals:
void clicked();
+
private:
QGraphicsPixmapItem *icon;
QGraphicsSimpleTextItem *text;
@@ -101,27 +116,31 @@ public:
QGraphicsPixmapItem *icon;
Button *increaseBtn;
Button *decreaseBtn;
+
private:
QGraphicsPixmapItem *bg;
QGraphicsPixmapItem *leftWing;
QGraphicsPixmapItem *rightWing;
};
-class DiveHandler : public QObject, public QGraphicsEllipseItem{
-Q_OBJECT
+class DiveHandler : public QObject, public QGraphicsEllipseItem {
+ Q_OBJECT
public:
DiveHandler();
+
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent* event);
- void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
+
private:
int parentIndex();
-public slots:
+public
+slots:
void selfRemove();
void changeGas();
};
-class Ruler : public QGraphicsLineItem{
+class Ruler : public QGraphicsLineItem {
public:
Ruler();
~Ruler();
@@ -133,19 +152,19 @@ public:
void updateTicks();
double minimum() const;
double maximum() const;
- qreal valueAt(const QPointF& p);
- qreal percentAt(const QPointF& p);
+ qreal valueAt(const QPointF &p);
+ qreal percentAt(const QPointF &p);
qreal posAtValue(qreal value);
- void setColor(const QColor& color);
- void setTextColor(const QColor& color);
+ void setColor(const QColor &color);
+ void setTextColor(const QColor &color);
int unitSystem;
private:
void eraseAll();
Qt::Orientation orientation;
- QList<QGraphicsLineItem*> ticks;
- QList<QGraphicsSimpleTextItem*> labels;
+ QList<QGraphicsLineItem *> ticks;
+ QList<QGraphicsSimpleTextItem *> labels;
double min;
double max;
double interval;
@@ -156,19 +175,22 @@ private:
class DivePlannerGraphics : public QGraphicsView {
Q_OBJECT
public:
- DivePlannerGraphics(QWidget* parent = 0);
+ DivePlannerGraphics(QWidget *parent = 0);
+
protected:
- virtual void mouseDoubleClickEvent(QMouseEvent* event);
- virtual void showEvent(QShowEvent* event);
- virtual void resizeEvent(QResizeEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual void mousePressEvent(QMouseEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- bool isPointOutOfBoundaries(const QPointF& point);
+ virtual void mouseDoubleClickEvent(QMouseEvent *event);
+ virtual void showEvent(QShowEvent *event);
+ virtual void resizeEvent(QResizeEvent *event);
+ virtual void mouseMoveEvent(QMouseEvent *event);
+ virtual void mousePressEvent(QMouseEvent *event);
+ virtual void mouseReleaseEvent(QMouseEvent *event);
+ bool isPointOutOfBoundaries(const QPointF &point);
qreal fromPercent(qreal percent, Qt::Orientation orientation);
-public slots:
+public
+slots:
void settingsChanged();
-private slots:
+private
+slots:
void keyEscAction();
void keyDeleteAction();
void keyUpAction();
@@ -180,17 +202,18 @@ private slots:
void decreaseTime();
void decreaseDepth();
void drawProfile();
- void pointInserted(const QModelIndex&, int start, int end);
- void pointsRemoved(const QModelIndex&, int start, int end);
+ void pointInserted(const QModelIndex &, int start, int end);
+ void pointsRemoved(const QModelIndex &, int start, int end);
+
private:
- void moveActiveHandler(const QPointF& MappedPos, const int pos);
+ void moveActiveHandler(const QPointF &MappedPos, const int pos);
/* This are the lines of the plotted dive. */
- QList<QGraphicsLineItem*> lines;
+ QList<QGraphicsLineItem *> lines;
/* This is the user-entered handles. */
QList<DiveHandler *> handles;
- QList<QGraphicsSimpleTextItem*> gases;
+ QList<QGraphicsSimpleTextItem *> gases;
/* those are the lines that follows the mouse. */
QGraphicsLineItem *verticalLine;
@@ -219,8 +242,8 @@ private:
ExpanderGraphics *timeHandler;
int minMinutes; // this holds the minimum requested window time
- int minDepth; // this holds the minimum requested window depth
- int dpMaxTime; // this is the time of the dive calculated by the deco.
+ int minDepth; // this holds the minimum requested window depth
+ int dpMaxTime; // this is the time of the dive calculated by the deco.
friend class DiveHandler;
};
@@ -230,13 +253,15 @@ private:
class DivePlannerWidget : public QWidget {
Q_OBJECT
public:
- explicit DivePlannerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
+ explicit DivePlannerWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
-public slots:
+public
+slots:
void settingsChanged();
- void atmPressureChanged(const QString& pressure);
- void bottomSacChanged(const QString& bottomSac);
- void decoSacChanged(const QString& decosac);
+ void atmPressureChanged(const QString &pressure);
+ void bottomSacChanged(const QString &bottomSac);
+ void decoSacChanged(const QString &decosac);
+
private:
Ui::DivePlanner ui;
};