summaryrefslogtreecommitdiff
path: root/src/location/declarativeplaces/qdeclarativecategory_p.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-09 14:21:51 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 13:20:15 +0200
commit517e4f284e1808ecddc998d73b4b554880733381 (patch)
tree52e01d085fb0d7ca997ee1d25e1f9fa856fcd112 /src/location/declarativeplaces/qdeclarativecategory_p.h
parent1d8897b32148057246a779ad7cf18aeed1c2acc3 (diff)
downloadqtlocation-517e4f284e1808ecddc998d73b4b554880733381.tar.gz
Register QPlaceIcon as a QML value type
Make QPlaceIcon a gadget, and register it as a value type with the QML engine. Remove declarative wrapper, and consolidate the documentation. Adjust the tests and remove tests that verify that the type behaves like an object. Initialize placeIcon properties as a grouped property, or via a converter from QJSValue. That converter is a temporary solution to enable tests, and can hopefully be removed once the QML engine supports property-initialization of value types. Task-number: QTBUG-106482 Change-Id: I2aa29102ee232afb3d71396bcd3288e2f99c0fc6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/location/declarativeplaces/qdeclarativecategory_p.h')
-rw-r--r--src/location/declarativeplaces/qdeclarativecategory_p.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/location/declarativeplaces/qdeclarativecategory_p.h b/src/location/declarativeplaces/qdeclarativecategory_p.h
index 57fb49b5..e1d1dcc9 100644
--- a/src/location/declarativeplaces/qdeclarativecategory_p.h
+++ b/src/location/declarativeplaces/qdeclarativecategory_p.h
@@ -57,14 +57,12 @@
#include <QObject>
#include <QtLocation/qplacecategory.h>
+#include <QtLocation/qplaceicon.h>
#include <QtLocation/private/qdeclarativegeoserviceprovider_p.h>
-Q_MOC_INCLUDE(<QtLocation/private/qdeclarativeplaceicon_p.h>)
-
QT_BEGIN_NAMESPACE
-class QDeclarativePlaceIcon;
class QPlaceReply;
class QPlaceManager;
@@ -80,7 +78,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeCategory : public QObject, public QQ
Q_PROPERTY(QString categoryId READ categoryId WRITE setCategoryId NOTIFY categoryIdChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged)
- Q_PROPERTY(QDeclarativePlaceIcon *icon READ icon WRITE setIcon NOTIFY iconChanged)
+ Q_PROPERTY(QPlaceIcon icon READ icon WRITE setIcon NOTIFY iconChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_INTERFACES(QQmlParserStatus)
@@ -116,8 +114,8 @@ public:
Visibility visibility() const;
void setVisibility(Visibility visibility);
- QDeclarativePlaceIcon *icon() const;
- void setIcon(QDeclarativePlaceIcon *icon);
+ QPlaceIcon icon() const;
+ void setIcon(const QPlaceIcon &icon);
Q_INVOKABLE QString errorString() const;
@@ -143,7 +141,7 @@ private:
QPlaceManager *manager();
QPlaceCategory m_category;
- QDeclarativePlaceIcon *m_icon = nullptr;
+ QPlaceIcon m_icon;
QDeclarativeGeoServiceProvider *m_plugin = nullptr;
QPlaceReply *m_reply = nullptr;
bool m_complete = false;