diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-09 12:30:18 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-14 13:20:00 +0200 |
commit | e96f4fc0957d936385a086cf9b0882b62bcebad3 (patch) | |
tree | 6f8360e5b94842558ec768cb81abd4a313a2f78c /src/imports/location/location.cpp | |
parent | 1732bdf40518194d0ee5e0f009de3409dce6280d (diff) | |
download | qtlocation-e96f4fc0957d936385a086cf9b0882b62bcebad3.tar.gz |
Register QPlaceRatings as a value type
Make QPlaceUser a gadget, and register it as a value type with the QML
engine. Remove declarative wrapper, and consolidate the documentation.
To support QML tests setting ratings properties from literal values,
register a converter from QJSValue. That is temporary and will become
obsolete once the QML engine can property-initialize, and perhaps even
instantiate, value types.
Adjust the tests and remove tests that verify that the type behaves like
an object. This is not entirely complete (some tests still compare
Place.ratings with `null`, but those tests pass for now, and will be
changed in later commits when more types get converted in this way.
Task-number: QTBUG-106482
Change-Id: I3694df414bb87adcfda3dc4b88e5206d4272bb82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/imports/location/location.cpp')
-rw-r--r-- | src/imports/location/location.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp index a11a7aac..91680661 100644 --- a/src/imports/location/location.cpp +++ b/src/imports/location/location.cpp @@ -62,7 +62,6 @@ #include <QtLocation/private/qdeclarativeplace_p.h> #include <QtLocation/private/qdeclarativeplaceattribute_p.h> #include <QtLocation/private/qdeclarativeplaceicon_p.h> -#include <QtLocation/private/qdeclarativeratings_p.h> #include <QtLocation/private/qdeclarativesupplier_p.h> #include <QtLocation/private/qdeclarativecontactdetail_p.h> @@ -191,7 +190,6 @@ public: qmlRegisterType<QDeclarativePlaceImageModel >(uri, major, minor, "ImageModel"); qmlRegisterType<QDeclarativePlace >(uri, major, minor, "Place"); qmlRegisterType<QDeclarativePlaceIcon >(uri, major, minor, "Icon"); - qmlRegisterType<QDeclarativeRatings >(uri, major, minor, "Ratings"); qmlRegisterType<QDeclarativeReviewModel >(uri, major, minor, "ReviewModel"); qmlRegisterType<QDeclarativeSupplier >(uri, major, minor, "Supplier"); qmlRegisterType<QDeclarativeRectangleMapItem >(uri, major, minor, "MapRectangle"); @@ -275,10 +273,11 @@ public: qRegisterMetaType<QPlaceCategory>(); qRegisterMetaType<QPlace>(); qRegisterMetaType<QPlaceIcon>(); - qRegisterMetaType<QPlaceRatings>(); qRegisterMetaType<QPlaceSupplier>(); qRegisterMetaType<QPlaceAttribute>(); qRegisterMetaType<QPlaceContactDetail>(); + + registerConverterToGadget<QPlaceRatings>(); } else { qDebug() << "Unsupported URI given to load location QML plugin: " << QLatin1String(uri); } |