QGeoView  1.0
QGeoView documentation
QGVWidget.h
1 /***************************************************************************
2  * QGeoView is a Qt / C ++ widget for visualizing geographic data.
3  * Copyright (C) 2018-2025 Andrey Yaroshenko.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, see https://www.gnu.org/licenses.
17  ****************************************************************************/
18 
19 #pragma once
20 
21 #include <QSet>
22 #include <QWidget>
23 
24 #include "QGVGlobal.h"
25 #include "QGVMap.h"
26 
27 class QGV_LIB_DECL QGVWidget : public QWidget
28 {
29  Q_OBJECT
30 
31 public:
32  QGVWidget();
33  virtual ~QGVWidget();
34 
35  void setMap(QGVMap* geoMap);
36  QGVMap* getMap() const;
37 
38  void setAnchor(QPoint anchor, QSet<Qt::Edge> edge);
39  QPointF getAnchor() const;
40  QSet<Qt::Edge> getEdge() const;
41 
42  bool isAnchorLeft() const;
43  bool isAnchorRight() const;
44  bool isAnchorHCenter() const;
45 
46  bool isAnchorTop() const;
47  bool isAnchorBottom() const;
48  bool isAnchorVCenter() const;
49 
50  void anchoreWidget();
51 
52  virtual void onProjection(QGVMap* geoMap);
53  virtual void onCamera(const QGVCameraState& oldState, const QGVCameraState& newState);
54 
55 protected:
56  void resizeEvent(QResizeEvent* event) override;
57 
58 private:
59  QGVMap* mGeoMap;
60  QPoint mAnchor;
61  QSet<Qt::Edge> mEdge;
62 };
Definition: QGVCamera.h:30
Definition: QGVMap.h:35
Definition: QGVWidget.h:28