• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • declarative
PositionSource.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #ifndef MARBLE_DECLARATIVE_POSITIONSOURCE_H
12 #define MARBLE_DECLARATIVE_POSITIONSOURCE_H
13 
14 #include "Coordinate.h"
15 
16 #include <QObject>
17 #if QT_VERSION < 0x050000
18  #include <QtDeclarative/qdeclarative.h>
19 #else
20  #include <QtQml/qqml.h>
21 #endif
22 
23 class MarbleWidget;
24 
25 class PositionSource : public QObject
26 {
27  Q_OBJECT
28 
29  Q_PROPERTY( MarbleWidget* map READ map WRITE setMap NOTIFY mapChanged )
30  Q_PROPERTY( bool active READ active WRITE setActive NOTIFY activeChanged )
31  Q_PROPERTY( QString source READ source WRITE setSource NOTIFY sourceChanged )
32  Q_PROPERTY( bool hasPosition READ hasPosition NOTIFY hasPositionChanged )
33  Q_PROPERTY( Coordinate* position READ position NOTIFY positionChanged )
34  Q_PROPERTY( qreal speed READ speed NOTIFY speedChanged )
35 
36 public:
37  explicit PositionSource( QObject* parent = 0);
38 
39  bool active() const;
40 
41  void setActive( bool active );
42 
43  QString source() const;
44 
45  void setSource( const QString &source );
46 
47  bool hasPosition() const;
48 
49  Coordinate* position();
50 
51  MarbleWidget *map();
52 
53  void setMap( MarbleWidget *map );
54 
55  qreal speed() const;
56 
57 Q_SIGNALS:
58  void mapChanged();
59 
60  void activeChanged();
61 
62  void sourceChanged();
63 
64  void hasPositionChanged();
65 
66  void positionChanged();
67 
68  void speedChanged();
69 
70 private Q_SLOTS:
71  void updatePosition();
72 
73 private:
74  void start();
75 
76  bool m_active;
77 
78  QString m_source;
79 
80  bool m_hasPosition;
81 
82  Coordinate m_position;
83 
84  QPointer<MarbleWidget> m_marbleWidget;
85 
86  qreal m_speed;
87 };
88 
89 #endif
PositionSource::source
QString source() const
PositionSource::hasPosition
bool hasPosition() const
PositionSource::activeChanged
void activeChanged()
PositionSource::map
MarbleWidget * map()
QPointer
Coordinate
Represents a coordinate with the properties of a name and coordinates.
Definition: Coordinate.h:28
PositionSource::position
Coordinate * position()
PositionSource::setMap
void setMap(MarbleWidget *map)
Definition: PositionSource.cpp:109
QObject
PositionSource
Definition: PositionSource.h:25
QString
PositionSource::hasPositionChanged
void hasPositionChanged()
PositionSource::setSource
void setSource(const QString &source)
Definition: PositionSource.cpp:60
PositionSource::positionChanged
void positionChanged()
PositionSource::active
bool active() const
Coordinate.h
PositionSource::speed
qreal speed() const
PositionSource::mapChanged
void mapChanged()
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
QObject::parent
QObject * parent() const
PositionSource::setActive
void setActive(bool active)
Definition: PositionSource.cpp:35
PositionSource::speedChanged
void speedChanged()
PositionSource::sourceChanged
void sourceChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal