QGeoView  1.0
QGeoView documentation
QGVDrawItem.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 "QGVGlobal.h"
22 #include "QGVItem.h"
23 #include "QGVMap.h"
24 #include "QGVMapQGItem.h"
25 
26 class QGV_LIB_DECL QGVDrawItem : public QGVItem
27 {
28  Q_OBJECT
29  Q_PROPERTY(QGV::ItemFlags flags READ getFlags WRITE setFlags)
30 
31 public:
32  QGVDrawItem();
33 
34  void setFlags(QGV::ItemFlags flags);
35  void setFlag(QGV::ItemFlag flag, bool enabled = true);
36  QGV::ItemFlags getFlags() const;
37  bool isFlag(QGV::ItemFlag flag) const;
38 
39  void refresh();
40  void repaint();
41  void resetBoundary();
42  QTransform effectiveTransform() const;
43 
44  virtual QPainterPath projShape() const = 0;
45  virtual void projPaint(QPainter* painter) = 0;
46  virtual QPointF projAnchor() const;
47  virtual QTransform projTransform() const;
48  virtual QString projTooltip(const QPointF& projPos) const;
49  virtual QString projDebug();
50  virtual void projOnFlags();
51  virtual void projOnMouseClick(const QPointF& projPos);
52  virtual void projOnMouseDoubleClick(const QPointF& projPos);
53  virtual void projOnObjectStartMove(const QPointF& projPos);
54  virtual void projOnObjectMovePos(const QPointF& projPos);
55  virtual void projOnObjectStopMove(const QPointF& projPos);
56 
57 protected:
58  void onProjection(QGVMap* geoMap) override;
59  void onCamera(const QGVCameraState& oldState, const QGVCameraState& newState) override;
60  void onUpdate() override;
61  void onClean() override;
62 
63 private:
64  QGV::ItemFlags mFlags;
65  QScopedPointer<QGVMapQGItem> mQGDrawItem;
66  bool mDirty;
67 };
Definition: QGVCamera.h:30
Definition: QGVDrawItem.h:27
Definition: QGVItem.h:25
Definition: QGVMap.h:35