summaryrefslogtreecommitdiff
path: root/src/positioning
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2021-03-26 17:16:40 +0100
committerIvan Solovev <ivan.solovev@qt.io>2021-04-27 12:39:59 +0200
commit4306cfe37696bcda7f371a472d70d81357986c6e (patch)
tree70aab197ed60a64a2b01dc74663ad900cc1a0bc4 /src/positioning
parent0b33da16756454fb724064d0742c9aa4a782e591 (diff)
downloadqtlocation-4306cfe37696bcda7f371a472d70d81357986c6e.tar.gz
QGeoSatelliteInfoSource: add property bindings
Task-number: QTBUG-89874 Change-Id: I390119d8f25d5523b879ac0c7eecd32cb04481d8 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/positioning')
-rw-r--r--src/positioning/qgeosatelliteinfosource.cpp10
-rw-r--r--src/positioning/qgeosatelliteinfosource.h5
-rw-r--r--src/positioning/qgeosatelliteinfosource_p.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/positioning/qgeosatelliteinfosource.cpp b/src/positioning/qgeosatelliteinfosource.cpp
index 9e80a1d2..2099dd9f 100644
--- a/src/positioning/qgeosatelliteinfosource.cpp
+++ b/src/positioning/qgeosatelliteinfosource.cpp
@@ -97,8 +97,6 @@ QGeoSatelliteInfoSourcePrivate::~QGeoSatelliteInfoSourcePrivate()
QGeoSatelliteInfoSource::QGeoSatelliteInfoSource(QObject *parent)
: QObject(*new QGeoSatelliteInfoSourcePrivate, parent)
{
- Q_D(QGeoSatelliteInfoSource);
- d->interval = 0;
}
QGeoSatelliteInfoSource::QGeoSatelliteInfoSource(QGeoSatelliteInfoSourcePrivate &dd, QObject *parent)
@@ -158,7 +156,13 @@ void QGeoSatelliteInfoSource::setUpdateInterval(int msec)
int QGeoSatelliteInfoSource::updateInterval() const
{
Q_D(const QGeoSatelliteInfoSource);
- return d->interval;
+ return d->interval.value();
+}
+
+QBindable<int> QGeoSatelliteInfoSource::bindableUpdateInterval()
+{
+ Q_D(QGeoSatelliteInfoSource);
+ return QBindable<int>(&d->interval);
}
/*!
diff --git a/src/positioning/qgeosatelliteinfosource.h b/src/positioning/qgeosatelliteinfosource.h
index 4e5d62ad..9d6603bb 100644
--- a/src/positioning/qgeosatelliteinfosource.h
+++ b/src/positioning/qgeosatelliteinfosource.h
@@ -50,7 +50,8 @@ class QGeoSatelliteInfoSourcePrivate;
class Q_POSITIONING_EXPORT QGeoSatelliteInfoSource : public QObject
{
Q_OBJECT
- Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
+ Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval BINDABLE
+ bindableUpdateInterval)
Q_PROPERTY(int minimumUpdateInterval READ minimumUpdateInterval)
public:
@@ -76,6 +77,8 @@ public:
virtual void setUpdateInterval(int msec);
int updateInterval() const;
+ QBindable<int> bindableUpdateInterval();
+
virtual int minimumUpdateInterval() const = 0;
virtual Error error() const = 0;
diff --git a/src/positioning/qgeosatelliteinfosource_p.h b/src/positioning/qgeosatelliteinfosource_p.h
index cfad6edc..48eb6be1 100644
--- a/src/positioning/qgeosatelliteinfosource_p.h
+++ b/src/positioning/qgeosatelliteinfosource_p.h
@@ -64,7 +64,7 @@ public:
static QGeoSatelliteInfoSource *createSourceReal(const QJsonObject &meta,
const QVariantMap &parameters,
QObject *parent);
- int interval;
+ Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QGeoSatelliteInfoSourcePrivate, int, interval, 0)
QString providerName;
};