Skip to content

Commit a8e8eec

Browse files
committed
Convert almost all core connects to new style
Just a handful remain which for various reasons cannot be converted
1 parent b7d2b9f commit a8e8eec

30 files changed

+151
-142
lines changed

src/core/composer/qgscomposerlegend.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -624,20 +624,20 @@ void QgsComposerLegend::setComposerMap( const QgsComposerMap *map )
624624
{
625625
if ( mComposerMap )
626626
{
627-
disconnect( mComposerMap, SIGNAL( destroyed( QObject * ) ), this, SLOT( invalidateCurrentMap() ) );
628-
disconnect( mComposerMap, SIGNAL( itemChanged() ), this, SLOT( updateFilterByMap() ) );
629-
disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateFilterByMap() ) );
630-
disconnect( mComposerMap, SIGNAL( layerStyleOverridesChanged() ), this, SLOT( mapLayerStyleOverridesChanged() ) );
627+
disconnect( mComposerMap, &QObject::destroyed, this, &QgsComposerLegend::invalidateCurrentMap );
628+
disconnect( mComposerMap, &QgsComposerObject::itemChanged, this, &QgsComposerLegend::updateFilterByMapAndRedraw );
629+
disconnect( mComposerMap, &QgsComposerMap::extentChanged, this, &QgsComposerLegend::updateFilterByMapAndRedraw );
630+
disconnect( mComposerMap, &QgsComposerMap::layerStyleOverridesChanged, this, &QgsComposerLegend::mapLayerStyleOverridesChanged );
631631
}
632632

633633
mComposerMap = map;
634634

635635
if ( map )
636636
{
637-
QObject::connect( map, SIGNAL( destroyed( QObject * ) ), this, SLOT( invalidateCurrentMap() ) );
638-
QObject::connect( map, SIGNAL( itemChanged() ), this, SLOT( updateFilterByMap() ) );
639-
QObject::connect( map, SIGNAL( extentChanged() ), this, SLOT( updateFilterByMap() ) );
640-
QObject::connect( map, SIGNAL( layerStyleOverridesChanged() ), this, SLOT( mapLayerStyleOverridesChanged() ) );
637+
connect( map, &QObject::destroyed, this, &QgsComposerLegend::invalidateCurrentMap );
638+
connect( map, &QgsComposerObject::itemChanged, this, &QgsComposerLegend::updateFilterByMapAndRedraw );
639+
connect( map, &QgsComposerMap::extentChanged, this, &QgsComposerLegend::updateFilterByMapAndRedraw );
640+
connect( map, &QgsComposerMap::layerStyleOverridesChanged, this, &QgsComposerLegend::mapLayerStyleOverridesChanged );
641641
}
642642

643643
updateItem();
@@ -684,6 +684,11 @@ void QgsComposerLegend::refreshDataDefinedProperty( const QgsComposerObject::Dat
684684
QgsComposerObject::refreshDataDefinedProperty( property, context );
685685
}
686686

687+
void QgsComposerLegend::updateFilterByMapAndRedraw()
688+
{
689+
updateFilterByMap( true );
690+
}
691+
687692
void QgsComposerLegend::mapLayerStyleOverridesChanged()
688693
{
689694
if ( !mComposerMap )

src/core/composer/qgscomposerlegend.h

+3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
288288

289289

290290
private slots:
291+
292+
void updateFilterByMapAndRedraw();
293+
291294
void updateFilterByMap( bool redraw = true );
292295

293296
//! update legend in case style of associated map has changed

src/core/gps/qextserialport/posix_qextserialport.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ bool QextSerialPort::open(OpenMode mode)
721721

722722
if (queryMode() == QextSerialPort::EventDriven) {
723723
readNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
724-
connect(readNotifier, SIGNAL(activated(int)), this, SIGNAL(readyRead()));
724+
connect(readNotifier, &QSocketNotifier::activated, this, [=] { emit readyRead(); } );
725725
}
726726
} else {
727727
qDebug() << "could not open file:" << strerror(errno);

src/core/gps/qextserialport/qextserialenumerator.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ class QextSerialRegistrationWidget : public QWidget
8888
\b Example
8989
\code
9090
QextSerialEnumerator* enumerator = new QextSerialEnumerator();
91-
connect(enumerator, SIGNAL(deviceDiscovered(const QextPortInfo &)),
92-
myClass, SLOT(onDeviceDiscovered(const QextPortInfo &)));
93-
connect(enumerator, SIGNAL(deviceRemoved(const QextPortInfo &)),
94-
myClass, SLOT(onDeviceRemoved(const QextPortInfo &)));
91+
connect(enumerator, &QextSerialEnumerator::deviceDiscovered,
92+
myClass, &MyObject::onDeviceDiscovered);
93+
connect(enumerator, &QextSerialEnumerator::deviceRemoved,
94+
myClass, &MyObject::onDeviceRemoved);
9595
\endcode
9696
9797
\section Credits

src/core/gps/qextserialport/qextserialport.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ to use, since you never have to worry about checking for new data.
150150
\b Example
151151
\code
152152
QextSerialPort* port = new QextSerialPort("COM1", QextSerialPort::EventDriven);
153-
connect(port, SIGNAL(readyRead()), myClass, SLOT(onDataAvailable()));
153+
connect(port, &QextSerialPort::readyRead, myClass, &MyObject::onDataAvailable);
154154
port->open();
155155
156156
void MyClass::onDataAvailable() {

src/core/gps/qgsgpsconnection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
QgsGPSConnection::QgsGPSConnection( QIODevice *dev ): QObject( nullptr ), mSource( dev ), mStatus( NotConnected )
3333
{
3434
clearLastGPSInformation();
35-
QObject::connect( dev, SIGNAL( readyRead() ), this, SLOT( parseData() ) );
35+
QObject::connect( dev, &QIODevice::readyRead, this, &QgsGPSConnection::parseData );
3636
}
3737

3838
QgsGPSConnection::~QgsGPSConnection()

src/core/gps/qgsgpsdetector.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ void QgsGPSDetector::advance()
183183
}
184184
}
185185

186-
connect( mConn, SIGNAL( stateChanged( const QgsGPSInformation & ) ), this, SLOT( detected( const QgsGPSInformation & ) ) );
187-
connect( mConn, SIGNAL( destroyed( QObject * ) ), this, SLOT( connDestroyed( QObject * ) ) );
186+
connect( mConn, &QgsGPSConnection::stateChanged, this, static_cast < void ( QgsGPSDetector::* )( const QgsGPSInformation & ) >( &QgsGPSDetector::detected ) );
187+
connect( mConn, &QObject::destroyed, this, &QgsGPSDetector::connDestroyed );
188188

189189
// leave 2s to pickup a valid string
190190
QTimer::singleShot( 2000, this, SLOT( advance() ) );

src/core/gps/qgsqtlocationconnection.cpp

+9-13
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ void QgsQtLocationConnection::startGPS()
171171
locationDataSource->setUpdateInterval( 1000 );
172172
// Whenever the location data source signals that the current
173173
// position is updated, the positionUpdated function is called.
174-
QObject::connect( locationDataSource,
175-
SIGNAL( positionUpdated( QGeoPositionInfo ) ),
174+
QObject::connect( locationDataSource.data(),
175+
&QGeoPositionInfoSource::positionUpdated,
176176
this,
177-
SLOT( positionUpdated( QGeoPositionInfo ) ) );
177+
&QgsQtLocationConnection::positionUpdated );
178178
// Start listening for position updates
179179
locationDataSource->startUpdates();
180180
}
@@ -204,22 +204,18 @@ void QgsQtLocationConnection::startSatelliteMonitor()
204204
// Whenever the satellite info source signals that the number of
205205
// satellites in use is updated, the satellitesInUseUpdated function
206206
// is called
207-
QObject::connect( satelliteInfoSource,
208-
SIGNAL( satellitesInUseUpdated(
209-
const QList<QGeoSatelliteInfo> & ) ),
207+
QObject::connect( satelliteInfoSource.data(),
208+
&QGeoSatelliteInfoSource::satellitesInUseUpdated,
210209
this,
211-
SLOT( satellitesInUseUpdated(
212-
const QList<QGeoSatelliteInfo> & ) ) );
210+
&QgsQtLocationConnection::satellitesInUseUpdated );
213211

214212
// Whenever the satellite info source signals that the number of
215213
// satellites in view is updated, the satellitesInViewUpdated function
216214
// is called
217-
QObject::connect( satelliteInfoSource,
218-
SIGNAL( satellitesInViewUpdated(
219-
const QList<QGeoSatelliteInfo> & ) ),
215+
QObject::connect( satelliteInfoSource.data(),
216+
&QGeoSatelliteInfoSource::satellitesInViewUpdated,
220217
this,
221-
SLOT( satellitesInViewUpdated(
222-
const QList<QGeoSatelliteInfo> & ) ) );
218+
&QgsQtLocationConnection::satellitesInViewUpdated );
223219

224220
// Start listening for satellite updates
225221
satelliteInfoSource->startUpdates();

src/core/layertree/qgslayertreemodel.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,10 @@ void QgsLayerTreeModel::connectToLayer( QgsLayerTreeLayer *nodeLayer )
866866
// using unique connection because there may be temporarily more nodes for a layer than just one
867867
// which would create multiple connections, however disconnect() would disconnect all multiple connections
868868
// even if we wanted to disconnect just one connection in each call.
869-
connect( layer, SIGNAL( editingStarted() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
870-
connect( layer, SIGNAL( editingStopped() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
871-
connect( layer, SIGNAL( layerModified() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
869+
QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( layer );
870+
connect( vl, &QgsVectorLayer::editingStarted, this, &QgsLayerTreeModel::layerNeedsUpdate, Qt::UniqueConnection );
871+
connect( vl, &QgsVectorLayer::editingStopped, this, &QgsLayerTreeModel::layerNeedsUpdate, Qt::UniqueConnection );
872+
connect( vl, &QgsVectorLayer::layerModified, this, &QgsLayerTreeModel::layerNeedsUpdate, Qt::UniqueConnection );
872873
}
873874
}
874875

src/core/layertree/qgslayertreemodellegendnode.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ QImage QgsWmsLegendNode::getLegendGraphic() const
603603
mFetcher.reset( prov->getLegendGraphicFetcher( ms ) );
604604
if ( mFetcher )
605605
{
606-
connect( mFetcher.get(), SIGNAL( finish( const QImage & ) ), this, SLOT( getLegendGraphicFinished( const QImage & ) ) );
607-
connect( mFetcher.get(), SIGNAL( error( const QString & ) ), this, SLOT( getLegendGraphicErrored( const QString & ) ) );
608-
connect( mFetcher.get(), SIGNAL( progress( qint64, qint64 ) ), this, SLOT( getLegendGraphicProgress( qint64, qint64 ) ) );
606+
connect( mFetcher.get(), &QgsImageFetcher::finish, this, &QgsWmsLegendNode::getLegendGraphicFinished );
607+
connect( mFetcher.get(), &QgsImageFetcher::error, this, &QgsWmsLegendNode::getLegendGraphicErrored );
608+
connect( mFetcher.get(), &QgsImageFetcher::progress, this, &QgsWmsLegendNode::getLegendGraphicProgress );
609609
mFetcher->start();
610610
} // else QgsDebugMsg("XXX No legend supported?");
611611

src/core/layertree/qgslayertreenode.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,18 @@ void QgsLayerTreeNode::insertChildrenPrivate( int index, QList<QgsLayerTreeNode
207207
emit willAddChildren( this, index, indexTo );
208208
for ( int i = 0; i < nodes.count(); ++i )
209209
{
210-
mChildren.insert( index + i, nodes[i] );
210+
QgsLayerTreeNode *node = nodes.at( i );
211+
mChildren.insert( index + i, node );
211212

212213
// forward the signal towards the root
213-
connect( nodes[i], SIGNAL( willAddChildren( QgsLayerTreeNode *, int, int ) ), this, SIGNAL( willAddChildren( QgsLayerTreeNode *, int, int ) ) );
214-
connect( nodes[i], SIGNAL( addedChildren( QgsLayerTreeNode *, int, int ) ), this, SIGNAL( addedChildren( QgsLayerTreeNode *, int, int ) ) );
215-
connect( nodes[i], SIGNAL( willRemoveChildren( QgsLayerTreeNode *, int, int ) ), this, SIGNAL( willRemoveChildren( QgsLayerTreeNode *, int, int ) ) );
216-
connect( nodes[i], SIGNAL( removedChildren( QgsLayerTreeNode *, int, int ) ), this, SIGNAL( removedChildren( QgsLayerTreeNode *, int, int ) ) );
217-
connect( nodes[i], SIGNAL( customPropertyChanged( QgsLayerTreeNode *, QString ) ), this, SIGNAL( customPropertyChanged( QgsLayerTreeNode *, QString ) ) );
218-
connect( nodes[i], &QgsLayerTreeNode::visibilityChanged, this, &QgsLayerTreeNode::visibilityChanged );
219-
connect( nodes[i], SIGNAL( expandedChanged( QgsLayerTreeNode *, bool ) ), this, SIGNAL( expandedChanged( QgsLayerTreeNode *, bool ) ) );
220-
connect( nodes[i], SIGNAL( nameChanged( QgsLayerTreeNode *, QString ) ), this, SIGNAL( nameChanged( QgsLayerTreeNode *, QString ) ) );
214+
connect( node, &QgsLayerTreeNode::willAddChildren, this, &QgsLayerTreeNode::willAddChildren );
215+
connect( node, &QgsLayerTreeNode::addedChildren, this, &QgsLayerTreeNode::addedChildren );
216+
connect( node, &QgsLayerTreeNode::willRemoveChildren, this, &QgsLayerTreeNode::willRemoveChildren );
217+
connect( node, &QgsLayerTreeNode::removedChildren, this, &QgsLayerTreeNode::removedChildren );
218+
connect( node, &QgsLayerTreeNode::customPropertyChanged, this, &QgsLayerTreeNode::customPropertyChanged );
219+
connect( node, &QgsLayerTreeNode::visibilityChanged, this, &QgsLayerTreeNode::visibilityChanged );
220+
connect( node, &QgsLayerTreeNode::expandedChanged, this, &QgsLayerTreeNode::expandedChanged );
221+
connect( node, &QgsLayerTreeNode::nameChanged, this, &QgsLayerTreeNode::nameChanged );
221222
}
222223
emit addedChildren( this, index, indexTo );
223224
}

src/core/qgsbrowsermodel.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ QgsBrowserModel::QgsBrowserModel( QObject *parent )
4646
, mFavorites( nullptr )
4747
, mProjectHome( nullptr )
4848
{
49-
connect( QgsProject::instance(), SIGNAL( readProject( const QDomDocument & ) ), this, SLOT( updateProjectHome() ) );
50-
connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ), this, SLOT( updateProjectHome() ) );
49+
connect( QgsProject::instance(), &QgsProject::readProject, this, &QgsBrowserModel::updateProjectHome );
50+
connect( QgsProject::instance(), &QgsProject::writeProject, this, &QgsBrowserModel::updateProjectHome );
5151
addRootItems();
5252
}
5353

@@ -413,18 +413,18 @@ void QgsBrowserModel::itemStateChanged( QgsDataItem *item, QgsDataItem::State ol
413413
}
414414
void QgsBrowserModel::connectItem( QgsDataItem *item )
415415
{
416-
connect( item, SIGNAL( beginInsertItems( QgsDataItem *, int, int ) ),
417-
this, SLOT( beginInsertItems( QgsDataItem *, int, int ) ) );
418-
connect( item, SIGNAL( endInsertItems() ),
419-
this, SLOT( endInsertItems() ) );
420-
connect( item, SIGNAL( beginRemoveItems( QgsDataItem *, int, int ) ),
421-
this, SLOT( beginRemoveItems( QgsDataItem *, int, int ) ) );
422-
connect( item, SIGNAL( endRemoveItems() ),
423-
this, SLOT( endRemoveItems() ) );
424-
connect( item, SIGNAL( dataChanged( QgsDataItem * ) ),
425-
this, SLOT( itemDataChanged( QgsDataItem * ) ) );
426-
connect( item, SIGNAL( stateChanged( QgsDataItem *, QgsDataItem::State ) ),
427-
this, SLOT( itemStateChanged( QgsDataItem *, QgsDataItem::State ) ) );
416+
connect( item, &QgsDataItem::beginInsertItems,
417+
this, &QgsBrowserModel::beginInsertItems );
418+
connect( item, &QgsDataItem::endInsertItems,
419+
this, &QgsBrowserModel::endInsertItems );
420+
connect( item, &QgsDataItem::beginRemoveItems,
421+
this, &QgsBrowserModel::beginRemoveItems );
422+
connect( item, &QgsDataItem::endRemoveItems,
423+
this, &QgsBrowserModel::endRemoveItems );
424+
connect( item, &QgsDataItem::dataChanged,
425+
this, &QgsBrowserModel::itemDataChanged );
426+
connect( item, &QgsDataItem::stateChanged,
427+
this, &QgsBrowserModel::itemStateChanged );
428428
}
429429

430430
QStringList QgsBrowserModel::mimeTypes() const

src/core/qgscontexthelp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ QProcess *QgsContextHelp::start()
5858
QProcess *process = new QProcess;
5959

6060
// Delete this object if the process terminates
61-
connect( process, SIGNAL( finished( int, QProcess::ExitStatus ) ), SLOT( processExited() ) );
61+
connect( process, static_cast < void ( QProcess::* )( int ) >( &QProcess::finished ), this, [ = ] { processExited(); } );
6262

63-
connect( process, SIGNAL( error( QProcess::ProcessError ) ), this, SLOT( error( QProcess::ProcessError ) ) );
63+
connect( process, static_cast < void ( QProcess::* )( QProcess::ProcessError ) >( &QProcess::error ), this, &QgsContextHelp::error );
6464

6565
#ifdef Q_OS_WIN
6666
if ( QgsApplication::isRunningFromBuildDir() )

src/core/qgsdataitem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ void QgsDataItem::setParent( QgsDataItem *parent )
406406
connect( this, &QgsDataItem::beginInsertItems, parent, &QgsDataItem::beginInsertItems );
407407
connect( this, &QgsDataItem::endInsertItems, parent, &QgsDataItem::endInsertItems );
408408
connect( this, &QgsDataItem::beginRemoveItems, parent, &QgsDataItem::beginRemoveItems );
409-
connect( this, SIGNAL( endRemoveItems() ), parent, SIGNAL( endRemoveItems() ) );
409+
connect( this, &QgsDataItem::endRemoveItems, parent, &QgsDataItem::endRemoveItems );
410410
connect( this, &QgsDataItem::dataChanged, parent, &QgsDataItem::dataChanged );
411411
connect( this, &QgsDataItem::stateChanged, parent, &QgsDataItem::stateChanged );
412412
}

src/core/qgsgeometryvalidator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void QgsGeometryValidator::addError( const QgsGeometry::Error &e )
354354
void QgsGeometryValidator::validateGeometry( const QgsGeometry *g, QList<QgsGeometry::Error> &errors )
355355
{
356356
QgsGeometryValidator *gv = new QgsGeometryValidator( g, &errors );
357-
connect( gv, SIGNAL( errorFound( QgsGeometry::Error ) ), gv, SLOT( addError( QgsGeometry::Error ) ) );
357+
connect( gv, &QgsGeometryValidator::errorFound, gv, &QgsGeometryValidator::addError );
358358
gv->run();
359359
gv->wait();
360360
}

src/core/qgsgml.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ int QgsGml::getFeatures( const QString &uri, QgsWkbTypes::Type *wkbType, QgsRect
9393
}
9494
}
9595

96-
connect( reply, SIGNAL( finished() ), this, SLOT( setFinished() ) );
97-
connect( reply, SIGNAL( downloadProgress( qint64, qint64 ) ), this, SLOT( handleProgressEvent( qint64, qint64 ) ) );
96+
connect( reply, &QNetworkReply::finished, this, &QgsGml::setFinished );
97+
connect( reply, &QNetworkReply::downloadProgress, this, &QgsGml::handleProgressEvent );
9898

9999
//find out if there is a QGIS main window. If yes, display a progress dialog
100100
QProgressDialog *progressDialog = nullptr;
@@ -112,9 +112,9 @@ int QgsGml::getFeatures( const QString &uri, QgsWkbTypes::Type *wkbType, QgsRect
112112
{
113113
progressDialog = new QProgressDialog( tr( "Loading GML data\n%1" ).arg( mTypeName ), tr( "Abort" ), 0, 0, mainWindow );
114114
progressDialog->setWindowModality( Qt::ApplicationModal );
115-
connect( this, SIGNAL( dataReadProgress( int ) ), progressDialog, SLOT( setValue( int ) ) );
116-
connect( this, SIGNAL( totalStepsUpdate( int ) ), progressDialog, SLOT( setMaximum( int ) ) );
117-
connect( progressDialog, SIGNAL( canceled() ), this, SLOT( setFinished() ) );
115+
connect( this, &QgsGml::dataReadProgress, progressDialog, &QProgressDialog::setValue );
116+
connect( this, &QgsGml::totalStepsUpdate, progressDialog, &QProgressDialog::setMaximum );
117+
connect( progressDialog, &QProgressDialog::canceled, this, &QgsGml::setFinished );
118118
progressDialog->show();
119119
}
120120

src/core/qgsmaplayerlegend.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void QgsMapLayerLegendUtils::applyLayerNodeProperties( QgsLayerTreeLayer *nodeLa
179179
QgsDefaultVectorLayerLegend::QgsDefaultVectorLayerLegend( QgsVectorLayer *vl )
180180
: mLayer( vl )
181181
{
182-
connect( mLayer, SIGNAL( rendererChanged() ), this, SIGNAL( itemsChanged() ) );
182+
connect( mLayer, &QgsMapLayer::rendererChanged, this, &QgsMapLayerLegend::itemsChanged );
183183
}
184184

185185
QList<QgsLayerTreeModelLegendNode *> QgsDefaultVectorLayerLegend::createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer )
@@ -229,7 +229,7 @@ QList<QgsLayerTreeModelLegendNode *> QgsDefaultVectorLayerLegend::createLayerTre
229229
QgsDefaultRasterLayerLegend::QgsDefaultRasterLayerLegend( QgsRasterLayer *rl )
230230
: mLayer( rl )
231231
{
232-
connect( mLayer, SIGNAL( rendererChanged() ), this, SIGNAL( itemsChanged() ) );
232+
connect( mLayer, &QgsMapLayer::rendererChanged, this, &QgsMapLayerLegend::itemsChanged );
233233
}
234234

235235
QList<QgsLayerTreeModelLegendNode *> QgsDefaultRasterLayerLegend::createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer )

src/core/qgsmaplayermodel.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsMapLayerModel::QgsMapLayerModel( const QList<QgsMapLayer *> &layers, QObject
2929
, mAllowEmpty( false )
3030
, mShowCrs( false )
3131
{
32-
connect( QgsProject::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( removeLayers( QStringList ) ) );
32+
connect( QgsProject::instance(), static_cast < void ( QgsProject::* )( const QStringList & ) >( &QgsProject::layersWillBeRemoved ), this, &QgsMapLayerModel::removeLayers );
3333
addLayers( layers );
3434
}
3535

@@ -40,8 +40,8 @@ QgsMapLayerModel::QgsMapLayerModel( QObject *parent )
4040
, mAllowEmpty( false )
4141
, mShowCrs( false )
4242
{
43-
connect( QgsProject::instance(), SIGNAL( layersAdded( QList<QgsMapLayer *> ) ), this, SLOT( addLayers( QList<QgsMapLayer *> ) ) );
44-
connect( QgsProject::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( removeLayers( QStringList ) ) );
43+
connect( QgsProject::instance(), &QgsProject::layersAdded, this, &QgsMapLayerModel::addLayers );
44+
connect( QgsProject::instance(), static_cast < void ( QgsProject::* )( const QStringList & ) >( &QgsProject::layersWillBeRemoved ), this, &QgsMapLayerModel::removeLayers );
4545
addLayers( QgsProject::instance()->mapLayers().values() );
4646
}
4747

src/core/qgsmaprenderersequentialjob.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void QgsMapRendererSequentialJob::start()
6666
mInternalJob = new QgsMapRendererCustomPainterJob( mSettings, mPainter );
6767
mInternalJob->setCache( mCache );
6868

69-
connect( mInternalJob, SIGNAL( finished() ), SLOT( internalFinished() ) );
69+
connect( mInternalJob, &QgsMapRendererJob::finished, this, &QgsMapRendererSequentialJob::internalFinished );
7070

7171
mInternalJob->start();
7272
}

0 commit comments

Comments
 (0)