diff options
Diffstat (limited to 'src/positioning/qgeopositioninfosource.cpp')
-rw-r--r-- | src/positioning/qgeopositioninfosource.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/positioning/qgeopositioninfosource.cpp b/src/positioning/qgeopositioninfosource.cpp index 29a0d019..69fcdef0 100644 --- a/src/positioning/qgeopositioninfosource.cpp +++ b/src/positioning/qgeopositioninfosource.cpp @@ -108,6 +108,11 @@ QGeoPositionInfoSourcePrivate *QGeoPositionInfoSourcePrivate::get(const QGeoPosi return source.d; } +QGeoPositionInfoSourcePrivate::~QGeoPositionInfoSourcePrivate() +{ + +} + void QGeoPositionInfoSourcePrivate::loadMeta() { metaData = plugins().value(providerName); @@ -128,6 +133,16 @@ void QGeoPositionInfoSourcePrivate::loadPlugin() factory = factoryV2; } +bool QGeoPositionInfoSourcePrivate::setBackendProperty(const QString &/*name*/, QVariant /*value*/) +{ + return false; +} + +QVariant QGeoPositionInfoSourcePrivate::backendProperty(const QString &/*name*/) const +{ + return QVariant(); +} + QHash<QString, QJsonObject> QGeoPositionInfoSourcePrivate::plugins(bool reload) { static QHash<QString, QJsonObject> plugins; @@ -216,6 +231,36 @@ QString QGeoPositionInfoSource::sourceName() const } /*! + Sets the backend-specific property named \a name to \a value. + Returns \c true on success, \c false otherwise. + Backend-specific properties can be used to configure the positioning subsystem behavior + at runtime. + Supported backend-specific properties are listed and described in + \l {Qt Positioning plugins#Default plugins}. + + \sa backendProperty + \since Qt 5.14 +*/ +bool QGeoPositionInfoSource::setBackendProperty(const QString &name, QVariant value) +{ + return d->setBackendProperty(name, value); +} + +/*! + Returns the value of the backend-specific property named \a name, if present. + Otherwise, the returned value will be invalid. + Supported backend-specific properties are listed and described in + \l {Qt Positioning plugins#Default plugins}. + + \sa setBackendProperty + \since Qt 5.14 +*/ +QVariant QGeoPositionInfoSource::backendProperty(const QString &name) const +{ + return d->backendProperty(name); +} + +/*! \property QGeoPositionInfoSource::updateInterval \brief This property holds the requested interval in milliseconds between each update. @@ -382,6 +427,15 @@ QStringList QGeoPositionInfoSource::availableSources() return plugins; } +QGeoPositionInfoSource::QGeoPositionInfoSource(QGeoPositionInfoSourcePrivate &dd, QObject *parent) +: QObject(parent), + d(&dd) +{ + qRegisterMetaType<QGeoPositionInfo>(); + d->interval = 0; + d->methods = NoPositioningMethods; +} + /*! \fn QGeoPositionInfo QGeoPositionInfoSource::lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const = 0; |