dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
mapline.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef MAPLINE_H
28 #define MAPLINE_H
29 
30 #include "mapgraphicitem.h"
31 #include "mappointitem.h"
32 #include "../core/corecommon.h"
33 
34 namespace mapcontrol
35 {
36 class HomeItem;
37 
38 class TLMAPWIDGET_EXPORT MapLine : public QObject, public QGraphicsLineItem
39 {
40  Q_OBJECT
41  Q_INTERFACES(QGraphicsItem)
42 public:
43  enum { Type = UserType + 8 };
44  MapLine(MapPointItem *from, MapPointItem *to, MapGraphicItem *map, QColor color=Qt::green);
45  MapLine(HomeItem *from, MapPointItem *to, MapGraphicItem *map, QColor color=Qt::green);
46  int type() const;
47  QPainterPath shape() const;
48  void setColor(const QColor &color)
49  { myColor = color; }
50 private:
51  QGraphicsItem * source;
52  QGraphicsItem * destination;
53  MapGraphicItem * my_map;
54  QPolygonF arrowHead;
55  QColor myColor;
56 protected:
57  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
58 public slots:
59  void refreshLocations();
60  void pointdeleted();
61  void setOpacitySlot(qreal opacity);
62 };
63 }
64 #endif // MAPLINE_H
A graphicsItem representing a MapPointItem.
The main graphicsItem used on the widget, contains the map and map logic.
The main graphicsItem used on the widget, contains the map and map logic.
A QGraphicsItem representing a MapPointItem.
Definition: mappointitem.h:56