-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoint.h
39 lines (31 loc) · 865 Bytes
/
point.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef POINT_H
#define POINT_H
#include <QLabel>
#include <QWidget>
#include "latlon.h"
#include "pointmarker.h"
class Point : public QWidget
{
Q_OBJECT
public:
explicit Point(const LatLon &coord, const QString &label, QWidget *parent = 0);
LatLon coord() { return m_coord; }
QString label() { return m_label->text(); }
void setCoord(const LatLon &coord) { m_coord = coord; }
void setLabel(const QString &label);
void deselect() { m_marker->deselect(); }
signals:
void selectionChanged(Point *point, bool selected);
void moved(Point *point, QPoint delta);
private slots:
void selectionChanged(bool selected);
void dragStarted();
void dragMove(QPoint delta);
void dragFinished();
private:
PointMarker *m_marker;
QLabel *m_label;
LatLon m_coord;
QPoint m_dragStartPos;
};
#endif // POINT_H