diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-09-12 17:34:50 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-09-13 13:57:38 +0000 |
commit | b5615f571396365a07f123695a05be66c572f622 (patch) | |
tree | 5856c73757db2bc90d48c7c136f2bbd47d1abc35 /src/location/maps | |
parent | a9e561489044b7906b6a660d20d4685d235f43e2 (diff) | |
download | qtlocation-b5615f571396365a07f123695a05be66c572f622.tar.gz |
Add QGeoMapParameter::hasProperty
Convenience method to test if a property is present.
Change-Id: I01c6748e35aadfd89eecebf8b8cc64a278bba87f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps')
-rw-r--r-- | src/location/maps/qgeomapparameter.cpp | 6 | ||||
-rw-r--r-- | src/location/maps/qgeomapparameter_p.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/location/maps/qgeomapparameter.cpp b/src/location/maps/qgeomapparameter.cpp index b1d6f060..1b3f0829 100644 --- a/src/location/maps/qgeomapparameter.cpp +++ b/src/location/maps/qgeomapparameter.cpp @@ -98,5 +98,11 @@ QVariantMap QGeoMapParameter::toVariantMap() const return res; } +bool QGeoMapParameter::hasProperty(const char *propertyName) +{ + return metaObject()->indexOfProperty(propertyName) != -1 + || dynamicPropertyNames().indexOf(QByteArray(propertyName)) != -1; +} + QT_END_NAMESPACE diff --git a/src/location/maps/qgeomapparameter_p.h b/src/location/maps/qgeomapparameter_p.h index 413b420e..c6bbef44 100644 --- a/src/location/maps/qgeomapparameter_p.h +++ b/src/location/maps/qgeomapparameter_p.h @@ -74,6 +74,7 @@ public: void updateProperty(const char *propertyName, QVariant value); QVariantMap toVariantMap() const; + bool hasProperty(const char *propertyName); Q_SIGNALS: void propertyUpdated(QGeoMapParameter *param, const char *propertyName); |