diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-08-30 15:07:08 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-01 11:56:47 +0200 |
commit | da10ee9b67aaf0c9218c2b891efa06b323866470 (patch) | |
tree | 1ee258c51a87d04ce759c09d039bea00dfd0410c /src/location/maps/qgeomaneuver.h | |
parent | 7b3531ec887fdd2ccdd26d904757a314aed6e352 (diff) | |
download | qtlocation-da10ee9b67aaf0c9218c2b891efa06b323866470.tar.gz |
Remove QDeclarativeGeoManeuver
Register the QGeoManeuver type directly as the RouteManeuver
QML type, and use it in QDeclarativeGeoRouteSegment.
The type is now uncreatable. It wasn't in Qt 5.15, but since there is no
setter-API that is exposed to QML (QDeclarativeGeoRouteSegment::maneuver
is a read-only property tagged as CONSTANT), there is no point in
creating a RouteManeuver object in QML anyway. The QML tests can get a
default-created QGeoManeuever from an empty route segment.
Document the C++ properties via \property, move the QML type
documentation into the qgeomaneuver.cpp file, and unify the language.
Note: The QML type should be routeManeuver, as value types should start
with a lower-case character. If we make that change, it will be in a
separate, compatibility-breaking commit for all the value types.
Pick-to: 6.2
Change-Id: I277e7011f2082e2da9e0141db9bad0a60a524c88
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/location/maps/qgeomaneuver.h')
-rw-r--r-- | src/location/maps/qgeomaneuver.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/location/maps/qgeomaneuver.h b/src/location/maps/qgeomaneuver.h index 389c8824..d6856b24 100644 --- a/src/location/maps/qgeomaneuver.h +++ b/src/location/maps/qgeomaneuver.h @@ -42,6 +42,7 @@ #include <QtCore/QObject> #include <QtCore/qshareddata.h> +#include <QtQml/qqml.h> #include <QtLocation/qlocationglobal.h> QT_BEGIN_NAMESPACE @@ -64,6 +65,9 @@ class Q_LOCATION_EXPORT QGeoManeuver Q_PROPERTY(qreal distanceToNextInstruction READ distanceToNextInstruction CONSTANT) Q_PROPERTY(QGeoCoordinate waypoint READ waypoint CONSTANT) Q_PROPERTY(QVariantMap extendedAttributes READ extendedAttributes CONSTANT) + + QML_NAMED_ELEMENT(RouteManeuver) + public: enum InstructionDirection { NoDirection, @@ -124,6 +128,11 @@ private: bool isEqual(const QGeoManeuver &other) const; }; +Q_DECLARE_SHARED(QGeoManeuver) + QT_END_NAMESPACE +Q_DECLARE_METATYPE(QGeoManeuver) +Q_DECLARE_METATYPE(QGeoManeuver::InstructionDirection) + #endif |