2022-02-10 14:27:04 +08:00
|
|
|
#ifndef VIRTUALMARGIN_H
|
|
|
|
|
#define VIRTUALMARGIN_H
|
|
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
|
#include <QPainter>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include "pointlatlng.h"
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include "mapgraphicitem.h"
|
|
|
|
|
|
|
|
|
|
namespace mapcontrol {
|
|
|
|
|
|
|
|
|
|
#ifdef QtopmapWidget
|
|
|
|
|
#include <mapwidgetglobal.h>
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT VirtualMargin : public QObject, public QGraphicsItem {
|
|
|
|
|
#else
|
|
|
|
|
class VirtualMargin : public QObject, public QGraphicsItem {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
Q_OBJECT Q_INTERFACES(QGraphicsItem)
|
|
|
|
|
public:
|
2022-06-15 18:52:14 +08:00
|
|
|
enum { Type = UserType + 11 };
|
2022-02-10 14:27:04 +08:00
|
|
|
VirtualMargin(int index,internals::PointLatLng const & coord, int const & altitude, QBrush color, MapGraphicItem *map);
|
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget);
|
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
|
int type() const;
|
|
|
|
|
internals::PointLatLng coord;
|
|
|
|
|
int number;
|
|
|
|
|
private:
|
|
|
|
|
QBrush m_brush;
|
|
|
|
|
MapGraphicItem *m_map;
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void setPosSLOT();
|
|
|
|
|
|
|
|
|
|
void RefreshPos();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
void localPositionChanged(QPointF point, VirtualMargin *p);
|
|
|
|
|
void aboutToBeDeleted(VirtualMargin *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#endif // VIRTUALMARGIN_H
|