dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
homeitem.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 HOMEITEM_H
28 #define HOMEITEM_H
29 
30 
31 #include "mappointitem.h"
32 #include "../core/corecommon.h"
33 
34 namespace mapcontrol
35 {
36 
37  class TLMAPWIDGET_EXPORT HomeItem:public MapPointItem
38  {
39  Q_OBJECT
40  Q_INTERFACES(QGraphicsItem)
41  public:
42  enum { Type = UserType + TYPE_HOMEITEM };
43  HomeItem(MapGraphicItem* map,TLMapWidget* parent);
44  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
45  QWidget *widget);
46  QRectF boundingRect() const;
47  int type() const;
48  bool ShowSafeArea()const{return showsafearea;}
49  void SetShowSafeArea(bool const& value){showsafearea=value;}
50  void SetToggleRefresh(bool const& value){toggleRefresh=value;}
51  int SafeArea()const{return safearea;}
52  void SetSafeArea(int const& value){safearea=value;}
53  bool safe;
54  virtual void SetCoord(internals::PointLatLng const& value){coord=value; emit absolutePositionChanged(value,Altitude());}
55  virtual void SetAltitude(float const& value){altitude=value; emit absolutePositionChanged(Coord(),Altitude());}
56  void RefreshToolTip();
57  private:
58 
59  TLMapWidget* mapwidget;
60  QPixmap pic;
61  core::Point localposition;
62  bool showsafearea;
63  bool toggleRefresh;
64  int safearea;
65  int localsafearea;
66  bool isDragging;
67  protected:
68  void mouseMoveEvent ( QGraphicsSceneMouseEvent * event );
69  void mousePressEvent ( QGraphicsSceneMouseEvent * event );
70  void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
71  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
72  public slots:
73  void RefreshPos();
74  void setOpacitySlot(qreal opacity);
75  signals:
76  void homedoubleclick(HomeItem* homeLocation);
77  };
78 }
79 #endif // HOMEITEM_H
A graphicsItem representing a MapPointItem.
The main graphicsItem used on the widget, contains the map and map logic.
A QGraphicsItem representing a MapPointItem.
Definition: mappointitem.h:56