67 :
m_active(0), m_componentComplete(0), m_parametersInitialized(0),
68 m_startRequested(0), m_defaultSourceUsed(0), m_regularUpdates(0),
69 m_singleUpdate(0), m_singleUpdateRequested(0)
102 return m_source !=
nullptr;
112 return m_source ? m_source->updateInterval() : m_updateInterval;
156 return m_source ? m_source->sourceName() : m_name;
170 return QQmlListProperty<QDeclarativePluginParameter>(
this,
nullptr,
187 return m_satellitesInUse;
198 return m_satellitesInView;
206 const auto oldInterval = m_updateInterval;
213 m_updateInterval = m_source->updateInterval();
217 if (oldInterval != m_updateInterval)
234 if ((m_name ==
name) || (
name.isEmpty() && m_defaultSourceUsed))
237 if (m_componentComplete && m_parametersInitialized) {
247 m_componentComplete =
true;
248 m_parametersInitialized =
true;
250 if (!
p->isInitialized()) {
251 m_parametersInitialized =
false;
253 this, &QDeclarativeSatelliteSource::onParameterInitialized,
258 if (m_parametersInitialized)
259 createSource(m_name);
272 return m_source->setBackendProperty(
name,
value);
285 return m_source ? m_source->backendProperty(
name) :
QVariant{};
306 if (m_componentComplete && m_parametersInitialized) {
309 m_singleUpdateDesiredTimeout =
timeout;
310 m_singleUpdateRequested =
true;
325 if (m_componentComplete && m_parametersInitialized)
328 m_startRequested =
true;
342 m_source->stopUpdates();
343 m_regularUpdates =
false;
345 if (m_active && !m_singleUpdate) {
350 m_startRequested =
false;
356 const auto oldError = m_error;
358 if (m_error != oldError)
363 if (m_singleUpdate) {
364 m_singleUpdate =
false;
365 if (m_active && !m_regularUpdates) {
372void QDeclarativeSatelliteSource::onParameterInitialized()
374 m_parametersInitialized =
true;
376 if (!
p->isInitialized()) {
377 m_parametersInitialized =
false;
383 if (m_parametersInitialized)
384 createSource(m_name);
387void QDeclarativeSatelliteSource::satellitesInViewUpdateReceived(
const QList<QGeoSatelliteInfo> &satellites)
389 m_satellitesInView = satellites;
391 handleSingleUpdateReceived();
394void QDeclarativeSatelliteSource::satellitesInUseUpdateReceived(
const QList<QGeoSatelliteInfo> &satellites)
396 m_satellitesInUse = satellites;
398 handleSingleUpdateReceived();
401QVariantMap QDeclarativeSatelliteSource::parameterMap()
const
404 for (
const auto *parameter :
std::as_const(m_parameters))
409void QDeclarativeSatelliteSource::createSource(
const QString &newName)
411 if (m_source && m_source->sourceName() == newName)
414 const auto oldName =
name();
415 const bool oldIsValid =
isValid();
420 m_source->disconnect(
this);
421 m_source->stopUpdates();
422 m_source.reset(
nullptr);
426 if (!newName.isEmpty()) {
428 m_defaultSourceUsed =
false;
431 m_defaultSourceUsed =
true;
436 this, &QDeclarativeSatelliteSource::sourceErrorReceived);
438 this, &QDeclarativeSatelliteSource::satellitesInViewUpdateReceived);
440 this, &QDeclarativeSatelliteSource::satellitesInUseUpdateReceived);
442 m_name = m_source->sourceName();
443 m_source->setUpdateInterval(m_updateInterval);
444 m_updateInterval = m_source->updateInterval();
447 m_defaultSourceUsed =
false;
450 if (oldName !=
name())
462 if (m_startRequested) {
463 m_startRequested =
false;
466 if (m_singleUpdateRequested) {
467 m_singleUpdateRequested =
false;
468 executeSingleUpdate(m_singleUpdateDesiredTimeout);
472void QDeclarativeSatelliteSource::handleSingleUpdateReceived()
474 if (m_singleUpdate) {
475 m_singleUpdate =
false;
476 if (m_active && !m_regularUpdates) {
483void QDeclarativeSatelliteSource::executeStart()
486 m_regularUpdates =
true;
491 m_source->startUpdates();
495void QDeclarativeSatelliteSource::executeSingleUpdate(
int timeout)
498 m_singleUpdate =
true;
503 m_source->requestUpdate(
timeout);
507void QDeclarativeSatelliteSource::parameter_append(PluginParameterProperty *prop,
514qsizetype QDeclarativeSatelliteSource::parameter_count(PluginParameterProperty *prop)
520QDeclarativeSatelliteSource::parameter_at(PluginParameterProperty *prop,
qsizetype index)
525void QDeclarativeSatelliteSource::parameter_clear(PluginParameterProperty *prop)
void stop()
\qmlmethod SatelliteSource::stop()
QDeclarativeSatelliteSource()
\qmltype SatelliteSource \inqmlmodule QtPositioning
QList< QGeoSatelliteInfo > satellitesInUse
void start()
\qmlmethod SatelliteSource::start()
void satellitesInViewChanged()
void updateIntervalChanged()
void update(int timeout=0)
\qmlmethod SatelliteSource::update(int timeout = 0)
void setUpdateInterval(int updateInterval)
void satellitesInUseChanged()
void sourceErrorChanged()
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
bool isValid() const
\qmlproperty bool SatelliteSource::valid \readonly
void setActive(bool active)
QQmlListProperty< QDeclarativePluginParameter > parameters
\qmlproperty list<PluginParameter> SatelliteSource::parameters \readonly \qmldefault
bool isActive() const
\qmlproperty bool SatelliteSource::active
void setName(const QString &name)
Q_INVOKABLE QVariant backendProperty(const QString &name) const
\qmlmethod var SatelliteSource::backendProperty(string name)
~QDeclarativeSatelliteSource()
QList< QGeoSatelliteInfo > satellitesInView
Q_INVOKABLE bool setBackendProperty(const QString &name, const QVariant &value)
\qmlmethod bool SatelliteSource::setBackendProperty(string name, var value)
static QGeoSatelliteInfoSource * createSource(const QString &sourceName, QObject *parent)
Creates and returns a source with the given parent, by loading the plugin named sourceName.
Error
The Error enumeration represents the errors which can occur.
static QGeoSatelliteInfoSource * createDefaultSource(QObject *parent)
Creates and returns a source with the specified parent that reads from the system's default source of...
void satellitesInViewUpdated(const QList< QGeoSatelliteInfo > &satellites)
If startUpdates() or requestUpdate() is called, this signal is emitted when an update is available on...
void satellitesInUseUpdated(const QList< QGeoSatelliteInfo > &satellites)
If startUpdates() or requestUpdate() is called, this signal is emitted when an update is available on...
void errorOccurred(QGeoSatelliteInfoSource::Error)
This signal is emitted after an error occurred.
qsizetype size() const noexcept
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
QMap< QString, QString > map
[6]
cache insert(employee->id(), employee)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLbitfield GLuint64 timeout
[4]