In MVC architecture, this is the controller for the corresponding NorthArrow
view. More...
Header: | #include <NorthArrowController> |
Inherits: | QObject |
Properties
Public Functions
NorthArrowController(QObject *parent = nullptr) | |
virtual | ~NorthArrowController() |
QObject * | geoView() const |
double | heading() const |
void | setGeoView(QObject *geoView) |
Public Slots
void | setHeading(double heading) |
Signals
void | geoViewChanged() |
void | headingChanged() |
Detailed Description
This controller calculates the current heading from a GeoView, and allows the NorthArrow
to apply a given heading to the GeoView.
Property Documentation
geoView : QObject*
Access functions:
QObject * | geoView() const |
void | setGeoView(QObject *geoView) |
Notifier signal:
void | geoViewChanged() |
[read-only]
heading : const double
Access functions:
double | heading() const |
Notifier signal:
void | headingChanged() |
Member Function Documentation
[invokable]
NorthArrowController::NorthArrowController (QObject *parent = nullptr)
Constructor
- parent Parent owning
QObject
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
[virtual]
NorthArrowController::~NorthArrowController ()
Destructor.
QObject *NorthArrowController::geoView () const
Returns the GeoView
as a QObject
.
Note: Getter function for property geoView.
See also setGeoView().
[signal]
void NorthArrowController::geoViewChanged ()
Emitted when the geoView changes.
Note: Notifier signal for property geoView.
double NorthArrowController::heading() const
Returns the calculated heading of this controller in degrees.
Note: Getter function for property heading.
See also setHeading().
[signal]
void NorthArrowController::headingChanged ()
Emitted when the heading changes.
Note: Notifier signal for property heading.
void NorthArrowController::setGeoView (QObject *geoView )
Set the GeoView
object this Controller uses.
Internally this is cast to a MapView
or SceneView using qobject_cast
, which is why the paremeter is of form QObject
and not GeoView
.
- geoView Object which must inherit from
GeoView*
andQObject*
.
Note: Setter function for property geoView.
See also geoView().
[slot]
void NorthArrowController::setHeading (double heading)
Set the heading by rotating the MapView
or SceneView
camera to the given heading (in degrees).
See also heading().