diff --git a/doc/api_break.dox b/doc/api_break.dox index 1fb5b53c42b..3b709f16f23 100644 --- a/doc/api_break.dox +++ b/doc/api_break.dox @@ -603,13 +603,17 @@ QgsCptCityColorRampDialog {#qgis_api_break_3_0_QgsCptCityColorRampDialog} and the new ramp can be retrieved after executing the dialog by calling ramp(). - Some internal methods which were previously public or protected were made private. +QgsCptCityDataItem {#qgis_api_break_3_0_QgsCptCityDataItem} +----------------------- + +- emitBeginInsertItems, emitEndInsertItems, emitBeginRemoveItems and emitEndRemoveItems were removed. There +should be no need to call these slots manually. QgsCptCitySelectionItem {#qgis_api_break_3_0_QgsCptCitySelectionItem} ----------------------- - parseXML() has been renamed to parseXml() - QgsCRSCache {#qgis_api_break_3_0_QgsCRSCache} ----------- diff --git a/python/core/symbology-ng/qgscptcityarchive.sip b/python/core/symbology-ng/qgscptcityarchive.sip index 9453acc425a..ab758d032ac 100644 --- a/python/core/symbology-ng/qgscptcityarchive.sip +++ b/python/core/symbology-ng/qgscptcityarchive.sip @@ -129,12 +129,6 @@ class QgsCptCityDataItem : QObject bool isValid(); - public slots: - void emitBeginInsertItems( QgsCptCityDataItem* parent, int first, int last ); - void emitEndInsertItems(); - void emitBeginRemoveItems( QgsCptCityDataItem* parent, int first, int last ); - void emitEndRemoveItems(); - signals: void beginInsertItems( QgsCptCityDataItem* parent, int first, int last ); void endInsertItems(); diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index f12eed934a7..e932c78e186 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -10249,7 +10249,7 @@ void QgisApp::layersWereAdded( const QList& theLayers ) connect( rlayer, SIGNAL( drawingProgress( int, int ) ), this, SLOT( showProgress( int, int ) ) ); // connect up any request the raster may make to update the statusbar message - connect( rlayer, SIGNAL( statusChanged( QString ) ), this, SLOT( showStatusMessage( QString ) ) ); + connect( rlayer, &QgsRasterLayer::statusChanged, this, &QgisApp::showStatusMessage ); provider = rlayer->dataProvider(); } diff --git a/src/core/layertree/qgslayertreemodel.cpp b/src/core/layertree/qgslayertreemodel.cpp index 2fc0cf86be0..27079883e65 100644 --- a/src/core/layertree/qgslayertreemodel.cpp +++ b/src/core/layertree/qgslayertreemodel.cpp @@ -837,7 +837,7 @@ void QgsLayerTreeModel::connectToLayer( QgsLayerTreeLayer* nodeLayer ) } QgsMapLayer* layer = nodeLayer->layer(); - connect( layer, SIGNAL( legendChanged() ), this, SLOT( layerLegendChanged() ), Qt::UniqueConnection ); + connect( layer, &QgsMapLayer::legendChanged, this, &QgsLayerTreeModel::layerLegendChanged, Qt::UniqueConnection ); if ( layer->type() == QgsMapLayer::VectorLayer ) { diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index 31fde2814f9..00dee9bd355 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -1649,7 +1649,7 @@ void QgsMapLayer::setLegend( QgsMapLayerLegend* legend ) mLegend = legend; if ( mLegend ) - connect( mLegend, SIGNAL( itemsChanged() ), this, SIGNAL( legendChanged() ) ); + connect( mLegend, &QgsMapLayerLegend::itemsChanged, this, &QgsMapLayer::legendChanged ); emit legendChanged(); } diff --git a/src/core/qgstransactiongroup.cpp b/src/core/qgstransactiongroup.cpp index 94ae4700f81..486c9fc8e01 100644 --- a/src/core/qgstransactiongroup.cpp +++ b/src/core/qgstransactiongroup.cpp @@ -53,8 +53,8 @@ bool QgsTransactionGroup::addLayer( QgsVectorLayer* layer ) mLayers.insert( layer ); - connect( layer, SIGNAL( beforeEditingStarted() ), this, SLOT( onEditingStarted() ) ); - connect( layer, SIGNAL( destroyed() ), this, SLOT( onLayerDeleted() ) ); + connect( layer, &QgsVectorLayer::beforeEditingStarted, this, &QgsTransactionGroup::onEditingStarted ); + connect( layer, &QgsVectorLayer::destroyed, this, &QgsTransactionGroup::onLayerDeleted ); return true; } @@ -88,8 +88,8 @@ void QgsTransactionGroup::onEditingStarted() { mTransaction->addLayer( layer ); layer->startEditing(); - connect( layer, SIGNAL( beforeCommitChanges() ), this, SLOT( onCommitChanges() ) ); - connect( layer, SIGNAL( beforeRollBack() ), this, SLOT( onRollback() ) ); + connect( layer, &QgsVectorLayer::beforeCommitChanges, this, &QgsTransactionGroup::onCommitChanges ); + connect( layer, &QgsVectorLayer::beforeRollBack, this, &QgsTransactionGroup::onRollback ); } } @@ -160,8 +160,8 @@ void QgsTransactionGroup::disableTransaction() Q_FOREACH ( QgsVectorLayer* layer, mLayers ) { - disconnect( layer, SIGNAL( beforeCommitChanges() ), this, SLOT( onCommitChanges() ) ); - disconnect( layer, SIGNAL( beforeRollBack() ), this, SLOT( onRollback() ) ); + disconnect( layer, &QgsVectorLayer::beforeCommitChanges, this, &QgsTransactionGroup::onCommitChanges ); + disconnect( layer, &QgsVectorLayer::beforeRollBack, this, &QgsTransactionGroup::onRollback ); } } diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp index 8c0782feb4d..a020a4409d3 100644 --- a/src/core/qgsvectorlayer.cpp +++ b/src/core/qgsvectorlayer.cpp @@ -157,7 +157,7 @@ QgsVectorLayer::QgsVectorLayer( const QString& vectorLayerPath, connect( this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( selectionChanged() ) ); connect( this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( repaintRequested() ) ); - connect( QgsProject::instance()->relationManager(), SIGNAL( relationsLoaded() ), this, SLOT( onRelationsLoaded() ) ); + connect( QgsProject::instance()->relationManager(), &QgsRelationManager::relationsLoaded, this, &QgsVectorLayer::onRelationsLoaded ); // Default simplify drawing settings QSettings settings; @@ -1329,30 +1329,21 @@ bool QgsVectorLayer::startEditing() mEditBuffer = new QgsVectorLayerEditBuffer( this ); } // forward signals - connect( mEditBuffer, SIGNAL( layerModified() ), this, SLOT( invalidateSymbolCountedFlag() ) ); - connect( mEditBuffer, SIGNAL( layerModified() ), this, SIGNAL( layerModified() ) ); // TODO[MD]: necessary? + connect( mEditBuffer, &QgsVectorLayerEditBuffer::layerModified, this, &QgsVectorLayer::invalidateSymbolCountedFlag ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::layerModified, this, &QgsVectorLayer::layerModified ); // TODO[MD]: necessary? //connect( mEditBuffer, SIGNAL( layerModified() ), this, SLOT( triggerRepaint() ) ); // TODO[MD]: works well? - connect( mEditBuffer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SIGNAL( featureAdded( QgsFeatureId ) ) ); - connect( mEditBuffer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( onFeatureDeleted( QgsFeatureId ) ) ); - connect( mEditBuffer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ), this, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ) ); - connect( mEditBuffer, SIGNAL( attributeValueChanged( QgsFeatureId, int, QVariant ) ), this, SIGNAL( attributeValueChanged( QgsFeatureId, int, QVariant ) ) ); - connect( mEditBuffer, SIGNAL( attributeAdded( int ) ), this, SIGNAL( attributeAdded( int ) ) ); - connect( mEditBuffer, SIGNAL( attributeDeleted( int ) ), this, SIGNAL( attributeDeleted( int ) ) ); - - connect( mEditBuffer, SIGNAL( committedAttributesDeleted( const QString &, const QgsAttributeList & ) ), - this, SIGNAL( committedAttributesDeleted( const QString &, const QgsAttributeList & ) ) ); - - connect( mEditBuffer, SIGNAL( committedAttributesAdded( const QString &, const QList & ) ), - this, SIGNAL( committedAttributesAdded( const QString &, const QList & ) ) ); - - connect( mEditBuffer, SIGNAL( committedFeaturesAdded( QString, QgsFeatureList ) ), this, SIGNAL( committedFeaturesAdded( QString, QgsFeatureList ) ) ); - connect( mEditBuffer, SIGNAL( committedFeaturesRemoved( QString, QgsFeatureIds ) ), this, SIGNAL( committedFeaturesRemoved( QString, QgsFeatureIds ) ) ); - - connect( mEditBuffer, SIGNAL( committedAttributeValuesChanges( const QString &, const QgsChangedAttributesMap & ) ), - this, SIGNAL( committedAttributeValuesChanges( const QString &, const QgsChangedAttributesMap & ) ) ); - - connect( mEditBuffer, SIGNAL( committedGeometriesChanges( const QString &, const QgsGeometryMap & ) ), - this, SIGNAL( committedGeometriesChanges( const QString &, const QgsGeometryMap & ) ) ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::featureAdded, this, &QgsVectorLayer::featureAdded ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::featureDeleted, this, &QgsVectorLayer::onFeatureDeleted ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::geometryChanged, this, &QgsVectorLayer::geometryChanged ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::attributeValueChanged, this, &QgsVectorLayer::attributeValueChanged ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::attributeAdded, this, &QgsVectorLayer::attributeAdded ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::attributeDeleted, this, &QgsVectorLayer::attributeDeleted ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedAttributesDeleted, this, &QgsVectorLayer::committedAttributesDeleted ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedAttributesAdded, this, &QgsVectorLayer::committedAttributesAdded ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedFeaturesAdded, this, &QgsVectorLayer::committedFeaturesAdded ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedFeaturesRemoved, this, &QgsVectorLayer::committedFeaturesRemoved ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedAttributeValuesChanges, this, &QgsVectorLayer::committedAttributeValuesChanges ); + connect( mEditBuffer, &QgsVectorLayerEditBuffer::committedGeometriesChanges, this, &QgsVectorLayer::committedGeometriesChanges ); updateFields(); @@ -1416,7 +1407,7 @@ bool QgsVectorLayer::readXml( const QDomNode& layer_node ) if ( !mJoinBuffer ) { mJoinBuffer = new QgsVectorLayerJoinBuffer( this ); - connect( mJoinBuffer, SIGNAL( joinedFieldsChanged() ), this, SLOT( onJoinedFieldsChanged() ) ); + connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged ); } mJoinBuffer->readXml( layer_node ); @@ -1525,7 +1516,7 @@ bool QgsVectorLayer::setDataProvider( QString const & provider ) return false; } - connect( mDataProvider, SIGNAL( raiseError( QString ) ), this, SIGNAL( raiseError( QString ) ) ); + connect( mDataProvider, &QgsVectorDataProvider::raiseError, this, &QgsVectorLayer::raiseError ); QgsDebugMsg( "Instantiated the data provider plugin" ); @@ -1537,13 +1528,13 @@ bool QgsVectorLayer::setDataProvider( QString const & provider ) } // TODO: Check if the provider has the capability to send fullExtentCalculated - connect( mDataProvider, SIGNAL( fullExtentCalculated() ), this, SLOT( updateExtents() ) ); + connect( mDataProvider, &QgsVectorDataProvider::fullExtentCalculated, this, &QgsVectorLayer::updateExtents ); // get and store the feature type mWkbType = mDataProvider->wkbType(); mJoinBuffer = new QgsVectorLayerJoinBuffer( this ); - connect( mJoinBuffer, SIGNAL( joinedFieldsChanged() ), this, SLOT( onJoinedFieldsChanged() ) ); + connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged ); mExpressionFieldBuffer = new QgsExpressionFieldBuffer(); updateFields(); @@ -4165,11 +4156,11 @@ bool QgsVectorLayer::setDependencies( const QSet& oDeps ) QgsVectorLayer* lyr = static_cast( QgsMapLayerRegistry::instance()->mapLayer( dep.layerId() ) ); if ( lyr == nullptr ) continue; - disconnect( lyr, SIGNAL( featureAdded( QgsFeatureId ) ), this, SIGNAL( dataChanged() ) ); - disconnect( lyr, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SIGNAL( dataChanged() ) ); - disconnect( lyr, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ), this, SIGNAL( dataChanged() ) ); - disconnect( lyr, SIGNAL( dataChanged() ), this, SIGNAL( dataChanged() ) ); - disconnect( lyr, SIGNAL( repaintRequested() ), this, SLOT( triggerRepaint() ) ); + disconnect( lyr, &QgsVectorLayer::featureAdded, this, &QgsVectorLayer::dataChanged ); + disconnect( lyr, &QgsVectorLayer::featureDeleted, this, &QgsVectorLayer::dataChanged ); + disconnect( lyr, &QgsVectorLayer::geometryChanged, this, &QgsVectorLayer::dataChanged ); + disconnect( lyr, &QgsVectorLayer::dataChanged, this, &QgsVectorLayer::dataChanged ); + disconnect( lyr, &QgsVectorLayer::repaintRequested, this, &QgsVectorLayer::triggerRepaint ); } // assign new dependencies @@ -4185,11 +4176,11 @@ bool QgsVectorLayer::setDependencies( const QSet& oDeps ) QgsVectorLayer* lyr = static_cast( QgsMapLayerRegistry::instance()->mapLayer( dep.layerId() ) ); if ( lyr == nullptr ) continue; - connect( lyr, SIGNAL( featureAdded( QgsFeatureId ) ), this, SIGNAL( dataChanged() ) ); - connect( lyr, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SIGNAL( dataChanged() ) ); - connect( lyr, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ), this, SIGNAL( dataChanged() ) ); - connect( lyr, SIGNAL( dataChanged() ), this, SIGNAL( dataChanged() ) ); - connect( lyr, SIGNAL( repaintRequested() ), this, SLOT( triggerRepaint() ) ); + connect( lyr, &QgsVectorLayer::featureAdded, this, &QgsVectorLayer::dataChanged ); + connect( lyr, &QgsVectorLayer::featureDeleted, this, &QgsVectorLayer::dataChanged ); + connect( lyr, &QgsVectorLayer::geometryChanged, this, &QgsVectorLayer::dataChanged ); + connect( lyr, &QgsVectorLayer::dataChanged, this, &QgsVectorLayer::dataChanged ); + connect( lyr, &QgsVectorLayer::repaintRequested, this, &QgsVectorLayer::triggerRepaint ); } // if new layers are present, emit a data change diff --git a/src/core/qgsvectorlayercache.cpp b/src/core/qgsvectorlayercache.cpp index c46cb8e899c..74a8ef7c6cd 100644 --- a/src/core/qgsvectorlayercache.cpp +++ b/src/core/qgsvectorlayercache.cpp @@ -26,18 +26,18 @@ QgsVectorLayerCache::QgsVectorLayerCache( QgsVectorLayer* layer, int cacheSize, { mCache.setMaxCost( cacheSize ); - connect( mLayer, SIGNAL( featureDeleted( QgsFeatureId ) ), SLOT( featureDeleted( QgsFeatureId ) ) ); - connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), SLOT( onFeatureAdded( QgsFeatureId ) ) ); - connect( mLayer, SIGNAL( destroyed() ), SLOT( layerDeleted() ) ); + connect( mLayer, &QgsVectorLayer::featureDeleted, this, &QgsVectorLayerCache::featureDeleted ); + connect( mLayer, &QgsVectorLayer::featureAdded, this, &QgsVectorLayerCache::onFeatureAdded ); + connect( mLayer, &QgsVectorLayer::destroyed, this, &QgsVectorLayerCache::layerDeleted ); setCacheGeometry( true ); setCacheSubsetOfAttributes( mLayer->attributeList() ); setCacheAddedAttributes( true ); - connect( mLayer, SIGNAL( attributeDeleted( int ) ), SLOT( attributeDeleted( int ) ) ); - connect( mLayer, SIGNAL( updatedFields() ), SLOT( invalidate() ) ); - connect( mLayer, SIGNAL( dataChanged() ), SLOT( invalidate() ) ); - connect( mLayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant& ) ), SLOT( onAttributeValueChanged( QgsFeatureId, int, const QVariant& ) ) ); + connect( mLayer, &QgsVectorLayer::attributeDeleted, this, &QgsVectorLayerCache::attributeDeleted ); + connect( mLayer, &QgsVectorLayer::updatedFields, this, &QgsVectorLayerCache::invalidate ); + connect( mLayer, &QgsVectorLayer::dataChanged, this, &QgsVectorLayerCache::invalidate ); + connect( mLayer, &QgsVectorLayer::attributeValueChanged, this, &QgsVectorLayerCache::onAttributeValueChanged ); } QgsVectorLayerCache::~QgsVectorLayerCache() @@ -61,11 +61,11 @@ void QgsVectorLayerCache::setCacheGeometry( bool cacheGeometry ) mCacheGeometry = cacheGeometry && mLayer->hasGeometryType(); if ( cacheGeometry ) { - connect( mLayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ), SLOT( geometryChanged( QgsFeatureId, const QgsGeometry& ) ) ); + connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsVectorLayerCache::geometryChanged ); } else { - disconnect( mLayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry& ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry& ) ) ); + disconnect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsVectorLayerCache::geometryChanged ); } } @@ -124,11 +124,11 @@ void QgsVectorLayerCache::setCacheAddedAttributes( bool cacheAddedAttributes ) { if ( cacheAddedAttributes ) { - connect( mLayer, SIGNAL( attributeAdded( int ) ), SLOT( attributeAdded( int ) ) ); + connect( mLayer, &QgsVectorLayer::attributeAdded, this, &QgsVectorLayerCache::attributeAdded ); } else { - disconnect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) ); + disconnect( mLayer, &QgsVectorLayer::attributeAdded, this, &QgsVectorLayerCache::attributeAdded ); } } diff --git a/src/core/qgsvectorlayereditbuffer.cpp b/src/core/qgsvectorlayereditbuffer.cpp index 72c9fb8072a..7ff4a097324 100644 --- a/src/core/qgsvectorlayereditbuffer.cpp +++ b/src/core/qgsvectorlayereditbuffer.cpp @@ -37,7 +37,7 @@ template void mapToReversedLists( const QMap< Key, T >& map QgsVectorLayerEditBuffer::QgsVectorLayerEditBuffer( QgsVectorLayer* layer ) : L( layer ) { - connect( L->undoStack(), SIGNAL( indexChanged( int ) ), this, SLOT( undoIndexChanged( int ) ) ); // TODO[MD]: queued? + connect( L->undoStack(), &QUndoStack::indexChanged, this, &QgsVectorLayerEditBuffer::undoIndexChanged ); // TODO[MD]: queued? } QgsVectorLayerEditBuffer::~QgsVectorLayerEditBuffer() diff --git a/src/core/qgsvectorlayerjoinbuffer.cpp b/src/core/qgsvectorlayerjoinbuffer.cpp index e9b734493e8..c69d7ede161 100644 --- a/src/core/qgsvectorlayerjoinbuffer.cpp +++ b/src/core/qgsvectorlayerjoinbuffer.cpp @@ -89,8 +89,8 @@ bool QgsVectorLayerJoinBuffer::addJoin( const QgsVectorJoinInfo& joinInfo ) // Unique connection makes sure we do not respond to one layer's update more times (in case of multiple join) if ( QgsVectorLayer* vl = qobject_cast( QgsMapLayerRegistry::instance()->mapLayer( joinInfo.joinLayerId ) ) ) { - connect( vl, SIGNAL( updatedFields() ), this, SLOT( joinedLayerUpdatedFields() ), Qt::UniqueConnection ); - connect( vl, SIGNAL( layerModified() ), this, SLOT( joinedLayerModified() ), Qt::UniqueConnection ); + connect( vl, &QgsVectorLayer::updatedFields, this, &QgsVectorLayerJoinBuffer::joinedLayerUpdatedFields, Qt::UniqueConnection ); + connect( vl, &QgsVectorLayer::layerModified, this, &QgsVectorLayerJoinBuffer::joinedLayerModified, Qt::UniqueConnection ); } emit joinedFieldsChanged(); @@ -113,7 +113,7 @@ bool QgsVectorLayerJoinBuffer::removeJoin( const QString& joinLayerId ) if ( QgsVectorLayer* vl = qobject_cast( QgsMapLayerRegistry::instance()->mapLayer( joinLayerId ) ) ) { - disconnect( vl, SIGNAL( updatedFields() ), this, SLOT( joinedLayerUpdatedFields() ) ); + disconnect( vl, &QgsVectorLayer::updatedFields, this, &QgsVectorLayerJoinBuffer::joinedLayerUpdatedFields ); } emit joinedFieldsChanged(); @@ -273,8 +273,8 @@ void QgsVectorLayerJoinBuffer::createJoinCaches() // make sure we are connected to the joined layer if ( QgsVectorLayer* vl = qobject_cast( QgsMapLayerRegistry::instance()->mapLayer( joinIt->joinLayerId ) ) ) { - connect( vl, SIGNAL( updatedFields() ), this, SLOT( joinedLayerUpdatedFields() ), Qt::UniqueConnection ); - connect( vl, SIGNAL( layerModified() ), this, SLOT( joinedLayerModified() ), Qt::UniqueConnection ); + connect( vl, &QgsVectorLayer::updatedFields, this, &QgsVectorLayerJoinBuffer::joinedLayerUpdatedFields, Qt::UniqueConnection ); + connect( vl, &QgsVectorLayer::layerModified, this, &QgsVectorLayerJoinBuffer::joinedLayerModified, Qt::UniqueConnection ); } } } diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index 4260760814f..febade81ce4 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -818,16 +818,10 @@ void QgsRasterLayer::setDataProvider( QString const & provider ) mLastModified = lastModified( mDataSource ); // Connect provider signals - connect( - mDataProvider, SIGNAL( progress( int, double, QString ) ), - this, SLOT( onProgress( int, double, QString ) ) - ); + connect( mDataProvider, &QgsRasterDataProvider::progress, this, &QgsRasterLayer::onProgress ); // Do a passthrough for the status bar text - connect( - mDataProvider, SIGNAL( statusChanged( QString ) ), - this, SIGNAL( statusChanged( QString ) ) - ); + connect( mDataProvider, &QgsRasterDataProvider::statusChanged, this, &QgsRasterLayer::statusChanged ); //mark the layer as valid mValid = true; diff --git a/src/core/symbology-ng/qgscptcityarchive.cpp b/src/core/symbology-ng/qgscptcityarchive.cpp index 4d90e47dcf4..342bccd4715 100644 --- a/src/core/symbology-ng/qgscptcityarchive.cpp +++ b/src/core/symbology-ng/qgscptcityarchive.cpp @@ -508,23 +508,6 @@ QgsCptCityDataItem::~QgsCptCityDataItem() // QgsDebugMsg( "mName = " + mName + " mPath = " + mPath ); } -void QgsCptCityDataItem::emitBeginInsertItems( QgsCptCityDataItem* parent, int first, int last ) -{ - emit beginInsertItems( parent, first, last ); -} -void QgsCptCityDataItem::emitEndInsertItems() -{ - emit endInsertItems(); -} -void QgsCptCityDataItem::emitBeginRemoveItems( QgsCptCityDataItem* parent, int first, int last ) -{ - emit beginRemoveItems( parent, first, last ); -} -void QgsCptCityDataItem::emitEndRemoveItems() -{ - emit endRemoveItems(); -} - QVector QgsCptCityDataItem::createChildren() { QVector children; @@ -607,14 +590,10 @@ void QgsCptCityDataItem::addChildItem( QgsCptCityDataItem * child, bool refresh mChildren.insert( i, child ); - connect( child, SIGNAL( beginInsertItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( emitBeginInsertItems( QgsCptCityDataItem*, int, int ) ) ); - connect( child, SIGNAL( endInsertItems() ), - this, SLOT( emitEndInsertItems() ) ); - connect( child, SIGNAL( beginRemoveItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( emitBeginRemoveItems( QgsCptCityDataItem*, int, int ) ) ); - connect( child, SIGNAL( endRemoveItems() ), - this, SLOT( emitEndRemoveItems() ) ); + connect( child, &QgsCptCityDataItem::beginInsertItems, this, &QgsCptCityDataItem::beginInsertItems ); + connect( child, &QgsCptCityDataItem::endInsertItems, this, &QgsCptCityDataItem::endInsertItems ); + connect( child, &QgsCptCityDataItem::beginRemoveItems, this, &QgsCptCityDataItem::beginRemoveItems ); + connect( child, &QgsCptCityDataItem::endRemoveItems, this, &QgsCptCityDataItem::endRemoveItems ); if ( refresh ) emit endInsertItems(); @@ -638,14 +617,10 @@ QgsCptCityDataItem * QgsCptCityDataItem::removeChildItem( QgsCptCityDataItem * c emit beginRemoveItems( this, i, i ); mChildren.remove( i ); emit endRemoveItems(); - disconnect( child, SIGNAL( beginInsertItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( emitBeginInsertItems( QgsCptCityDataItem*, int, int ) ) ); - disconnect( child, SIGNAL( endInsertItems() ), - this, SLOT( emitEndInsertItems() ) ); - disconnect( child, SIGNAL( beginRemoveItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( emitBeginRemoveItems( QgsCptCityDataItem*, int, int ) ) ); - disconnect( child, SIGNAL( endRemoveItems() ), - this, SLOT( emitEndRemoveItems() ) ); + disconnect( child, &QgsCptCityDataItem::beginInsertItems, this, &QgsCptCityDataItem::beginInsertItems ); + disconnect( child, &QgsCptCityDataItem::endInsertItems, this, &QgsCptCityDataItem::endInsertItems ); + disconnect( child, &QgsCptCityDataItem::beginRemoveItems, this, &QgsCptCityDataItem::beginRemoveItems ); + disconnect( child, &QgsCptCityDataItem::endRemoveItems, this, &QgsCptCityDataItem::endRemoveItems ); child->setParent( nullptr ); return child; } @@ -1668,14 +1643,10 @@ void QgsCptCityBrowserModel::endRemoveItems() } void QgsCptCityBrowserModel::connectItem( QgsCptCityDataItem* item ) { - connect( item, SIGNAL( beginInsertItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( beginInsertItems( QgsCptCityDataItem*, int, int ) ) ); - connect( item, SIGNAL( endInsertItems() ), - this, SLOT( endInsertItems() ) ); - connect( item, SIGNAL( beginRemoveItems( QgsCptCityDataItem*, int, int ) ), - this, SLOT( beginRemoveItems( QgsCptCityDataItem*, int, int ) ) ); - connect( item, SIGNAL( endRemoveItems() ), - this, SLOT( endRemoveItems() ) ); + connect( item, &QgsCptCityDataItem::beginInsertItems, this, &QgsCptCityBrowserModel::beginInsertItems ); + connect( item, &QgsCptCityDataItem::endInsertItems, this, &QgsCptCityBrowserModel::endInsertItems ); + connect( item, &QgsCptCityDataItem::beginRemoveItems, this, &QgsCptCityBrowserModel::beginRemoveItems ); + connect( item, &QgsCptCityDataItem::endRemoveItems, this, &QgsCptCityBrowserModel::endRemoveItems ); } bool QgsCptCityBrowserModel::canFetchMore( const QModelIndex & parent ) const diff --git a/src/core/symbology-ng/qgscptcityarchive.h b/src/core/symbology-ng/qgscptcityarchive.h index 14639e4b49b..a94e61f12bc 100644 --- a/src/core/symbology-ng/qgscptcityarchive.h +++ b/src/core/symbology-ng/qgscptcityarchive.h @@ -188,12 +188,6 @@ class CORE_EXPORT QgsCptCityDataItem : public QObject QIcon mIcon; bool mValid; - public slots: - void emitBeginInsertItems( QgsCptCityDataItem* parent, int first, int last ); - void emitEndInsertItems(); - void emitBeginRemoveItems( QgsCptCityDataItem* parent, int first, int last ); - void emitEndRemoveItems(); - signals: void beginInsertItems( QgsCptCityDataItem* parent, int first, int last ); void endInsertItems(); diff --git a/src/core/symbology-ng/qgssvgcache.cpp b/src/core/symbology-ng/qgssvgcache.cpp index ab36f84630f..bf16b9262a6 100644 --- a/src/core/symbology-ng/qgssvgcache.cpp +++ b/src/core/symbology-ng/qgssvgcache.cpp @@ -430,7 +430,7 @@ QByteArray QgsSvgCache::getImageData( const QString &path ) const request.setAttribute( QNetworkRequest::CacheSaveControlAttribute, true ); reply = QgsNetworkAccessManager::instance()->get( request ); - connect( reply, SIGNAL( downloadProgress( qint64, qint64 ) ), this, SLOT( downloadProgress( qint64, qint64 ) ) ); + connect( reply, &QNetworkReply::downloadProgress, this, &QgsSvgCache::downloadProgress ); //emit statusChanged( tr( "Downloading svg." ) );