diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-11-09 19:07:35 +0100 |
---|---|---|
committer | Lauri Laanmets <lauri.laanmets@eesti.ee> | 2022-02-28 17:11:45 +0200 |
commit | c63154ae7525b4ee45d324f5c72c78f4885f16cc (patch) | |
tree | b3e6e3ced3db271688b20a08165ac5b2755ebf3b | |
parent | e40cd29cff975a5d564de87e1a6f0c7341bcdbd5 (diff) | |
download | qtlocation-c63154ae7525b4ee45d324f5c72c78f4885f16cc.tar.gz |
Fix warnings for Windows build
Task-number: QTBUG-96795
Change-Id: Ia5fe6f24f06f18141923d9466d7b2d7651fd464b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
7 files changed, 16 insertions, 14 deletions
diff --git a/src/location/declarativemaps/locationvaluetypehelper.cpp b/src/location/declarativemaps/locationvaluetypehelper.cpp index a2bede8e..8f6208dc 100644 --- a/src/location/declarativemaps/locationvaluetypehelper.cpp +++ b/src/location/declarativemaps/locationvaluetypehelper.cpp @@ -76,7 +76,7 @@ QGeoCoordinate parseCoordinate(const QVariant &value, bool *ok) c = value.value<QGeoCoordinate>(); if (ok) *ok = true; - } else if (value.type() == QVariant::Map) { + } else if (value.typeId() == QMetaType::QVariantMap) { const QVariantMap &map = value.toMap(); if (map.contains(QStringLiteral("latitude"))) diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp index 29813681..7f5bd70a 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp @@ -667,7 +667,7 @@ void QDeclarativeGeocodeModel::setQuery(const QVariant &query) searchString_.clear(); coordinate_ = query.value<QGeoCoordinate>(); - } else if (query.type() == QVariant::String) { + } else if (query.typeId() == QMetaType::QString) { searchString_ = query.toString(); if (address_) { address_->disconnect(this); diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp index 121df65a..75d23119 100644 --- a/src/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/location/declarativeplaces/qdeclarativeplace.cpp @@ -421,7 +421,7 @@ QPlace QDeclarativePlace::place() QList<QPlaceContactDetail> cppDetails; foreach (const QString &key, m_contactDetails->keys()) { cppDetails.clear(); - if (m_contactDetails->value(key).type() == QVariant::List) { + if (m_contactDetails->value(key).typeId() == QMetaType::QVariantList) { QVariantList detailsVarList = m_contactDetails->value(key).toList(); foreach (const QVariant &detailVar, detailsVarList) { QDeclarativeContactDetail *detail = qobject_cast<QDeclarativeContactDetail *>(detailVar.value<QObject *>()); @@ -1213,7 +1213,7 @@ QString QDeclarativePlace::primaryValue(const QString &contactType) const if (value.userType() == qMetaTypeId<QJSValue>()) value = value.value<QJSValue>().toVariant(); - if (value.userType() == QVariant::List) { + if (value.userType() == QMetaType::QVariantList) { QVariantList detailList = m_contactDetails->value(contactType).toList(); if (!detailList.isEmpty()) { QDeclarativeContactDetail *primaryDetail = qobject_cast<QDeclarativeContactDetail *>(detailList.at(0).value<QObject *>()); diff --git a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp index ae457f66..78285e91 100644 --- a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp +++ b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp @@ -115,7 +115,7 @@ void QDeclarativeSearchModelBase::setSearchArea(const QVariant &searchArea) s = searchArea.value<QGeoCircle>(); else if (searchArea.userType() == qMetaTypeId<QGeoShape>()) s = searchArea.value<QGeoShape>(); - else if (int(searchArea.type()) == qMetaTypeId<QObject *>()) { + else if (searchArea.typeId() == qMetaTypeId<QObject *>()) { route = searchArea.value<QDeclarativeGeoRoute *>(); if (!route) return; diff --git a/src/location/labs/qmappolylineobject.cpp b/src/location/labs/qmappolylineobject.cpp index b2927694..4170877d 100644 --- a/src/location/labs/qmappolylineobject.cpp +++ b/src/location/labs/qmappolylineobject.cpp @@ -139,7 +139,7 @@ QGeoShape QMapPolylineObjectPrivate::geoShape() const void QMapPolylineObjectPrivate::setGeoShape(const QGeoShape &shape) { const QGeoPath p(shape); - if (p == path()) + if (p.path() == path()) return; setPath(p.path()); // to handle overrides diff --git a/src/location/labs/qsg/qmapcircleobjectqsg.cpp b/src/location/labs/qsg/qmapcircleobjectqsg.cpp index 824f0c3c..6935beff 100644 --- a/src/location/labs/qsg/qmapcircleobjectqsg.cpp +++ b/src/location/labs/qsg/qmapcircleobjectqsg.cpp @@ -233,8 +233,9 @@ QSGNode *QMapCircleObjectPrivateQSG::updateMapObjectNode(QSGNode *oldNode, QSGNode *QMapCircleObjectPrivateQSG::updateMapObjectNodeCPU(QSGNode *oldNode, VisibleNode **visibleNode, QSGNode *root, - QQuickWindow */*window*/) + QQuickWindow *window) { + Q_UNUSED(window); if (!m_dataCPU->m_node || !oldNode) { m_dataCPU->m_node = new MapPolygonNode(); *visibleNode = static_cast<VisibleNode *>(m_dataCPU->m_node); @@ -273,8 +274,9 @@ QSGNode *QMapCircleObjectPrivateQSG::updateMapObjectNodeCPU(QSGNode *oldNode, QSGNode *QMapCircleObjectPrivateQSG::updateMapObjectNodeGL(QSGNode *oldNode, VisibleNode **visibleNode, QSGNode *root, - QQuickWindow */*window*/) + QQuickWindow *window) { + Q_UNUSED(window); if (!m_dataGL->m_rootNode || !oldNode) { m_dataGL->m_rootNode = new QDeclarativePolygonMapItemPrivateOpenGL::RootNode(); m_dataGL->m_node = new MapPolygonNodeGL(); diff --git a/src/location/labs/qsg/qmapiconobjectqsg.cpp b/src/location/labs/qsg/qmapiconobjectqsg.cpp index f13e03d7..32924bf7 100644 --- a/src/location/labs/qsg/qmapiconobjectqsg.cpp +++ b/src/location/labs/qsg/qmapiconobjectqsg.cpp @@ -168,13 +168,13 @@ void QMapIconObjectPrivateQSG::setContent(const QVariant &content) // Then pull the new content QMapIconObjectPrivateDefault::setContent(content); - switch (content.type()) { - case QVariant::UserType: { + switch (content.typeId()) { + case QMetaType::User: { // TODO: Handle QObject subclasses -- first decide which ones break; } - case QVariant::String: - case QVariant::Url: { + case QMetaType::QString: + case QMetaType::QUrl: { // URL, including image/texture providers // Supporting only image providers for now const QUrl url = content.toUrl(); @@ -200,12 +200,12 @@ void QMapIconObjectPrivateQSG::setContent(const QVariant &content) break; } - case QVariant::ByteArray: { + case QMetaType::QByteArray: { // ToDo: Build the image from bytearray break; } default: - qWarning() << "Unsupported parameter type: " << content.type(); + qWarning() << "Unsupported parameter type: " << content.typeId(); break; } |