SafeArea.h 1.02 KB
Newer Older
1 2
#pragma once

3
#include "GeoArea.h"
4 5
#include <QObject>

6
class SafeArea : public GeoArea {
7 8
  Q_OBJECT
public:
9 10 11
  SafeArea(QObject *parent = nullptr);
  SafeArea(const SafeArea &other, QObject *parent);
  SafeArea &operator=(const SafeArea &other);
12 13 14 15

  Q_PROPERTY(
      QGeoCoordinate depot READ depotQml WRITE setDepot NOTIFY depotChanged)

16
  // Overrides from GeoArea
17 18 19
  QString mapVisualQML(void) const override;
  QString editorQML(void) const override;
  SafeArea *clone(QObject *parent = nullptr) const;
20
  bool saveToJson(QJsonObject &json) override;
21
  bool loadFromJson(const QJsonObject &json, QString &errorString) override;
22
  Q_INVOKABLE virtual bool isCorrect();
23 24 25

  // Property acessors
  const QGeoCoordinate &depot(void) const;
26
  bool setDepot(const QGeoCoordinate &newDepot);
27 28 29
  QGeoCoordinate depotQml(void) const;

  // static Members
30
  static const char *nameString;
31

32 33
signals:
  void depotChanged(void);
34 35
private slots:
  void putDepotInside();
36 37 38 39 40 41 42 43

private:
  // Member Methodes
  void init();

  // Members
  QGeoCoordinate _depot;
};