diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-29 12:49:07 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-30 13:02:41 +0200 |
commit | 7779e6a05cde72320e47cf4d5ebed78b9e049226 (patch) | |
tree | 811c072c622b8f1e9cad5c883dd44b993549a5f3 /src/location/places | |
parent | 71a057951c6ae679c9133261e332983f4b630cbf (diff) | |
download | qtlocation-7779e6a05cde72320e47cf4d5ebed78b9e049226.tar.gz |
Declare value types as structured values, remove workarounds
Use QML's new support for initializing structured values, adjust tests,
and remove the now unnecessary conversion functions.
Change-Id: I7007c9acb50f4a9532a9eed847b1b4dd0928ba34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/location/places')
-rw-r--r-- | src/location/places/qplaceattribute.h | 1 | ||||
-rw-r--r-- | src/location/places/qplacecontactdetail.h | 1 | ||||
-rw-r--r-- | src/location/places/qplaceicon.h | 2 | ||||
-rw-r--r-- | src/location/places/qplaceratings.h | 2 | ||||
-rw-r--r-- | src/location/places/qplacesupplier.h | 2 | ||||
-rw-r--r-- | src/location/places/qplaceuser.h | 2 |
6 files changed, 10 insertions, 0 deletions
diff --git a/src/location/places/qplaceattribute.h b/src/location/places/qplaceattribute.h index 5e628f26..6d8820d8 100644 --- a/src/location/places/qplaceattribute.h +++ b/src/location/places/qplaceattribute.h @@ -56,6 +56,7 @@ class Q_LOCATION_EXPORT QPlaceAttribute { Q_GADGET QML_VALUE_TYPE(placeAttribute) + QML_STRUCTURED_VALUE Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString text READ text WRITE setText) diff --git a/src/location/places/qplacecontactdetail.h b/src/location/places/qplacecontactdetail.h index 5801a1f0..4467c1f4 100644 --- a/src/location/places/qplacecontactdetail.h +++ b/src/location/places/qplacecontactdetail.h @@ -56,6 +56,7 @@ class Q_LOCATION_EXPORT QPlaceContactDetail { Q_GADGET QML_VALUE_TYPE(contactDetail) + QML_STRUCTURED_VALUE Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString value READ value WRITE setValue) diff --git a/src/location/places/qplaceicon.h b/src/location/places/qplaceicon.h index 2360553c..f39b5ea6 100644 --- a/src/location/places/qplaceicon.h +++ b/src/location/places/qplaceicon.h @@ -59,6 +59,8 @@ class Q_LOCATION_EXPORT QPlaceIcon { Q_GADGET QML_VALUE_TYPE(icon) + QML_STRUCTURED_VALUE + Q_PROPERTY(QVariantMap parameters READ parameters WRITE setParameters) Q_PROPERTY(QPlaceManager *manager READ manager WRITE setManager) diff --git a/src/location/places/qplaceratings.h b/src/location/places/qplaceratings.h index 6a73fb9a..396ac1b8 100644 --- a/src/location/places/qplaceratings.h +++ b/src/location/places/qplaceratings.h @@ -54,6 +54,8 @@ class Q_LOCATION_EXPORT QPlaceRatings { Q_GADGET QML_VALUE_TYPE(ratings) + QML_STRUCTURED_VALUE + Q_PROPERTY(qreal average READ average WRITE setAverage) Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum) Q_PROPERTY(int count READ count WRITE setCount) diff --git a/src/location/places/qplacesupplier.h b/src/location/places/qplacesupplier.h index 81a4aff5..e9a942ec 100644 --- a/src/location/places/qplacesupplier.h +++ b/src/location/places/qplacesupplier.h @@ -56,6 +56,8 @@ class Q_LOCATION_EXPORT QPlaceSupplier { Q_GADGET QML_VALUE_TYPE(supplier) + QML_STRUCTURED_VALUE + Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QString supplierId READ supplierId WRITE setSupplierId) Q_PROPERTY(QUrl url READ url WRITE setUrl) diff --git a/src/location/places/qplaceuser.h b/src/location/places/qplaceuser.h index 6dcca89b..871ad95b 100644 --- a/src/location/places/qplaceuser.h +++ b/src/location/places/qplaceuser.h @@ -54,6 +54,8 @@ class Q_LOCATION_EXPORT QPlaceUser { Q_GADGET QML_VALUE_TYPE(user) + QML_STRUCTURED_VALUE + Q_PROPERTY(QString userId READ userId WRITE setUserId) Q_PROPERTY(QString name READ name WRITE setName) |