diff options
Diffstat (limited to 'src/location')
53 files changed, 329 insertions, 329 deletions
diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp index 92d38a22..328eaae2 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp @@ -288,10 +288,10 @@ QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent) // ToDo: handle envvar, and switch implementation. m_itemType = QGeoMap::MapCircle; setFlag(ItemHasContents, true); - QObject::connect(&m_border, SIGNAL(colorChanged(QColor)), - this, SLOT(onLinePropertiesChanged())); - QObject::connect(&m_border, SIGNAL(widthChanged(qreal)), - this, SLOT(onLinePropertiesChanged())); + QObject::connect(&m_border, &QDeclarativeMapLineProperties::colorChanged, + this, &QDeclarativeCircleMapItem::onLinePropertiesChanged); + QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged, + this, &QDeclarativeCircleMapItem::onLinePropertiesChanged); // assume that circles are not self-intersecting // to speed up processing diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp index 7f5bd70a..8089ae0f 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp @@ -283,8 +283,8 @@ void QDeclarativeGeocodeModel::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (plugin_->isAttached()) { pluginReady(); } else { - connect(plugin_, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(plugin_, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeGeocodeModel::pluginReady); } } @@ -320,10 +320,10 @@ void QDeclarativeGeocodeModel::pluginReady() return; } - connect(geocodingManager, SIGNAL(finished(QGeoCodeReply*)), - this, SLOT(geocodeFinished(QGeoCodeReply*))); - connect(geocodingManager, SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString)), - this, SLOT(geocodeError(QGeoCodeReply*,QGeoCodeReply::Error,QString))); + connect(geocodingManager, &QGeoCodingManager::finished, + this, &QDeclarativeGeocodeModel::geocodeFinished); + connect(geocodingManager, &QGeoCodingManager::errorOccurred, + this, &QDeclarativeGeocodeModel::geocodeError); if (complete_ && autoUpdate_) update(); @@ -682,14 +682,22 @@ void QDeclarativeGeocodeModel::setQuery(const QVariant &query) searchString_.clear(); address_ = address; - connect(address_, SIGNAL(countryChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(countryCodeChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(stateChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(countyChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(cityChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(districtChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(streetChanged()), this, SLOT(queryContentChanged())); - connect(address_, SIGNAL(postalCodeChanged()), this, SLOT(queryContentChanged())); + connect(address_, &QDeclarativeGeoAddress::countryChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::countryCodeChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::stateChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::countyChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::cityChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::districtChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::streetChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); + connect(address_, &QDeclarativeGeoAddress::postalCodeChanged, + this, &QDeclarativeGeocodeModel::queryContentChanged); } else { qmlWarning(this) << QStringLiteral("Unsupported query type for geocode model ") << QStringLiteral("(coordinate, string and Address supported)."); diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index d3548d49..cdd104e9 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -418,13 +418,16 @@ void QDeclarativeGeoMap::pluginReady() return; } - if (!m_mappingManager->isInitialized()) - connect(m_mappingManager, SIGNAL(initialized()), this, SLOT(mappingManagerInitialized())); - else + if (!m_mappingManager->isInitialized()) { + connect(m_mappingManager, &QGeoMappingManager::initialized, + this, &QDeclarativeGeoMap::mappingManagerInitialized); + } else { mappingManagerInitialized(); + } // make sure this is only called once - disconnect(this, SLOT(pluginReady())); + disconnect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeGeoMap::pluginReady); } /*! @@ -535,8 +538,8 @@ void QDeclarativeGeoMap::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (m_plugin->isAttached()) { pluginReady(); } else { - connect(m_plugin, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeGeoMap::pluginReady); } } @@ -686,12 +689,10 @@ void QDeclarativeGeoMap::mappingManagerInitialized() QImage copyrightImage; if (!m_initialized && width() > 0 && height() > 0) { QMetaObject::Connection copyrightStringCatcherConnection = - connect(m_map.data(), - QOverload<const QString &>::of(&QGeoMap::copyrightsChanged), + connect(m_map.data(), &QGeoMap::copyrightsChanged, [©rightString](const QString ©){ copyrightString = copy; }); QMetaObject::Connection copyrightImageCatcherConnection = - connect(m_map.data(), - QOverload<const QImage &>::of(&QGeoMap::copyrightsChanged), + connect(m_map.data(), &QGeoMap::copyrightsImageChanged, [©rightImage](const QImage ©){ copyrightImage = copy; }); m_map->setViewportSize(QSize(width(), height())); initialize(); // This emits the caught signals above @@ -701,14 +702,14 @@ void QDeclarativeGeoMap::mappingManagerInitialized() /* COPYRIGHT SIGNALS REWIRING */ - connect(m_map.data(), SIGNAL(copyrightsChanged(QImage)), - this, SIGNAL(copyrightsChanged(QImage))); - connect(m_map.data(), SIGNAL(copyrightsChanged(QString)), - this, SIGNAL(copyrightsChanged(QString))); + connect(m_map.data(), &QGeoMap::copyrightsImageChanged, + this, &QDeclarativeGeoMap::copyrightsImageChanged); + connect(m_map.data(), &QGeoMap::copyrightsChanged, + this, &QDeclarativeGeoMap::copyrightsChanged); if (!copyrightString.isEmpty()) emit m_map->copyrightsChanged(copyrightString); else if (!copyrightImage.isNull()) - emit m_map->copyrightsChanged(copyrightImage); + emit m_map->copyrightsImageChanged(copyrightImage); connect(window(), &QQuickWindow::beforeSynchronizing, this, &QDeclarativeGeoMap::updateItemToWindowTransform, Qt::DirectConnection); @@ -718,7 +719,8 @@ void QDeclarativeGeoMap::mappingManagerInitialized() // This prefetches a buffer around the map m_map->prefetchData(); - connect(m_mappingManager, SIGNAL(supportedMapTypesChanged()), this, SLOT(onSupportedMapTypesChanged())); + connect(m_mappingManager, &QGeoMappingManager::supportedMapTypesChanged, + this, &QDeclarativeGeoMap::onSupportedMapTypesChanged); emit minimumZoomLevelChanged(); emit maximumZoomLevelChanged(); emit supportedMapTypesChanged(); diff --git a/src/location/declarativemaps/qdeclarativegeomap_p.h b/src/location/declarativemaps/qdeclarativegeomap_p.h index 74618c7f..c12671a0 100644 --- a/src/location/declarativemaps/qdeclarativegeomap_p.h +++ b/src/location/declarativemaps/qdeclarativegeomap_p.h @@ -233,7 +233,7 @@ Q_SIGNALS: void maximumTiltChanged(qreal maximumTilt); void minimumFieldOfViewChanged(qreal minimumFieldOfView); void maximumFieldOfViewChanged(qreal maximumFieldOfView); - void copyrightsChanged(const QImage ©rightsImage); + void copyrightsImageChanged(const QImage ©rightsImage); void copyrightsChanged(const QString ©rightsHtml); void mapReadyChanged(bool ready); Q_REVISION(11) void mapObjectsChanged(); diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp index b66b3b0e..6212614b 100644 --- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp @@ -43,6 +43,7 @@ #include <QtGui/QTextDocument> #include <QtGui/QAbstractTextDocumentLayout> #include <QtGui/QPainter> +#include <QtGui/QImage> #include <QtQuick/private/qquickanchors_p.h> #include <QtLocation/private/qdeclarativegeomap_p.h> #include <QtQuick/private/qquickpainteditem_p.h> @@ -149,10 +150,10 @@ void QDeclarativeGeoMapCopyrightNotice::setMapSource(QDeclarativeGeoMap *map) if (m_mapSource->m_copyrights && !m_mapSource->m_copyrights->m_copyrightsImage.isNull()) m_copyrightsImage = m_mapSource->m_copyrights->m_copyrightsImage; - connect(mapSource(), SIGNAL(copyrightsChanged(QImage)), - this, SLOT(copyrightsChanged(QImage))); - connect(mapSource(), SIGNAL(copyrightsChanged(QString)), - this, SLOT(copyrightsChanged(QString))); + connect(mapSource(), &QDeclarativeGeoMap::copyrightsImageChanged, + this, &QDeclarativeGeoMapCopyrightNotice::copyrightsImageChanged); + connect(mapSource(), &QDeclarativeGeoMap::copyrightsChanged, + this, &QDeclarativeGeoMapCopyrightNotice::copyrightsChanged); if (m_mapSource->m_map) connectMap(); @@ -163,10 +164,10 @@ void QDeclarativeGeoMapCopyrightNotice::setMapSource(QDeclarativeGeoMap *map) void QDeclarativeGeoMapCopyrightNotice::connectMap() { - connect(m_mapSource->m_map, SIGNAL(copyrightsStyleSheetChanged(QString)), - this, SLOT(onCopyrightsStyleSheetChanged(QString))); - connect(this, SIGNAL(linkActivated(QString)), - mapSource(), SIGNAL(copyrightLinkActivated(QString))); + connect(m_mapSource->m_map.data(), &QGeoMap::copyrightsStyleSheetChanged, + this, &QDeclarativeGeoMapCopyrightNotice::onCopyrightsStyleSheetChanged); + connect(this, &QDeclarativeGeoMapCopyrightNotice::linkActivated, + mapSource(), &QDeclarativeGeoMap::copyrightLinkActivated); onCopyrightsStyleSheetChanged(m_mapSource->m_map->copyrightsStyleSheet()); @@ -308,7 +309,7 @@ void QDeclarativeGeoMapCopyrightNotice::setCopyrightsZ(qreal copyrightsZ) /*! \internal */ -void QDeclarativeGeoMapCopyrightNotice::copyrightsChanged(const QImage ©rightsImage) +void QDeclarativeGeoMapCopyrightNotice::copyrightsImageChanged(const QImage ©rightsImage) { Q_D(QDeclarativeGeoMapCopyrightNotice); delete m_copyrightsHtml; diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h index fe26ad2b..5127c95f 100644 --- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h +++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h @@ -89,7 +89,7 @@ public: void setStyleSheet(const QString &styleSheet); public Q_SLOTS: - void copyrightsChanged(const QImage ©rightsImage); + void copyrightsImageChanged(const QImage ©rightsImage); void copyrightsChanged(const QString ©rightsHtml); void onCopyrightsStyleSheetChanged(const QString &styleSheet); diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp index 1109fde2..78bcfe90 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp @@ -87,8 +87,8 @@ QDeclarativeGeoMapItemBase::QDeclarativeGeoMapItemBase(QQuickItem *parent) : QQuickItem(parent), map_(0), quickMap_(0), parentGroup_(0) { setFiltersChildMouseEvents(true); - connect(this, SIGNAL(childrenChanged()), - this, SLOT(afterChildrenChanged())); + connect(this, &QDeclarativeGeoMapItemBase::childrenChanged, + this, &QDeclarativeGeoMapItemBase::afterChildrenChanged); // Changing opacity on a mapItemGroup should affect also the opacity on the children. // This must be notified to plugins, if they are to render the item. connect(this, &QQuickItem::opacityChanged, this, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged); @@ -96,7 +96,8 @@ QDeclarativeGeoMapItemBase::QDeclarativeGeoMapItemBase(QQuickItem *parent) QDeclarativeGeoMapItemBase::~QDeclarativeGeoMapItemBase() { - disconnect(this, SLOT(afterChildrenChanged())); + disconnect(this, &QDeclarativeGeoMapItemBase::childrenChanged, + this, &QDeclarativeGeoMapItemBase::afterChildrenChanged); if (quickMap_) quickMap_->removeMapItem(this); } diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp index 85d7a380..f69a1f08 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp @@ -431,8 +431,8 @@ void QDeclarativeGeoMapItemView::transitionItemOut(QQuickItem *o) group->m_transitionManager.swap(manager); group->m_transitionManager->m_view = this; } - connect(group, SIGNAL(removeTransitionFinished()), - this, SLOT(exitTransitionFinished())); + connect(group, &QDeclarativeGeoMapItemGroup::removeTransitionFinished, + this, &QDeclarativeGeoMapItemView::exitTransitionFinished); group->m_transitionManager->transitionExit(); return; @@ -444,8 +444,8 @@ void QDeclarativeGeoMapItemView::transitionItemOut(QQuickItem *o) item->m_transitionManager.swap(manager); item->m_transitionManager->m_view = this; } - connect(item, SIGNAL(removeTransitionFinished()), - this, SLOT(exitTransitionFinished()) ); + connect(item, &QDeclarativeGeoMapItemBase::removeTransitionFinished, + this, &QDeclarativeGeoMapItemView::exitTransitionFinished); item->m_transitionManager->transitionExit(); return; diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp index 20db04e1..548edbd3 100644 --- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp @@ -192,8 +192,8 @@ void QDeclarativeGeoMapQuickItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap * { QDeclarativeGeoMapItemBase::setMap(quickMap,map); if (map && quickMap) { - connect(map, SIGNAL(cameraDataChanged(QGeoCameraData)), - this, SLOT(polishAndUpdate())); + connect(map, &QGeoMap::cameraDataChanged, + this, &QDeclarativeGeoMapQuickItem::polishAndUpdate); polishAndUpdate(); } } @@ -397,14 +397,14 @@ void QDeclarativeGeoMapQuickItem::updatePolish() mapAndSourceItemSet_ = true; sourceItem_.data()->setParentItem(opacityContainer_); sourceItem_.data()->setTransformOrigin(QQuickItem::TopLeft); - connect(sourceItem_.data(), SIGNAL(xChanged()), - this, SLOT(polishAndUpdate())); - connect(sourceItem_.data(), SIGNAL(yChanged()), - this, SLOT(polishAndUpdate())); - connect(sourceItem_.data(), SIGNAL(widthChanged()), - this, SLOT(polishAndUpdate())); - connect(sourceItem_.data(), SIGNAL(heightChanged()), - this, SLOT(polishAndUpdate())); + connect(sourceItem_.data(), &QQuickItem::xChanged, + this, &QDeclarativeGeoMapQuickItem::polishAndUpdate); + connect(sourceItem_.data(), &QQuickItem::yChanged, + this, &QDeclarativeGeoMapQuickItem::polishAndUpdate); + connect(sourceItem_.data(), &QQuickItem::widthChanged, + this, &QDeclarativeGeoMapQuickItem::polishAndUpdate); + connect(sourceItem_.data(), &QQuickItem::heightChanged, + this, &QDeclarativeGeoMapQuickItem::polishAndUpdate); } if (!coordinate_.isValid()) { diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp index 6bec322b..e23f7c16 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp @@ -321,10 +321,14 @@ void QDeclarativeGeoRouteModel::setPlugin(QDeclarativeGeoServiceProvider *plugin reset(); // reset the model - if (plugin_) - disconnect(plugin_, SIGNAL(localesChanged()), this, SIGNAL(measurementSystemChanged())); - if (plugin) - connect(plugin, SIGNAL(localesChanged()), this, SIGNAL(measurementSystemChanged())); + if (plugin_) { + disconnect(plugin_, &QDeclarativeGeoServiceProvider::localesChanged, + this, &QDeclarativeGeoRouteModel::measurementSystemChanged); + } + if (plugin) { + connect(plugin, &QDeclarativeGeoServiceProvider::localesChanged, + this, &QDeclarativeGeoRouteModel::measurementSystemChanged); + } plugin_ = plugin; @@ -337,8 +341,8 @@ void QDeclarativeGeoRouteModel::setPlugin(QDeclarativeGeoServiceProvider *plugin if (plugin_->isAttached()) { pluginReady(); } else { - connect(plugin_, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(plugin_, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeGeoRouteModel::pluginReady); } } @@ -374,10 +378,10 @@ void QDeclarativeGeoRouteModel::pluginReady() return; } - connect(routingManager, SIGNAL(finished(QGeoRouteReply*)), - this, SLOT(routingFinished(QGeoRouteReply*))); - connect(routingManager, SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString)), - this, SLOT(routingError(QGeoRouteReply*,QGeoRouteReply::Error,QString))); + connect(routingManager, &QGeoRoutingManager::finished, + this, &QDeclarativeGeoRouteModel::routingFinished); + connect(routingManager, &QGeoRoutingManager::errorOccurred, + this, &QDeclarativeGeoRouteModel::routingError); } /*! @@ -417,7 +421,8 @@ void QDeclarativeGeoRouteModel::setQuery(QDeclarativeGeoRouteQuery *query) if (routeQuery_) routeQuery_->disconnect(this); routeQuery_ = query; - connect(query, SIGNAL(queryDetailsChanged()), this, SLOT(queryDetailsChanged())); + connect(query, &QDeclarativeGeoRouteQuery::queryDetailsChanged, + this, &QDeclarativeGeoRouteModel::queryDetailsChanged); if (complete_) { emit queryChanged(); if (autoUpdate_) diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index 1a09a518..56ee7895 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -627,10 +627,11 @@ QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent) m_itemType = QGeoMap::MapPolygon; m_geopoly = QGeoPolygonEager(); setFlag(ItemHasContents, true); - QObject::connect(&m_border, SIGNAL(colorChanged(QColor)), - this, SLOT(onLinePropertiesChanged())); // ToDo: fix this, only flag material? - QObject::connect(&m_border, SIGNAL(widthChanged(qreal)), - this, SLOT(onLinePropertiesChanged())); + // ToDo: fix this, only flag material? + QObject::connect(&m_border, &QDeclarativeMapLineProperties::colorChanged, + this, &QDeclarativePolygonMapItem::onLinePropertiesChanged); + QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged, + this, &QDeclarativePolygonMapItem::onLinePropertiesChanged); setBackend(mapPolygonBackendSelector->backend); } diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index 649a9ef4..a7a3c21c 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -936,10 +936,10 @@ QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent) m_itemType = QGeoMap::MapPolyline; m_geopath = QGeoPathEager(); setFlag(ItemHasContents, true); - QObject::connect(&m_line, SIGNAL(colorChanged(QColor)), - this, SLOT(updateAfterLinePropertiesChanged())); - QObject::connect(&m_line, SIGNAL(widthChanged(qreal)), - this, SLOT(updateAfterLinePropertiesChanged())); + QObject::connect(&m_line, &QDeclarativeMapLineProperties::colorChanged, + this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged); + QObject::connect(&m_line, &QDeclarativeMapLineProperties::widthChanged, + this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged); setBackend(mapPolylineBackendSelector->backend); } diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp index d4e5ce38..5594ef22 100644 --- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp @@ -150,10 +150,10 @@ QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent) // ToDo: handle envvar, and switch implementation. m_itemType = QGeoMap::MapRectangle; setFlag(ItemHasContents, true); - QObject::connect(&m_border, SIGNAL(colorChanged(QColor)), - this, SLOT(onLinePropertiesChanged())); - QObject::connect(&m_border, SIGNAL(widthChanged(qreal)), - this, SLOT(onLinePropertiesChanged())); + QObject::connect(&m_border, &QDeclarativeMapLineProperties::colorChanged, + this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged); + QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged, + this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged); setBackend(mapRectangleBackendSelector->backend); } diff --git a/src/location/declarativemaps/qdeclarativeroutemapitem.cpp b/src/location/declarativemaps/qdeclarativeroutemapitem.cpp index 7c7db5d3..a5e90db5 100644 --- a/src/location/declarativemaps/qdeclarativeroutemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativeroutemapitem.cpp @@ -123,7 +123,8 @@ void QDeclarativeRouteMapItem::setRoute(QDeclarativeGeoRoute *route) route_ = route; - connect(route_, SIGNAL(pathChanged()), this, SLOT(updateRoutePath())); + connect(route_, &QDeclarativeGeoRoute::pathChanged, + this, &QDeclarativeRouteMapItem::updateRoutePath); if (route_) setPathFromGeoList(route_->routePath()); diff --git a/src/location/declarativeplaces/qdeclarativecategory.cpp b/src/location/declarativeplaces/qdeclarativecategory.cpp index 895ae2ab..3403aaf1 100644 --- a/src/location/declarativeplaces/qdeclarativecategory.cpp +++ b/src/location/declarativeplaces/qdeclarativecategory.cpp @@ -132,8 +132,8 @@ void QDeclarativeCategory::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (m_plugin->isAttached()) { pluginReady(); } else { - connect(m_plugin, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeCategory::pluginReady); } } @@ -355,7 +355,8 @@ void QDeclarativeCategory::save(const QString &parentId) return; m_reply = placeManager->saveCategory(category(), parentId); - connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(m_reply, &QPlaceReply::finished, + this, &QDeclarativeCategory::replyFinished); setStatus(QDeclarativeCategory::Saving); } @@ -371,7 +372,8 @@ void QDeclarativeCategory::remove() return; m_reply = placeManager->removeCategory(m_category.categoryId()); - connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(m_reply, &QPlaceReply::finished, + this, &QDeclarativeCategory::replyFinished); setStatus(QDeclarativeCategory::Removing); } diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp index f37ea0e7..f01a0b81 100644 --- a/src/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/location/declarativeplaces/qdeclarativeplace.cpp @@ -191,8 +191,8 @@ QDeclarativePlace::QDeclarativePlace(QObject *parent) m_contactDetails(new QDeclarativeContactDetails(this)), m_reply(0), m_plugin(0), m_complete(false), m_favorite(0), m_status(QDeclarativePlace::Ready) { - connect(m_contactDetails, SIGNAL(valueChanged(QString,QVariant)), - this, SLOT(contactsModified(QString,QVariant))); + connect(m_contactDetails, &QDeclarativeContactDetails::valueChanged, + this, &QDeclarativePlace::contactsModified); setPlace(QPlace()); } @@ -206,8 +206,8 @@ QDeclarativePlace::QDeclarativePlace(const QPlace &src, QDeclarativeGeoServicePr { Q_ASSERT(plugin); - connect(m_contactDetails, SIGNAL(valueChanged(QString,QVariant)), - this, SLOT(contactsModified(QString,QVariant))); + connect(m_contactDetails, &QDeclarativeContactDetails::valueChanged, + this, &QDeclarativePlace::contactsModified); setPlace(src); } @@ -239,8 +239,8 @@ void QDeclarativePlace::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (m_plugin->isAttached()) { pluginReady(); } else { - connect(m_plugin, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativePlace::pluginReady); } } @@ -748,7 +748,7 @@ void QDeclarativePlace::getDetails() return; m_reply = placeManager->getPlaceDetails(placeId()); - connect(m_reply, SIGNAL(finished()), this, SLOT(finished())); + connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished); setStatus(QDeclarativePlace::Fetching); } @@ -777,7 +777,7 @@ void QDeclarativePlace::save() return; m_reply = placeManager->savePlace(place()); - connect(m_reply, SIGNAL(finished()), this, SLOT(finished())); + connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished); setStatus(QDeclarativePlace::Saving); } @@ -797,7 +797,7 @@ void QDeclarativePlace::remove() return; m_reply = placeManager->removePlace(place().placeId()); - connect(m_reply, SIGNAL(finished()), this, SLOT(finished())); + connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished); setStatus(QDeclarativePlace::Removing); } diff --git a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp index b1413934..29b101d4 100644 --- a/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp +++ b/src/location/declarativeplaces/qdeclarativeplacecontentmodel.cpp @@ -276,7 +276,8 @@ void QDeclarativePlaceContentModel::fetchMore(const QModelIndex &parent) m_reply = placeManager->getPlaceContent(m_nextRequest); } - connect(m_reply, SIGNAL(finished()), this, SLOT(fetchFinished()), Qt::QueuedConnection); + connect(m_reply, &QPlaceReply::finished, + this, &QDeclarativePlaceContentModel::fetchFinished, Qt::QueuedConnection); } /*! diff --git a/src/location/declarativeplaces/qdeclarativeplaceicon.cpp b/src/location/declarativeplaces/qdeclarativeplaceicon.cpp index 6df29671..afe9cc21 100644 --- a/src/location/declarativeplaces/qdeclarativeplaceicon.cpp +++ b/src/location/declarativeplaces/qdeclarativeplaceicon.cpp @@ -193,8 +193,8 @@ void QDeclarativePlaceIcon::setPlugin(QDeclarativeGeoServiceProvider *plugin) if (m_plugin->isAttached()) { pluginReady(); } else { - connect(m_plugin, SIGNAL(attached()), - this, SLOT(pluginReady())); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativePlaceIcon::pluginReady); } } diff --git a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp index 78285e91..d7476aad 100644 --- a/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp +++ b/src/location/declarativeplaces/qdeclarativesearchmodelbase.cpp @@ -238,8 +238,10 @@ void QDeclarativeSearchModelBase::update() } m_reply->setParent(this); - connect(m_reply, SIGNAL(finished()), this, SLOT(queryFinished())); - connect(m_reply, SIGNAL(contentUpdated()), this, SLOT(onContentUpdated())); + connect(m_reply, &QPlaceReply::finished, + this, &QDeclarativeSearchModelBase::queryFinished); + connect(m_reply, &QPlaceReply::contentUpdated, + this, &QDeclarativeSearchModelBase::onContentUpdated); } /*! @@ -334,10 +336,14 @@ void QDeclarativeSearchModelBase::initializePlugin(QDeclarativeGeoServiceProvide { beginResetModel(); if (plugin != m_plugin) { - if (m_plugin) - disconnect(m_plugin, SIGNAL(nameChanged(QString)), this, SLOT(pluginNameChanged())); - if (plugin) - connect(plugin, SIGNAL(nameChanged(QString)), this, SLOT(pluginNameChanged())); + if (m_plugin) { + disconnect(m_plugin, &QDeclarativeGeoServiceProvider::nameChanged, + this, &QDeclarativeSearchModelBase::pluginNameChanged); + } + if (plugin) { + connect(plugin, &QDeclarativeGeoServiceProvider::nameChanged, + this, &QDeclarativeSearchModelBase::pluginNameChanged); + } m_plugin = plugin; } @@ -348,7 +354,7 @@ void QDeclarativeSearchModelBase::initializePlugin(QDeclarativeGeoServiceProvide if (placeManager) { if (placeManager->childCategoryIds().isEmpty()) { QPlaceReply *reply = placeManager->initializeCategories(); - connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater())); + connect(reply, &QPlaceReply::finished, reply, &QObject::deleteLater); } } } diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp index 792e388d..c76024b3 100644 --- a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp +++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp @@ -568,7 +568,7 @@ void QDeclarativeSearchResultModel::setFavoritesPlugin(QDeclarativeGeoServicePro if (placeManager) { if (placeManager->childCategoryIds().isEmpty()) { QPlaceReply *reply = placeManager->initializeCategories(); - connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater())); + connect(reply, &QPlaceReply::finished, reply, &QObject::deleteLater); } } } @@ -718,9 +718,12 @@ void QDeclarativeSearchResultModel::initializePlugin(QDeclarativeGeoServiceProvi if (serviceProvider) { QPlaceManager *placeManager = serviceProvider->placeManager(); if (placeManager) { - disconnect(placeManager, SIGNAL(placeUpdated(QString)), this, SLOT(placeUpdated(QString))); - disconnect(placeManager, SIGNAL(placeRemoved(QString)), this, SLOT(placeRemoved(QString))); - connect(placeManager, SIGNAL(dataChanged()), this, SIGNAL(dataChanged())); + disconnect(placeManager, &QPlaceManager::placeUpdated, + this, &QDeclarativeSearchResultModel::placeUpdated); + disconnect(placeManager, &QPlaceManager::placeRemoved, + this, &QDeclarativeSearchResultModel::placeRemoved); + connect(placeManager, &QPlaceManager::dataChanged, + this, &QDeclarativeSearchResultModel::dataChanged); } } } @@ -731,9 +734,12 @@ void QDeclarativeSearchResultModel::initializePlugin(QDeclarativeGeoServiceProvi if (serviceProvider) { QPlaceManager *placeManager = serviceProvider->placeManager(); if (placeManager) { - connect(placeManager, SIGNAL(placeUpdated(QString)), this, SLOT(placeUpdated(QString))); - connect(placeManager, SIGNAL(placeRemoved(QString)), this, SLOT(placeRemoved(QString))); - disconnect(placeManager, SIGNAL(dataChanged()), this, SIGNAL(dataChanged())); + connect(placeManager, &QPlaceManager::placeUpdated, + this, &QDeclarativeSearchResultModel::placeUpdated); + connect(placeManager, &QPlaceManager::placeRemoved, + this, &QDeclarativeSearchResultModel::placeRemoved); + disconnect(placeManager, &QPlaceManager::dataChanged, + this, &QDeclarativeSearchResultModel::dataChanged); } } } @@ -813,8 +819,10 @@ void QDeclarativeSearchResultModel::queryFinished() if (alreadyLoaded) m_resultsBuffer.clear(); m_reply = favoritesManager->matchingPlaces(request); - connect(m_reply, SIGNAL(finished()), this, SLOT(queryFinished())); - connect(m_reply, SIGNAL(contentUpdated()), this, SLOT(onContentUpdated())); + connect(m_reply, &QPlaceReply::finished, + this, &QDeclarativeSearchResultModel::queryFinished); + connect(m_reply, &QPlaceReply::contentUpdated, + this, &QDeclarativeSearchResultModel::onContentUpdated); } } else if (reply->type() == QPlaceReply::MatchReply) { QPlaceMatchReply *matchReply = qobject_cast<QPlaceMatchReply *>(reply); diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp index e64663ea..8252d152 100644 --- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp +++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp @@ -275,14 +275,14 @@ void QDeclarativeSupportedCategoriesModel::setPlugin(QDeclarativeGeoServiceProvi if (serviceProvider) { QPlaceManager *placeManager = serviceProvider->placeManager(); if (placeManager) { - disconnect(placeManager, SIGNAL(categoryAdded(QPlaceCategory,QString)), - this, SLOT(addedCategory(QPlaceCategory,QString))); - disconnect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory,QString)), - this, SLOT(updatedCategory(QPlaceCategory,QString))); - disconnect(placeManager, SIGNAL(categoryRemoved(QString,QString)), - this, SLOT(removedCategory(QString,QString))); - disconnect(placeManager, SIGNAL(dataChanged()), - this, SIGNAL(dataChanged())); + disconnect(placeManager, &QPlaceManager::categoryAdded, + this, &QDeclarativeSupportedCategoriesModel::addedCategory); + disconnect(placeManager, &QPlaceManager::categoryUpdated, + this, &QDeclarativeSupportedCategoriesModel::updatedCategory); + disconnect(placeManager, &QPlaceManager::categoryRemoved, + this, &QDeclarativeSupportedCategoriesModel::removedCategory); + disconnect(placeManager, &QPlaceManager::dataChanged, + this, &QDeclarativeSupportedCategoriesModel::emitDataChanged); } } } @@ -295,8 +295,10 @@ void QDeclarativeSupportedCategoriesModel::setPlugin(QDeclarativeGeoServiceProvi connectNotificationSignals(); update(); } else { - connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, this, &QDeclarativeSupportedCategoriesModel::update); - connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, this, &QDeclarativeSupportedCategoriesModel::connectNotificationSignals); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeSupportedCategoriesModel::update); + connect(m_plugin, &QDeclarativeGeoServiceProvider::attached, + this, &QDeclarativeSupportedCategoriesModel::connectNotificationSignals); } } @@ -503,14 +505,14 @@ void QDeclarativeSupportedCategoriesModel::connectNotificationSignals() // listen for any category notifications so that we can reupdate the categories // model. - connect(placeManager, SIGNAL(categoryAdded(QPlaceCategory,QString)), - this, SLOT(addedCategory(QPlaceCategory,QString))); - connect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory,QString)), - this, SLOT(updatedCategory(QPlaceCategory,QString))); - connect(placeManager, SIGNAL(categoryRemoved(QString,QString)), - this, SLOT(removedCategory(QString,QString))); - connect(placeManager, SIGNAL(dataChanged()), - this, SIGNAL(dataChanged())); + connect(placeManager, &QPlaceManager::categoryAdded, + this, &QDeclarativeSupportedCategoriesModel::addedCategory); + connect(placeManager, &QPlaceManager::categoryUpdated, + this, &QDeclarativeSupportedCategoriesModel::updatedCategory); + connect(placeManager, &QPlaceManager::categoryRemoved, + this, &QDeclarativeSupportedCategoriesModel::removedCategory); + connect(placeManager, &QPlaceManager::dataChanged, + this, &QDeclarativeSupportedCategoriesModel::emitDataChanged); } /*! @@ -550,7 +552,8 @@ void QDeclarativeSupportedCategoriesModel::update() m_response = placeManager->initializeCategories(); if (m_response) { - connect(m_response, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(m_response, &QPlaceReply::finished, + this, &QDeclarativeSupportedCategoriesModel::replyFinished); } else { updateLayout(); setStatus(Error, QCoreApplication::translate(CONTEXT_NAME, diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h index 4037777a..a13fe256 100644 --- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h @@ -150,6 +150,7 @@ private: QModelIndex index(const QString &categoryId) const; int rowToAddChild(PlaceCategoryNode *, const QPlaceCategory &category); void updateLayout(); + void emitDataChanged() { Q_EMIT dataChanged(); } QPlaceReply *m_response; diff --git a/src/location/doc/snippets/maps/routehandler.h b/src/location/doc/snippets/maps/routehandler.h index 01b1b7df..59f9456e 100644 --- a/src/location/doc/snippets/maps/routehandler.h +++ b/src/location/doc/snippets/maps/routehandler.h @@ -86,15 +86,11 @@ public: return; } - connect(routingManager, - SIGNAL(finished(QGeoRouteReply*)), - this, - SLOT(routeCalculated(QGeoRouteReply*))); + connect(routingManager, &QGeoRoutingManager::finished, + this, &RouteHandler::routeCalculated); - connect(routingManager, - SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString)), - this, - SLOT(routeError(QGeoRouteReply*,QGeoRouteReply::Error,QString))); + connect(routingManager, &QGeoRoutingManager::errorOccurred, + this, &RouteHandler::routeError); } private slots: diff --git a/src/location/doc/snippets/places/requesthandler.h b/src/location/doc/snippets/places/requesthandler.h index edd90405..7b3a7cc4 100644 --- a/src/location/doc/snippets/places/requesthandler.h +++ b/src/location/doc/snippets/places/requesthandler.h @@ -84,7 +84,8 @@ public: QPlaceSearchReply * searchReply = manager->search(searchRequest); //3) Connect the reply object to a slot which is invoked upon operation completion - connect(searchReply, SIGNAL(finished()), this, SLOT(processSearchReply())); + connect(searchReply, &QPlaceSearchReply::finished, + this, &RequestHandler::processSearchReply); //! [Simple search] } @@ -101,7 +102,7 @@ public: /*QPlaceSearchReply * */ searchReply = manager->search(searchRequest); //connect a slot to handle the reply - connect(searchReply, SIGNAL(finished()), this, SLOT(handleSearchReply())); + connect(searchReply, &QPlaceSearchReply::finished, this, &RequestHandler::handleSearchReply); //! [Search for places cpp] } @@ -120,7 +121,7 @@ public: //! [Details check] if (!place.detailsFetched()) { /*QPlaceDetailsReply * */ detailsReply = manager->getPlaceDetails(place.placeId()); - connect(detailsReply, SIGNAL(finished()), this, SLOT(handleDetailsReply())); + connect(detailsReply, &QPlaceDetailsReply::finished, this, &RequestHandler::handleDetailsReply); } //! [Details check] } @@ -135,7 +136,7 @@ public: request.setPlaceId(place.placeId()); request.setLimit(5); /*QPlaceContentReply * */ contentReply = manager->getPlaceContent(request); - connect(contentReply, SIGNAL(finished()), this, SLOT(handleImagesReply())); + connect(contentReply, &QPlaceContentReply::finished, this, &RequestHandler::handleImagesReply); //! [Image request] } @@ -147,7 +148,7 @@ public: request.setSearchTerm("piz"); request.setSearchArea(QGeoCircle(QGeoCoordinate(12.34, 56.78))); /* QPlaceSearchSuggestion * */suggestionReply = manager->searchSuggestions(request); - connect(suggestionReply, SIGNAL(finished()), this, SLOT(handleSuggestionReply())); + connect(suggestionReply, &QPlaceSearchSuggestion::finished, this, &RequestHandler::handleSuggestionReply); //! [Suggestion request] } @@ -169,7 +170,7 @@ public: place.setLocation(location); /* QPlaceIdReply * */savePlaceReply = manager->savePlace(place); - connect(savePlaceReply, SIGNAL(finished()), this, SLOT(handleSavePlaceReply())); + connect(savePlaceReply, &QPlaceIdReply::finished, this, &RequestHandler::handleSavePlaceReply); //! [Save place pt2] } @@ -178,7 +179,7 @@ public: QPlace place; //! [Remove place] /* QPlaceIdReply * */removePlaceReply = manager->removePlace(place.placeId()); - connect(removePlaceReply, SIGNAL(finished()), this, SLOT(handleRemovePlaceReply())); + connect(removePlaceReply, &QPlaceIdReply::finished, this, &RequestHandler::handleRemovePlaceReply); //! [Remove place] } @@ -186,7 +187,7 @@ public: { //! [Initialize categories] /* QPlaceReply * */initCatReply = manager->initializeCategories(); - connect(initCatReply, SIGNAL(finished()), this, SLOT(handleInitCatReply())); + connect(initCatReply, &QPlaceReply::finished, this, &RequestHandler::handleInitCatReply); //! [Initialize categories] } @@ -198,7 +199,7 @@ public: QPlaceCategory category; category.setName("pizza"); /*QPlaceIdReply */ saveCategoryReply = manager->saveCategory(category); - connect(saveCategoryReply, SIGNAL(finished()), this, SLOT(handleSaveCategoryReply())); + connect(saveCategoryReply, &QPlaceIdReply::finished, this, &RequestHandler::handleSaveCategoryReply); //we could have saved a category as a child by supplying a parent identifier. saveCategoryReply = manager->saveCategory(category, fastFood.categoryId()); @@ -210,7 +211,7 @@ public: QPlaceCategory category; //! [Remove category] /* QPlaceIdReply * */removeCategoryReply = manager->removeCategory(place.placeId()); - connect(removeCategoryReply, SIGNAL(finished()), this, SLOT(handleRemoveCategoryReply())); + connect(removeCategoryReply, &QPlaceIdReply::finished, this, &RequestHandler::handleRemoveCategoryReply); //! [Remove category] } @@ -574,11 +575,11 @@ void SearchSuggestionReply::triggerDone(QPlaceReply::Error error, { if (error != QPlaceReply::NoError) { this->setError(error,errorString); - QMetaObject::invokeMethod(m_engine, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(m_engine, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *,this), Q_ARG(QPlaceReply::Error, error), Q_ARG(QString, errorString)); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error), Q_ARG(QString, errorString)); } diff --git a/src/location/doc/src/plugins/places-backend.qdoc b/src/location/doc/src/plugins/places-backend.qdoc index 7b63ea9f..d49fa612 100644 --- a/src/location/doc/src/plugins/places-backend.qdoc +++ b/src/location/doc/src/plugins/places-backend.qdoc @@ -44,7 +44,7 @@ so implementers will also need to derive the appropriate \l {Places Reply Classe The reply objects are responsible for managing an asynchronous request; they are used to notify when a request is complete and hold the results of that request. QPlaceManagerEngine provides a default implementation for all virtual functions. The default implementations for the asynchronous -functions return a reply that will emit the error() and finished() signals at the next iteration +functions return a reply that will emit the errorOccurred() and finished() signals at the next iteration through the event loop. \section1 Implementing/Inheriting Reply Objects diff --git a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp index a76c3f48..906ef2ea 100644 --- a/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp +++ b/src/location/labs/qsg/qgeomapobjectqsgsupport.cpp @@ -216,7 +216,8 @@ void QGeoMapObjectQSGSupport::updateMapObjects(QSGNode *root, QQuickWindow *wind } m_mapObjects << mo; toRemove.push_front(i); - QObject::connect(mo.object, SIGNAL(visibleChanged()), m_map, SIGNAL(sgNodeChanged())); + QObject::connect(mo.object, &QGeoMapObject::visibleChanged, + m_map, &QGeoMap::sgNodeChanged); } else { // leave it to be processed, don't spit warnings } diff --git a/src/location/maps/qgeocodereply.cpp b/src/location/maps/qgeocodereply.cpp index fec03a29..06abc614 100644 --- a/src/location/maps/qgeocodereply.cpp +++ b/src/location/maps/qgeocodereply.cpp @@ -59,13 +59,13 @@ QT_BEGIN_NAMESPACE The isFinished(), error() and errorString() methods provide information on whether the operation has completed and if it completed successfully. - The finished() and error(QGeoCodeReply::Error,QString) + The finished() and errorOccurred(QGeoCodeReply::Error,QString) signals can be used to monitor the progress of the operation. It is possible that a newly created QGeoCodeReply may be in a finished state, most commonly because an error has occurred. Since such an instance will never emit the finished() or - error(QGeoCodeReply::Error,QString) signals, it is + errorOccurred(QGeoCodeReply::Error,QString) signals, it is important to check the result of isFinished() before making the connections to the signals. The documentation for QGeoCodingManager demonstrates how this might be carried out. @@ -155,14 +155,14 @@ bool QGeoCodeReply::isFinished() const Sets the error state of this reply to \a error and the textual representation of the error to \a errorString. - This will also cause error() and finished() signals to be emitted, in that - order. + This will also cause errorOccurred() and finished() signals to be + emitted, in that order. */ void QGeoCodeReply::setError(QGeoCodeReply::Error error, const QString &errorString) { d_ptr->error = error; d_ptr->errorString = errorString; - emit this->error(error, errorString); + emit this->errorOccurred(error, errorString); setFinished(true); } @@ -316,7 +316,7 @@ void QGeoCodeReply::setOffset(int offset) signal. Use deleteLater() instead. */ /*! - \fn void QGeoCodeReply::error(QGeoCodeReply::Error error, const QString &errorString) + \fn void QGeoCodeReply::errorOccurred(QGeoCodeReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of this reply. The finished() signal will probably follow. @@ -324,7 +324,7 @@ void QGeoCodeReply::setOffset(int offset) The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. - This signal and QGeoCodingManager::error() will be emitted at the same time. + This signal and QGeoCodingManager::errorOccurred() will be emitted at the same time. \note Do not delete this reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h index 8ad3cb15..98547c01 100644 --- a/src/location/maps/qgeocodereply.h +++ b/src/location/maps/qgeocodereply.h @@ -83,7 +83,7 @@ public: Q_SIGNALS: void finished(); void aborted(); - void error(QGeoCodeReply::Error error, const QString &errorString = QString()); + void errorOccurred(QGeoCodeReply::Error error, const QString &errorString = QString()); protected: explicit QGeoCodeReply(QObject *parent = nullptr); diff --git a/src/location/maps/qgeocodingmanager.cpp b/src/location/maps/qgeocodingmanager.cpp index 13a6c510..5709b869 100644 --- a/src/location/maps/qgeocodingmanager.cpp +++ b/src/location/maps/qgeocodingmanager.cpp @@ -88,15 +88,11 @@ QGeoCodingManager::QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *p if (d_ptr->engine) { d_ptr->engine->setParent(this); - connect(d_ptr->engine, - SIGNAL(finished(QGeoCodeReply*)), - this, - SIGNAL(finished(QGeoCodeReply*))); - - connect(d_ptr->engine, - SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString)), - this, - SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString))); + connect(d_ptr->engine, &QGeoCodingManagerEngine::finished, + this, &QGeoCodingManager::finished); + + connect(d_ptr->engine, &QGeoCodingManagerEngine::errorOccurred, + this, &QGeoCodingManager::errorOccurred); } else { qFatal("The geocoding manager engine that was set for this geocoding manager was NULL."); } @@ -168,8 +164,8 @@ int QGeoCodingManager::managerVersion() const The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManager::finished(), - QGeoCodingManager::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManager::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManager::geocode(const QGeoAddress &address, const QGeoShape &bounds) { @@ -210,8 +206,8 @@ QGeoCodeReply *QGeoCodingManager::geocode(const QGeoAddress &address, const QGeo The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManager::finished(), - QGeoCodingManager::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManager::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManager::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) { @@ -244,8 +240,8 @@ QGeoCodeReply *QGeoCodingManager::reverseGeocode(const QGeoCoordinate &coordinat The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManager::finished(), - QGeoCodingManager::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManager::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManager::geocode(const QString &address, int limit, @@ -297,7 +293,7 @@ QLocale QGeoCodingManager::locale() const */ /*! -\fn void QGeoCodingManager::error(QGeoCodeReply *reply, QGeoCodeReply::Error error, QString errorString) +\fn void QGeoCodingManager::errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of \a reply. The QGeoCodingManager::finished() signal will probably follow. @@ -305,7 +301,7 @@ QLocale QGeoCodingManager::locale() const The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. - This signal and QGeoCodeReply::error() will be emitted at the same time. + This signal and QGeoCodeReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeocodingmanager.h b/src/location/maps/qgeocodingmanager.h index 545ee06f..e3379209 100644 --- a/src/location/maps/qgeocodingmanager.h +++ b/src/location/maps/qgeocodingmanager.h @@ -77,7 +77,8 @@ public: Q_SIGNALS: void finished(QGeoCodeReply *reply); - void error(QGeoCodeReply *reply, QGeoCodeReply::Error error, QString errorString = QString()); + void errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, + const QString &errorString = QString()); private: explicit QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *parent = nullptr); diff --git a/src/location/maps/qgeocodingmanagerengine.cpp b/src/location/maps/qgeocodingmanagerengine.cpp index 35ab0d3a..8c558239 100644 --- a/src/location/maps/qgeocodingmanagerengine.cpp +++ b/src/location/maps/qgeocodingmanagerengine.cpp @@ -171,8 +171,8 @@ int QGeoCodingManagerEngine::managerVersion() const The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManagerEngine::finished(), - QGeoCodingManagerEngine::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManagerEngine::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManagerEngine::geocode(const QGeoAddress &address, const QGeoShape &bounds) @@ -216,8 +216,8 @@ QGeoCodeReply *QGeoCodingManagerEngine::geocode(const QGeoAddress &address, The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManagerEngine::finished(), - QGeoCodingManagerEngine::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManagerEngine::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManagerEngine::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) @@ -254,8 +254,8 @@ QGeoCodeReply *QGeoCodingManagerEngine::reverseGeocode(const QGeoCoordinate &coo The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoCodingManagerEngine::finished(), - QGeoCodingManagerEngine::error(), QGeoCodeReply::finished() or - QGeoCodeReply::error() with deleteLater(). + QGeoCodingManagerEngine::errorOccurred(), QGeoCodeReply::finished() or + QGeoCodeReply::errorOccurred() with deleteLater(). */ QGeoCodeReply *QGeoCodingManagerEngine::geocode(const QString &address, int limit, @@ -309,7 +309,7 @@ QLocale QGeoCodingManagerEngine::locale() const */ /*! -\fn void QGeoCodingManagerEngine::error(QGeoCodeReply *reply, QGeoCodeReply::Error error, QString errorString) +\fn void QGeoCodingManagerEngine::errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of \a reply. The QGeoCodingManagerEngine::finished() signal will probably follow. @@ -317,7 +317,7 @@ QLocale QGeoCodingManagerEngine::locale() const The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. - This signal and QGeoCodeReply::error() will be emitted at the same time. + This signal and QGeoCodeReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeocodingmanagerengine.h b/src/location/maps/qgeocodingmanagerengine.h index abc87279..097e2d6c 100644 --- a/src/location/maps/qgeocodingmanagerengine.h +++ b/src/location/maps/qgeocodingmanagerengine.h @@ -75,7 +75,8 @@ public: Q_SIGNALS: void finished(QGeoCodeReply *reply); - void error(QGeoCodeReply *reply, QGeoCodeReply::Error error, QString errorString = QString()); + void errorOccurred(QGeoCodeReply *reply, QGeoCodeReply::Error error, + const QString &errorString = QString()); private: void setManagerName(const QString &managerName); diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h index 331359ad..9d0c04ee 100644 --- a/src/location/maps/qgeomap_p.h +++ b/src/location/maps/qgeomap_p.h @@ -176,7 +176,7 @@ Q_SIGNALS: void sgNodeChanged(); void activeMapTypeChanged(); void cameraCapabilitiesChanged(const QGeoCameraCapabilities &oldCameraCapabilities); - void copyrightsChanged(const QImage ©rightsImage); + void copyrightsImageChanged(const QImage ©rightsImage); void copyrightsChanged(const QString ©rightsHtml); void copyrightsStyleSheetChanged(const QString &styleSheet); void visibleAreaChanged(); diff --git a/src/location/maps/qgeomappingmanager.cpp b/src/location/maps/qgeomappingmanager.cpp index ef06199a..a0d06d3f 100644 --- a/src/location/maps/qgeomappingmanager.cpp +++ b/src/location/maps/qgeomappingmanager.cpp @@ -79,17 +79,11 @@ QGeoMappingManager::QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject qFatal("The mapping manager engine that was set for this mapping manager was NULL."); } - connect(d_ptr->engine, - SIGNAL(initialized()), - this, - SIGNAL(initialized()), - Qt::QueuedConnection); - - connect(d_ptr->engine, - SIGNAL(supportedMapTypesChanged()), - this, - SIGNAL(supportedMapTypesChanged()), - Qt::QueuedConnection); + connect(d_ptr->engine, &QGeoMappingManagerEngine::initialized, + this, &QGeoMappingManager::initialized, Qt::QueuedConnection); + + connect(d_ptr->engine, &QGeoMappingManagerEngine::supportedMapTypesChanged, + this, &QGeoMappingManager::supportedMapTypesChanged, Qt::QueuedConnection); } /*! diff --git a/src/location/maps/qgeoroutereply.cpp b/src/location/maps/qgeoroutereply.cpp index a3e6c439..902ab2f2 100644 --- a/src/location/maps/qgeoroutereply.cpp +++ b/src/location/maps/qgeoroutereply.cpp @@ -57,13 +57,13 @@ QT_BEGIN_NAMESPACE The isFinished(), error() and errorString() methods provide information on whether the operation has completed and if it completed successfully. - The finished() and error(QGeoRouteReply::Error,QString) + The finished() and errorOccurred(QGeoRouteReply::Error,QString) signals can be used to monitor the progress of the operation. It is possible that a newly created QGeoRouteReply may be in a finished state, most commonly because an error has occurred. Since such an instance will never emit the finished() or - error(QGeoRouteReply::Error,QString) signals, it is + errorOccurred(QGeoRouteReply::Error,QString) signals, it is important to check the result of isFinished() before making the connections to the signals. The documentation for QGeoRoutingManager demonstrates how this might be carried out. @@ -146,14 +146,14 @@ bool QGeoRouteReply::isFinished() const Sets the error state of this reply to \a error and the textual representation of the error to \a errorString. - This will also cause error() and finished() signals to be emitted, in that + This will also cause errorOccurred() and finished() signals to be emitted, in that order. */ void QGeoRouteReply::setError(QGeoRouteReply::Error error, const QString &errorString) { d_ptr->error = error; d_ptr->errorString = errorString; - emit this->error(error, errorString); + emit errorOccurred(error, errorString); setFinished(true); } @@ -248,7 +248,7 @@ void QGeoRouteReply::abort() signal. Use deleteLater() instead. */ /*! - \fn void QGeoRouteReply::error(QGeoRouteReply::Error error, const QString &errorString) + \fn void QGeoRouteReply::errorOccurred(QGeoRouteReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of this reply. The finished() signal will probably follow. @@ -256,7 +256,7 @@ void QGeoRouteReply::abort() The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. - This signal and QGeoRoutingManager::error() will be emitted at the same time. + This signal and QGeoRoutingManager::errorOccurred() will be emitted at the same time. \note Do not delete this reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeoroutereply.h b/src/location/maps/qgeoroutereply.h index 6a24a3b4..eebd2c7a 100644 --- a/src/location/maps/qgeoroutereply.h +++ b/src/location/maps/qgeoroutereply.h @@ -78,7 +78,7 @@ public: Q_SIGNALS: void finished(); void aborted(); - void error(QGeoRouteReply::Error error, const QString &errorString = QString()); + void errorOccurred(QGeoRouteReply::Error error, const QString &errorString = QString()); protected: explicit QGeoRouteReply(const QGeoRouteRequest &request, QObject *parent = nullptr); diff --git a/src/location/maps/qgeoroutingmanager.cpp b/src/location/maps/qgeoroutingmanager.cpp index 3e8cd402..88719edc 100644 --- a/src/location/maps/qgeoroutingmanager.cpp +++ b/src/location/maps/qgeoroutingmanager.cpp @@ -95,15 +95,11 @@ QGeoRoutingManager::QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject if (d_ptr->engine) { d_ptr->engine->setParent(this); - connect(d_ptr->engine, - SIGNAL(finished(QGeoRouteReply*)), - this, - SIGNAL(finished(QGeoRouteReply*))); - - connect(d_ptr->engine, - SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString)), - this, - SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString))); + connect(d_ptr->engine, &QGeoRoutingManagerEngine::finished, + this, &QGeoRoutingManager::finished); + + connect(d_ptr->engine, &QGeoRoutingManagerEngine::errorOccurred, + this, &QGeoRoutingManager::errorOccurred); } else { qFatal("The routing manager engine that was set for this routing manager was NULL."); } @@ -159,8 +155,8 @@ int QGeoRoutingManager::managerVersion() const The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoRoutingManager::finished(), - QGeoRoutingManager::error(), QGeoRouteReply::finished() or - QGeoRouteReply::error() with deleteLater(). + QGeoRoutingManager::errorOccurred(), QGeoRouteReply::finished() or + QGeoRouteReply::errorOccurred() with deleteLater(). */ QGeoRouteReply *QGeoRoutingManager::calculateRoute(const QGeoRouteRequest &request) { @@ -191,8 +187,8 @@ QGeoRouteReply *QGeoRoutingManager::calculateRoute(const QGeoRouteRequest &reque The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoRoutingManager::finished(), - QGeoRoutingManager::error(), QGeoRouteReply::finished() or - QGeoRouteReply::error() with deleteLater(). + QGeoRoutingManager::errorOccurred(), QGeoRouteReply::finished() or + QGeoRouteReply::errorOccurred() with deleteLater(). */ QGeoRouteReply *QGeoRoutingManager::updateRoute(const QGeoRoute &route, const QGeoCoordinate &position) { @@ -315,7 +311,7 @@ Use deleteLater() instead. */ /*! -\fn void QGeoRoutingManager::error(QGeoRouteReply *reply, QGeoRouteReply::Error error, QString errorString) +\fn void QGeoRoutingManager::errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of \a reply. The QGeoRoutingManager::finished() signal will probably follow. @@ -323,7 +319,7 @@ This signal is emitted when an error has been detected in the processing of The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. -This signal and QGeoRouteReply::error() will be emitted at the same time. +This signal and QGeoRouteReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeoroutingmanager.h b/src/location/maps/qgeoroutingmanager.h index 4b644989..be359b9a 100644 --- a/src/location/maps/qgeoroutingmanager.h +++ b/src/location/maps/qgeoroutingmanager.h @@ -77,7 +77,8 @@ public: Q_SIGNALS: void finished(QGeoRouteReply *reply); - void error(QGeoRouteReply *reply, QGeoRouteReply::Error error, QString errorString = QString()); + void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, + const QString &errorString = QString()); private: explicit QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject *parent = nullptr); diff --git a/src/location/maps/qgeoroutingmanagerengine.cpp b/src/location/maps/qgeoroutingmanagerengine.cpp index 1493c209..fe7ad322 100644 --- a/src/location/maps/qgeoroutingmanagerengine.cpp +++ b/src/location/maps/qgeoroutingmanagerengine.cpp @@ -166,8 +166,8 @@ int QGeoRoutingManagerEngine::managerVersion() const The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoRoutingManagerEngine::finished(), - QGeoRoutingManagerEngine::error(), QGeoRouteReply::finished() or - QGeoRouteReply::error() with deleteLater(). + QGeoRoutingManagerEngine::errorOccurred(), QGeoRouteReply::finished() or + QGeoRouteReply::errorOccurred() with deleteLater(). */ /*! @@ -194,8 +194,8 @@ int QGeoRoutingManagerEngine::managerVersion() const The user is responsible for deleting the returned reply object, although this can be done in the slot connected to QGeoRoutingManagerEngine::finished(), - QGeoRoutingManagerEngine::error(), QGeoRouteReply::finished() or - QGeoRouteReply::error() with deleteLater(). + QGeoRoutingManagerEngine::errorOccurred(), QGeoRouteReply::finished() or + QGeoRouteReply::errorOccurred() with deleteLater(). */ QGeoRouteReply *QGeoRoutingManagerEngine::updateRoute(const QGeoRoute &route, const QGeoCoordinate &position) { @@ -399,7 +399,7 @@ Use deleteLater() instead. */ /*! -\fn void QGeoRoutingManagerEngine::error(QGeoRouteReply *reply, QGeoRouteReply::Error error, QString errorString) +\fn void QGeoRoutingManagerEngine::errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of \a reply. The QGeoRoutingManagerEngine::finished() signal will probably follow. @@ -407,7 +407,7 @@ This signal is emitted when an error has been detected in the processing of The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. -This signal and QGeoRouteReply::error() will be emitted at the same time. +This signal and QGeoRouteReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/maps/qgeoroutingmanagerengine.h b/src/location/maps/qgeoroutingmanagerengine.h index 39dce678..fd193241 100644 --- a/src/location/maps/qgeoroutingmanagerengine.h +++ b/src/location/maps/qgeoroutingmanagerengine.h @@ -77,7 +77,8 @@ public: Q_SIGNALS: void finished(QGeoRouteReply *reply); - void error(QGeoRouteReply *reply, QGeoRouteReply::Error error, QString errorString = QString()); + void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, + const QString &errorString = QString()); protected: void setSupportedTravelModes(QGeoRouteRequest::TravelModes travelModes); diff --git a/src/location/maps/qgeotiledmappingmanagerengine.cpp b/src/location/maps/qgeotiledmappingmanagerengine.cpp index 05f18f82..64e9045b 100644 --- a/src/location/maps/qgeotiledmappingmanagerengine.cpp +++ b/src/location/maps/qgeotiledmappingmanagerengine.cpp @@ -83,15 +83,11 @@ void QGeoTiledMappingManagerEngine::setTileFetcher(QGeoTileFetcher *fetcher) qRegisterMetaType<QGeoTileSpec>(); - connect(d->fetcher_, - SIGNAL(tileFinished(QGeoTileSpec,QByteArray,QString)), - this, - SLOT(engineTileFinished(QGeoTileSpec,QByteArray,QString)), + connect(d->fetcher_, &QGeoTileFetcher::tileFinished, + this, &QGeoTiledMappingManagerEngine::engineTileFinished, Qt::QueuedConnection); - connect(d->fetcher_, - SIGNAL(tileError(QGeoTileSpec,QString)), - this, - SLOT(engineTileError(QGeoTileSpec,QString)), + connect(d->fetcher_, &QGeoTileFetcher::tileError, + this, &QGeoTiledMappingManagerEngine::engineTileError, Qt::QueuedConnection); engineInitialized(); diff --git a/src/location/maps/qgeotiledmapreply.cpp b/src/location/maps/qgeotiledmapreply.cpp index fe84d53a..7afceb7a 100644 --- a/src/location/maps/qgeotiledmapreply.cpp +++ b/src/location/maps/qgeotiledmapreply.cpp @@ -59,13 +59,13 @@ QT_BEGIN_NAMESPACE The isFinished(), error() and errorString() methods provide information on whether the operation has completed and if it completed successfully. - The finished() and error(QGeoTiledMapReply::Error,QString) + The finished() and errorOccurred(QGeoTiledMapReply::Error,QString) signals can be used to monitor the progress of the operation. It is possible that a newly created QGeoTiledMapReply may be in a finished state, most commonly because an error has occurred. Since such an instance will never emit the finished() or - error(QGeoTiledMapReply::Error,QString) signals, it is + errorOccurred(QGeoTiledMapReply::Error,QString) signals, it is important to check the result of isFinished() before making the connections to the signals. @@ -144,14 +144,14 @@ bool QGeoTiledMapReply::isFinished() const Sets the error state of this reply to \a error and the textual representation of the error to \a errorString. - This will also cause error() and finished() signals to be emitted, in that + This will also cause errorOccurred() and finished() signals to be emitted, in that order. */ void QGeoTiledMapReply::setError(QGeoTiledMapReply::Error error, const QString &errorString) { d_ptr->error = error; d_ptr->errorString = errorString; - emit this->error(error, errorString); + emit errorOccurred(error, errorString); setFinished(true); } @@ -248,7 +248,7 @@ void QGeoTiledMapReply::abort() emit aborted(); } -/* +/*! \fn void QGeoTiledMapReply::finished() This signal is emitted when this reply has finished processing. @@ -261,34 +261,10 @@ void QGeoTiledMapReply::abort() \note Do not delete this reply object in the slot connected to this signal. Use deleteLater() instead. - - \fn void QGeoTiledMapReply::error(QGeoTiledMapReply::Error error, const QString &errorString) - - This signal is emitted when an error has been detected in the processing of - this reply. The finished() signal will probably follow. - - The error will be described by the error code \a error. If \a errorString is - not empty it will contain a textual description of the error. - - This signal and QGeoRoutingManager::error() will be emitted at the same time. - - \note Do not delete this reply object in the slot connected to this - signal. Use deleteLater() instead. */ /*! - \fn void QGeoTiledMapReply::finished() - - This signal is emitted when this reply has finished processing. - - If error() equals QGeoTiledMapReply::NoError then the processing - finished successfully. - - \note Do not delete this reply object in the slot connected to this - signal. Use deleteLater() instead. -*/ -/*! - \fn void QGeoTiledMapReply::error(QGeoTiledMapReply::Error error, const QString &errorString) + \fn void QGeoTiledMapReply::errorOccurred(QGeoTiledMapReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of this reply. The finished() signal will probably follow. @@ -296,6 +272,8 @@ void QGeoTiledMapReply::abort() The error will be described by the error code \a error. If \a errorString is not empty it will contain a textual description of the error. + This signal and QGeoRoutingManager::errorOccurred() will be emitted at the same time. + \note Do not delete this reply object in the slot connected to this signal. Use deleteLater() instead. */ diff --git a/src/location/maps/qgeotiledmapreply_p.h b/src/location/maps/qgeotiledmapreply_p.h index 2f9144d9..5b0cff0a 100644 --- a/src/location/maps/qgeotiledmapreply_p.h +++ b/src/location/maps/qgeotiledmapreply_p.h @@ -92,7 +92,7 @@ public: Q_SIGNALS: void finished(); void aborted(); - void error(QGeoTiledMapReply::Error error, const QString &errorString = QString()); + void errorOccurred(QGeoTiledMapReply::Error error, const QString &errorString = QString()); protected: void setError(Error error, const QString &errorString); diff --git a/src/location/maps/qgeotilefetcher.cpp b/src/location/maps/qgeotilefetcher.cpp index cb1780bf..2d3b94e3 100644 --- a/src/location/maps/qgeotilefetcher.cpp +++ b/src/location/maps/qgeotilefetcher.cpp @@ -138,11 +138,8 @@ void QGeoTileFetcher::requestNextTile() if (reply->isFinished()) { handleReply(reply, ts); } else { - connect(reply, - SIGNAL(finished()), - this, - SLOT(finished()), - Qt::QueuedConnection); + connect(reply, &QGeoTiledMapReply::finished, + this, &QGeoTileFetcher::finished, Qt::QueuedConnection); d->invmap_.insert(ts, reply); } diff --git a/src/location/maps/qgeotilerequestmanager.cpp b/src/location/maps/qgeotilerequestmanager.cpp index 79de9d41..4b0d1602 100644 --- a/src/location/maps/qgeotilerequestmanager.cpp +++ b/src/location/maps/qgeotilerequestmanager.cpp @@ -238,7 +238,7 @@ void QGeoTileRequestManagerPrivate::tileError(const QGeoTileSpec &tile, const QS QSharedPointer<RetryFuture> future(new RetryFuture(tile,m_map,m_engine)); m_futures.insert(tile, future); - QTimer::singleShot(delay, future.data(), SLOT(retry())); + QTimer::singleShot(delay, future.data(), &RetryFuture::retry); // Passing .data() to singleShot is ok -- Qt will clean up the // connection if the target qobject is deleted } diff --git a/src/location/maps/qnavigationmanager.cpp b/src/location/maps/qnavigationmanager.cpp index 3b5e73b0..f5f4dc57 100644 --- a/src/location/maps/qnavigationmanager.cpp +++ b/src/location/maps/qnavigationmanager.cpp @@ -118,11 +118,8 @@ QNavigationManager::QNavigationManager(QNavigationManagerEngine *engine, QObject qFatal("The navigation manager engine that was set for this mapping manager was NULL."); } - connect(d_ptr->engine, - SIGNAL(initialized()), - this, - SIGNAL(initialized()), - Qt::QueuedConnection); + connect(d_ptr->engine, &QNavigationManagerEngine::initialized, + this, &QNavigationManager::initialized, Qt::QueuedConnection); } QT_END_NAMESPACE diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp index 4829b508..2886f342 100644 --- a/src/location/places/qplacemanager.cpp +++ b/src/location/places/qplacemanager.cpp @@ -163,25 +163,26 @@ QPlaceManager::QPlaceManager(QPlaceManagerEngine *engine, QObject *parent) qRegisterMetaType<QPlaceCategory>(); - connect(d, SIGNAL(finished(QPlaceReply*)), this, SIGNAL(finished(QPlaceReply*))); - connect(d, SIGNAL(error(QPlaceReply*,QPlaceReply::Error)), - this, SIGNAL(error(QPlaceReply*,QPlaceReply::Error))); - - connect(d, SIGNAL(placeAdded(QString)), - this, SIGNAL(placeAdded(QString)), Qt::QueuedConnection); - connect(d, SIGNAL(placeUpdated(QString)), - this, SIGNAL(placeUpdated(QString)), Qt::QueuedConnection); - connect(d, SIGNAL(placeRemoved(QString)), - this, SIGNAL(placeRemoved(QString)), Qt::QueuedConnection); - - connect(d, SIGNAL(categoryAdded(QPlaceCategory,QString)), - this, SIGNAL(categoryAdded(QPlaceCategory,QString))); - connect(d, SIGNAL(categoryUpdated(QPlaceCategory,QString)), - this, SIGNAL(categoryUpdated(QPlaceCategory,QString))); - connect(d, SIGNAL(categoryRemoved(QString,QString)), - this, SIGNAL(categoryRemoved(QString,QString))); - connect(d, SIGNAL(dataChanged()), - this, SIGNAL(dataChanged()), Qt::QueuedConnection); + connect(d, &QPlaceManagerEngine::finished, + this, &QPlaceManager::finished); + connect(d, &QPlaceManagerEngine::errorOccurred, + this, &QPlaceManager::errorOccurred); + + connect(d, &QPlaceManagerEngine::placeAdded, + this, &QPlaceManager::placeAdded, Qt::QueuedConnection); + connect(d, &QPlaceManagerEngine::placeUpdated, + this, &QPlaceManager::placeUpdated, Qt::QueuedConnection); + connect(d, &QPlaceManagerEngine::placeRemoved, + this, &QPlaceManager::placeRemoved, Qt::QueuedConnection); + + connect(d, &QPlaceManagerEngine::categoryAdded, + this, &QPlaceManager::categoryAdded); + connect(d, &QPlaceManagerEngine::categoryUpdated, + this, &QPlaceManager::categoryUpdated); + connect(d, &QPlaceManagerEngine::categoryRemoved, + this, &QPlaceManager::categoryRemoved); + connect(d, &QPlaceManagerEngine::dataChanged, + this, &QPlaceManager::dataChanged, Qt::QueuedConnection); } else { qFatal("The place manager engine that was set for this place manager was NULL."); } @@ -419,7 +420,7 @@ QPlaceMatchReply *QPlaceManager::matchingPlaces(const QPlaceMatchRequest &reques */ /*! - \fn void QPlaceManager::error(QPlaceReply *reply, QPlaceReply::Error error, const QString &errorString) + \fn void QPlaceManager::errorOccurred(QPlaceReply *reply, QPlaceReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of \a reply. The QPlaceManager::finished() signal will probably follow. @@ -428,7 +429,7 @@ QPlaceMatchReply *QPlaceManager::matchingPlaces(const QPlaceMatchRequest &reques not empty it will contain a textual description of the error meant for developers and not end users. - This signal and QPlaceReply::error() will be emitted at the same time. + This signal and QPlaceReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index 893922ad..1015e874 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -104,7 +104,8 @@ public: Q_SIGNALS: void finished(QPlaceReply *reply); - void error(QPlaceReply *, QPlaceReply::Error error, const QString &errorString = QString()); + void errorOccurred(QPlaceReply *, QPlaceReply::Error error, + const QString &errorString = QString()); void placeAdded(const QString &placeId); void placeUpdated(const QString &placeId); diff --git a/src/location/places/qplacemanagerengine.cpp b/src/location/places/qplacemanagerengine.cpp index a64e6efb..302e029b 100644 --- a/src/location/places/qplacemanagerengine.cpp +++ b/src/location/places/qplacemanagerengine.cpp @@ -380,7 +380,7 @@ QPlaceManagerEnginePrivate::~QPlaceManagerEnginePrivate() */ /*! - \fn void QPlaceManagerEngine::error(QPlaceReply * reply, QPlaceReply::Error error, const QString &errorString = QString()); + \fn void QPlaceManagerEngine::errorOccurred(QPlaceReply * reply, QPlaceReply::Error error, const QString &errorString = QString()); This signal is emitted when an error has been detected in the processing of \a reply. The QPlaceManager::finished() signal will probably follow. @@ -389,7 +389,7 @@ QPlaceManagerEnginePrivate::~QPlaceManagerEnginePrivate() not empty it will contain a textual description of the error meant for developers and not end users. - This signal and QPlaceReply::error() will be emitted at the same time. + This signal and QPlaceReply::errorOccurred() will be emitted at the same time. \note Do not delete the \a reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h index 5701a2a4..df91bac4 100644 --- a/src/location/places/qplacemanagerengine.h +++ b/src/location/places/qplacemanagerengine.h @@ -94,7 +94,8 @@ public: Q_SIGNALS: void finished(QPlaceReply *reply); - void error(QPlaceReply *, QPlaceReply::Error error, const QString &errorString = QString()); + void errorOccurred(QPlaceReply *, QPlaceReply::Error error, + const QString &errorString = QString()); void placeAdded(const QString &placeId); void placeUpdated(const QString &placeId); diff --git a/src/location/places/qplacereply.cpp b/src/location/places/qplacereply.cpp index cb44a55b..03625fcc 100644 --- a/src/location/places/qplacereply.cpp +++ b/src/location/places/qplacereply.cpp @@ -169,7 +169,8 @@ void QPlaceReply::setFinished(bool finished) /*! Sets the \a error and \a errorString of the reply. - This function does not cause the QPlaceReply::error(QPlaceReply::Error, const QString &errorString) + This function does not cause the + QPlaceReply::errorOccurred(QPlaceReply::Error, const QString &errorString) signal to be emitted. */ void QPlaceReply::setError(QPlaceReply::Error error, const QString &errorString) @@ -245,7 +246,7 @@ void QPlaceReply::abort() */ /*! - \fn void QPlaceReply::error(QPlaceReply::Error error, const QString &errorString) + \fn void QPlaceReply::errorOccurred(QPlaceReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of this reply. The finished() signal will probably follow. @@ -254,7 +255,7 @@ void QPlaceReply::abort() not empty it will contain a textual description of the error meant for developers and not end users. - This signal and QPlaceManager::error() will be emitted at the same time. + This signal and QPlaceManager::errorOccurred() will be emitted at the same time. \note Do not delete this reply object in the slot connected to this signal. Use deleteLater() instead. diff --git a/src/location/places/qplacereply.h b/src/location/places/qplacereply.h index 85ac8520..63e840cc 100644 --- a/src/location/places/qplacereply.h +++ b/src/location/places/qplacereply.h @@ -91,7 +91,7 @@ Q_SIGNALS: void finished(); void contentUpdated(); void aborted(); - void error(QPlaceReply::Error error, const QString &errorString = QString()); + void errorOccurred(QPlaceReply::Error error, const QString &errorString = QString()); protected: explicit QPlaceReply(QPlaceReplyPrivate *, QObject *parent = nullptr); diff --git a/src/location/places/unsupportedreplies_p.h b/src/location/places/unsupportedreplies_p.h index bf3336a3..76133cf3 100644 --- a/src/location/places/unsupportedreplies_p.h +++ b/src/location/places/unsupportedreplies_p.h @@ -72,10 +72,10 @@ public: setError(QPlaceReply::UnsupportedError, QStringLiteral("Getting place details is not supported.")); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -96,10 +96,10 @@ public: setError(QPlaceReply::UnsupportedError, QStringLiteral("Place content is not supported.")); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -120,10 +120,10 @@ public: { setError(errorCode, message); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -144,10 +144,10 @@ public: setError(QPlaceReply::UnsupportedError, QStringLiteral("Place search suggestions are not supported.")); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -168,10 +168,10 @@ public: { setError(QPlaceReply::UnsupportedError, message); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -191,10 +191,10 @@ public: { setError(QPlaceReply::UnsupportedError, message); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); @@ -215,10 +215,10 @@ public: setError(QPlaceReply::UnsupportedError, QStringLiteral("Place matching is not supported.")); setFinished(true); - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); - QMetaObject::invokeMethod(parent, "error", Qt::QueuedConnection, + QMetaObject::invokeMethod(parent, "errorOccurred", Qt::QueuedConnection, Q_ARG(QPlaceReply *, this), Q_ARG(QPlaceReply::Error, error()), Q_ARG(QString, errorString())); |