Skip to content

Commit 68437a1

Browse files
committedMar 26, 2017
More Qt5 style connects
1 parent 8b9e492 commit 68437a1

35 files changed

+231
-229
lines changed
 

‎src/analysis/openstreetmap/qgsosmdownload.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ bool QgsOSMDownload::start()
8484

8585
mReply = nwam->get( request );
8686

87-
connect( mReply, SIGNAL( readyRead() ), this, SLOT( onReadyRead() ) );
88-
connect( mReply, SIGNAL( error( QNetworkReply::NetworkError ) ), this, SLOT( onError( QNetworkReply::NetworkError ) ) );
89-
connect( mReply, SIGNAL( finished() ), this, SLOT( onFinished() ) );
90-
connect( mReply, SIGNAL( downloadProgress( qint64, qint64 ) ), this, SIGNAL( downloadProgress( qint64, qint64 ) ) );
87+
connect( mReply, &QIODevice::readyRead, this, &QgsOSMDownload::onReadyRead );
88+
connect( mReply, static_cast < void ( QNetworkReply::* )( QNetworkReply::NetworkError ) >( &QNetworkReply::error ), this, &QgsOSMDownload::onError );
89+
connect( mReply, &QNetworkReply::finished, this, &QgsOSMDownload::onFinished );
90+
connect( mReply, &QNetworkReply::downloadProgress, this, &QgsOSMDownload::downloadProgress );
9191

9292
return true;
9393
}

‎src/app/composer/qgsatlascompositionwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ QgsAtlasCompositionWidget::QgsAtlasCompositionWidget( QWidget *parent, QgsCompos
3434

3535
connect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, mAtlasSortFeatureKeyComboBox, &QgsFieldComboBox::setLayer );
3636
connect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, mPageNameWidget, &QgsFieldExpressionWidget::setLayer );
37-
connect( mAtlasCoverageLayerComboBox, SIGNAL( layerChanged( QgsMapLayer * ) ), this, SLOT( changeCoverageLayer( QgsMapLayer * ) ) );
38-
connect( mAtlasSortFeatureKeyComboBox, SIGNAL( fieldChanged( QString ) ), this, SLOT( changesSortFeatureField( QString ) ) );
39-
connect( mPageNameWidget, SIGNAL( fieldChanged( QString, bool ) ), this, SLOT( pageNameExpressionChanged( QString, bool ) ) );
37+
connect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsAtlasCompositionWidget::changeCoverageLayer );
38+
connect( mAtlasSortFeatureKeyComboBox, &QgsFieldComboBox::fieldChanged, this, &QgsAtlasCompositionWidget::changesSortFeatureField );
39+
connect( mPageNameWidget, static_cast < void ( QgsFieldExpressionWidget::* )( const QString &, bool ) > ( &QgsFieldExpressionWidget::fieldChanged ), this, &QgsAtlasCompositionWidget::pageNameExpressionChanged );
4040

4141
// Sort direction
4242
mAtlasSortFeatureDirectionButton->setEnabled( false );
4343
mAtlasSortFeatureKeyComboBox->setEnabled( false );
4444

4545
// connect to updates
46-
connect( &mComposition->atlasComposition(), SIGNAL( parameterChanged() ), this, SLOT( updateGuiElements() ) );
46+
connect( &mComposition->atlasComposition(), &QgsAtlasComposition::parameterChanged, this, &QgsAtlasCompositionWidget::updateGuiElements );
4747

4848
mPageNameWidget->registerExpressionContextGenerator( mComposition );
4949

‎src/app/composer/qgsattributeselectiondialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ QWidget *QgsComposerColumnSourceDelegate::createEditor( QWidget *parent, const Q
120120
fieldExpression->registerExpressionContextGenerator( this );
121121

122122
//listen out for field changes
123-
connect( fieldExpression, SIGNAL( fieldChanged( QString ) ), this, SLOT( commitAndCloseEditor() ) );
123+
connect( fieldExpression, static_cast < void ( QgsFieldExpressionWidget::* )( const QString & ) >( &QgsFieldExpressionWidget::fieldChanged ), this, [ = ] { const_cast< QgsComposerColumnSourceDelegate * >( this )->commitAndCloseEditor(); } );
124124
return fieldExpression;
125125
}
126126

‎src/app/composer/qgscomposerarrowwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow *arrow ): QgsCo
5757

5858
if ( arrow )
5959
{
60-
connect( arrow, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
60+
connect( arrow, &QgsComposerObject::itemChanged, this, &QgsComposerArrowWidget::setGuiElementValues );
6161
}
6262
}
6363

@@ -339,7 +339,7 @@ void QgsComposerArrowWidget::on_mLineStyleButton_clicked()
339339
symbolContext.setExpressionContext( &context );
340340
d->setContext( symbolContext );
341341

342-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateLineStyleFromWidget() ) );
342+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerArrowWidget::updateLineStyleFromWidget );
343343
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerArrowWidget::cleanUpLineStyleSelector );
344344
openPanel( d );
345345
mArrow->beginCommand( tr( "Arrow line style changed" ) );

‎src/app/composer/qgscomposerattributetablewidget.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ QgsComposerAttributeTableWidget::QgsComposerAttributeTableWidget( QgsComposerAtt
5858
toggleAtlasSpecificControls( atlasEnabled );
5959

6060
//update relations combo when relations modified in project
61-
connect( QgsProject::instance()->relationManager(), SIGNAL( changed() ), this, SLOT( updateRelationsCombo() ) );
61+
connect( QgsProject::instance()->relationManager(), &QgsRelationManager::changed, this, &QgsComposerAttributeTableWidget::updateRelationsCombo );
6262

6363
mLayerComboBox->setFilters( QgsMapLayerProxyModel::VectorLayer );
64-
connect( mLayerComboBox, SIGNAL( layerChanged( QgsMapLayer * ) ), this, SLOT( changeLayer( QgsMapLayer * ) ) );
64+
connect( mLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsComposerAttributeTableWidget::changeLayer );
6565

6666
mComposerMapComboBox->setComposition( mComposerTable->composition() );
6767
mComposerMapComboBox->setItemType( QgsComposerItem::ComposerMap );
68-
connect( mComposerMapComboBox, SIGNAL( itemChanged( QgsComposerItem * ) ), this, SLOT( composerMapChanged( QgsComposerItem * ) ) );
68+
connect( mComposerMapComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerAttributeTableWidget::composerMapChanged );
6969

7070
mHeaderFontColorButton->setColorDialogTitle( tr( "Select header font color" ) );
7171
mHeaderFontColorButton->setAllowAlpha( true );
@@ -87,15 +87,15 @@ QgsComposerAttributeTableWidget::QgsComposerAttributeTableWidget( QgsComposerAtt
8787

8888
if ( mComposerTable )
8989
{
90-
QObject::connect( mComposerTable, SIGNAL( changed() ), this, SLOT( updateGuiElements() ) );
90+
connect( mComposerTable, &QgsComposerMultiFrame::changed, this, &QgsComposerAttributeTableWidget::updateGuiElements );
9191

9292
QgsAtlasComposition *atlas = atlasComposition();
9393
if ( atlas )
9494
{
9595
// repopulate relations combo box if atlas layer changes
96-
connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer * ) ),
97-
this, SLOT( updateRelationsCombo() ) );
98-
connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( atlasToggled() ) );
96+
connect( atlas, &QgsAtlasComposition::coverageLayerChanged,
97+
this, &QgsComposerAttributeTableWidget::updateRelationsCombo );
98+
connect( atlas, &QgsAtlasComposition::toggled, this, &QgsComposerAttributeTableWidget::atlasToggled );
9999
}
100100
}
101101

‎src/app/composer/qgscomposerhtmlwidget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml *html, QgsComposer
3636

3737
//setup html editor
3838
mHtmlEditor = new QgsCodeEditorHTML( this );
39-
connect( mHtmlEditor, SIGNAL( textChanged() ), this, SLOT( htmlEditorChanged() ) );
39+
connect( mHtmlEditor, &QsciScintilla::textChanged, this, &QgsComposerHtmlWidget::htmlEditorChanged );
4040
htmlEditorLayout->addWidget( mHtmlEditor );
4141

4242
//setup stylesheet editor
4343
mStylesheetEditor = new QgsCodeEditorCSS( this );
44-
connect( mStylesheetEditor, SIGNAL( textChanged() ), this, SLOT( stylesheetEditorChanged() ) );
44+
connect( mStylesheetEditor, &QsciScintilla::textChanged, this, &QgsComposerHtmlWidget::stylesheetEditorChanged );
4545
stylesheetEditorLayout->addWidget( mStylesheetEditor );
4646

4747
blockSignals( true );
@@ -54,7 +54,7 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml *html, QgsComposer
5454

5555
if ( mHtml )
5656
{
57-
QObject::connect( mHtml, SIGNAL( changed() ), this, SLOT( setGuiElementValues() ) );
57+
connect( mHtml, &QgsComposerMultiFrame::changed, this, &QgsComposerHtmlWidget::setGuiElementValues );
5858
}
5959

6060
//embed widget for general options

‎src/app/composer/qgscomposerimageexportoptionsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ QgsComposerImageExportOptionsDialog::QgsComposerImageExportOptionsDialog( QWidge
2727
{
2828
setupUi( this );
2929

30-
connect( mClipToContentGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( clipToContentsToggled( bool ) ) );
30+
connect( mClipToContentGroupBox, &QGroupBox::toggled, this, &QgsComposerImageExportOptionsDialog::clipToContentsToggled );
3131

3232
QgsSettings settings;
3333
restoreGeometry( settings.value( QStringLiteral( "Windows/ComposerImageExportOptionsDialog/geometry" ) ).toByteArray() );

‎src/app/composer/qgscomposeritemwidget.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgspropertyoverridebutton.h"
2525
#include "qgsexpressioncontext.h"
2626
#include "qgsproject.h"
27+
#include "qgsvectorlayer.h"
2728
#include <QColorDialog>
2829
#include <QPen>
2930

@@ -34,9 +35,9 @@ QgsComposerConfigObject::QgsComposerConfigObject( QWidget *parent, QgsComposerOb
3435
: QObject( parent )
3536
, mComposerObject( composerObject )
3637
{
37-
connect( atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer * ) ),
38-
this, SLOT( updateDataDefinedButtons() ) );
39-
connect( atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( updateDataDefinedButtons() ) );
38+
connect( atlasComposition(), &QgsAtlasComposition::coverageLayerChanged,
39+
this, [ = ] { updateDataDefinedButtons(); } );
40+
connect( atlasComposition(), &QgsAtlasComposition::toggled, this, &QgsComposerConfigObject::updateDataDefinedButtons );
4041
}
4142

4243
QgsComposerConfigObject::~QgsComposerConfigObject()
@@ -165,20 +166,20 @@ QgsComposerItemWidget::QgsComposerItemWidget( QWidget *parent, QgsComposerItem *
165166
initializeDataDefinedButtons();
166167

167168
setValuesForGuiElements();
168-
connect( mItem->composition(), SIGNAL( paperSizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) );
169-
connect( mItem, SIGNAL( sizeChanged() ), this, SLOT( setValuesForGuiPositionElements() ) );
170-
connect( mItem, SIGNAL( itemChanged() ), this, SLOT( setValuesForGuiNonPositionElements() ) );
169+
connect( mItem->composition(), &QgsComposition::paperSizeChanged, this, &QgsComposerItemWidget::setValuesForGuiPositionElements );
170+
connect( mItem, &QgsComposerItem::sizeChanged, this, &QgsComposerItemWidget::setValuesForGuiPositionElements );
171+
connect( mItem, &QgsComposerObject::itemChanged, this, &QgsComposerItemWidget::setValuesForGuiNonPositionElements );
171172

172-
connect( mTransparencySlider, SIGNAL( valueChanged( int ) ), mTransparencySpnBx, SLOT( setValue( int ) ) );
173+
connect( mTransparencySlider, &QAbstractSlider::valueChanged, mTransparencySpnBx, &QSpinBox::setValue );
173174

174175
updateVariables();
175-
connect( mVariableEditor, SIGNAL( scopeChanged() ), this, SLOT( variablesChanged() ) );
176+
connect( mVariableEditor, &QgsVariableEditorWidget::scopeChanged, this, &QgsComposerItemWidget::variablesChanged );
176177
// listen out for variable edits
177178
connect( QgsApplication::instance(), &QgsApplication::customVariablesChanged, this, &QgsComposerItemWidget::updateVariables );
178179
connect( QgsProject::instance(), &QgsProject::customVariablesChanged, this, &QgsComposerItemWidget::updateVariables );
179180

180181
if ( mItem->composition() )
181-
connect( mItem->composition(), SIGNAL( variablesChanged() ), this, SLOT( updateVariables() ) );
182+
connect( mItem->composition(), &QgsComposition::variablesChanged, this, &QgsComposerItemWidget::updateVariables );
182183
}
183184

184185
QgsComposerItemWidget::~QgsComposerItemWidget()

‎src/app/composer/qgscomposerlabelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel *label ): QgsCo
4444
if ( mComposerLabel )
4545
{
4646
setGuiElementValues();
47-
connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
47+
connect( mComposerLabel, &QgsComposerObject::itemChanged, this, &QgsComposerLabelWidget::setGuiElementValues );
4848
}
4949
}
5050

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend *legend )
8181
if ( legend )
8282
mMapComboBox->setComposition( legend->composition() );
8383
mMapComboBox->setItemType( QgsComposerItem::ComposerMap );
84-
connect( mMapComboBox, SIGNAL( itemChanged( QgsComposerItem * ) ), this, SLOT( composerMapChanged( QgsComposerItem * ) ) );
84+
connect( mMapComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerLegendWidget::composerMapChanged );
8585

8686
//add widget for item properties
8787
QgsComposerItemWidget *itemPropertiesWidget = new QgsComposerItemWidget( this, legend );
@@ -93,21 +93,21 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend *legend )
9393
{
9494
mItemTreeView->setModel( legend->model() );
9595
mItemTreeView->setMenuProvider( new QgsComposerLegendMenuProvider( mItemTreeView, this ) );
96-
connect( legend, SIGNAL( itemChanged() ), this, SLOT( setGuiElements() ) );
96+
connect( legend, &QgsComposerObject::itemChanged, this, &QgsComposerLegendWidget::setGuiElements );
9797
mWrapCharLineEdit->setText( legend->wrapChar() );
9898

9999
// connect atlas state to the filter legend by atlas checkbox
100-
connect( &legend->composition()->atlasComposition(), SIGNAL( toggled( bool ) ), this, SLOT( updateFilterLegendByAtlasButton() ) );
101-
connect( &legend->composition()->atlasComposition(), SIGNAL( coverageLayerChanged( QgsVectorLayer * ) ), this, SLOT( updateFilterLegendByAtlasButton() ) );
100+
connect( &legend->composition()->atlasComposition(), &QgsAtlasComposition::toggled, this, &QgsComposerLegendWidget::updateFilterLegendByAtlasButton );
101+
connect( &legend->composition()->atlasComposition(), &QgsAtlasComposition::coverageLayerChanged, this, &QgsComposerLegendWidget::updateFilterLegendByAtlasButton );
102102
}
103103

104104
registerDataDefinedButton( mLegendTitleDDBtn, QgsComposerObject::LegendTitle );
105105
registerDataDefinedButton( mColumnsDDBtn, QgsComposerObject::LegendColumnCount );
106106

107107
setGuiElements();
108108

109-
connect( mItemTreeView->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
110-
this, SLOT( selectedChanged( const QModelIndex &, const QModelIndex & ) ) );
109+
connect( mItemTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
110+
this, &QgsComposerLegendWidget::selectedChanged );
111111
}
112112

113113
QgsComposerLegendWidget::QgsComposerLegendWidget(): QgsComposerItemBaseWidget( nullptr, nullptr ), mLegend( nullptr )

‎src/app/composer/qgscomposermapgridwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,8 @@ void QgsComposerMapGridWidget::on_mGridMarkerStyleButton_clicked()
665665
symbolContext.setExpressionContext( &context );
666666
d->setContext( symbolContext );
667667

668-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateGridMarkerStyleFromWidget() ) );
669-
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpGridMarkerStyleSelector( QgsPanelWidget * ) ) );
668+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerMapGridWidget::updateGridMarkerStyleFromWidget );
669+
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapGridWidget::cleanUpGridMarkerStyleSelector );
670670
openPanel( d );
671671
mComposerMap->beginCommand( tr( "Grid markers style changed" ) );
672672
}

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,38 +69,38 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap *composerMap )
6969

7070
// follow preset combo
7171
mFollowVisibilityPresetCombo->setModel( new QStringListModel( mFollowVisibilityPresetCombo ) );
72-
connect( mFollowVisibilityPresetCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( followVisibilityPresetSelected( int ) ) );
73-
connect( QgsProject::instance()->mapThemeCollection(), SIGNAL( mapThemesChanged() ),
74-
this, SLOT( onMapThemesChanged() ) );
72+
connect( mFollowVisibilityPresetCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsComposerMapWidget::followVisibilityPresetSelected );
73+
connect( QgsProject::instance()->mapThemeCollection(), &QgsMapThemeCollection::mapThemesChanged,
74+
this, &QgsComposerMapWidget::onMapThemesChanged );
7575
onMapThemesChanged();
7676

7777
// keep layers from preset button
7878
QMenu *menuKeepLayers = new QMenu( this );
7979
mLayerListFromPresetButton->setMenu( menuKeepLayers );
8080
mLayerListFromPresetButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionShowAllLayers.svg" ) ) );
8181
mLayerListFromPresetButton->setToolTip( tr( "Set layer list from a map theme" ) );
82-
connect( menuKeepLayers, SIGNAL( aboutToShow() ), this, SLOT( aboutToShowKeepLayersVisibilityPresetsMenu() ) );
82+
connect( menuKeepLayers, &QMenu::aboutToShow, this, &QgsComposerMapWidget::aboutToShowKeepLayersVisibilityPresetsMenu );
8383

8484
if ( composerMap )
8585
{
8686
mLabel->setText( tr( "Map %1" ).arg( composerMap->id() ) );
8787

88-
connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
88+
connect( composerMap, &QgsComposerObject::itemChanged, this, &QgsComposerMapWidget::setGuiElementValues );
8989

9090
QgsAtlasComposition *atlas = atlasComposition();
9191
if ( atlas )
9292
{
93-
connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer * ) ),
94-
this, SLOT( atlasLayerChanged( QgsVectorLayer * ) ) );
95-
connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( compositionAtlasToggled( bool ) ) );
93+
connect( atlas, &QgsAtlasComposition::coverageLayerChanged,
94+
this, &QgsComposerMapWidget::atlasLayerChanged );
95+
connect( atlas, &QgsAtlasComposition::toggled, this, &QgsComposerMapWidget::compositionAtlasToggled );
9696

9797
compositionAtlasToggled( atlas->enabled() );
9898
}
9999

100100
mOverviewFrameMapComboBox->setComposition( composerMap->composition() );
101101
mOverviewFrameMapComboBox->setItemType( QgsComposerItem::ComposerMap );
102102
mOverviewFrameMapComboBox->setExceptedItemList( QList< QgsComposerItem * >() << composerMap );
103-
connect( mOverviewFrameMapComboBox, SIGNAL( itemChanged( QgsComposerItem * ) ), this, SLOT( overviewMapChanged( QgsComposerItem * ) ) );
103+
connect( mOverviewFrameMapComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerMapWidget::overviewMapChanged );
104104
}
105105

106106
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsComposerMapWidget::mapCrsChanged );
@@ -1655,7 +1655,7 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
16551655
symbolContext.setExpressionContext( &context );
16561656
d->setContext( symbolContext );
16571657

1658-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateOverviewFrameStyleFromWidget() ) );
1658+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerMapWidget::updateOverviewFrameStyleFromWidget );
16591659
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapWidget::cleanUpOverviewFrameStyleSelector );
16601660
openPanel( d );
16611661
mComposerMap->beginCommand( tr( "Overview frame style changed" ) );

‎src/app/composer/qgscomposerpicturewidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture *picture
6161
{
6262
mComposerMapComboBox->setComposition( mPicture->composition() );
6363
mComposerMapComboBox->setItemType( QgsComposerItem::ComposerMap );
64-
connect( mComposerMapComboBox, SIGNAL( itemChanged( QgsComposerItem * ) ), this, SLOT( composerMapChanged( QgsComposerItem * ) ) );
64+
connect( mComposerMapComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerPictureWidget::composerMapChanged );
6565
}
6666

6767
setGuiElementValues();
@@ -72,10 +72,10 @@ QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture *picture
7272
// mSearchDirectoriesGroupBox is a QgsCollapsibleGroupBoxBasic, so its collapsed state should not be saved/restored
7373
mSearchDirectoriesGroupBox->setCollapsed( true );
7474
// setup connection for loading previews on first expansion of group box
75-
connect( mSearchDirectoriesGroupBox, SIGNAL( collapsedStateChanged( bool ) ), this, SLOT( loadPicturePreviews( bool ) ) );
75+
connect( mSearchDirectoriesGroupBox, &QgsCollapsibleGroupBoxBasic::collapsedStateChanged, this, &QgsComposerPictureWidget::loadPicturePreviews );
7676

77-
connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
78-
connect( mPicture, SIGNAL( pictureRotationChanged( double ) ), this, SLOT( setPicRotationSpinValue( double ) ) );
77+
connect( mPicture, &QgsComposerObject::itemChanged, this, &QgsComposerPictureWidget::setGuiElementValues );
78+
connect( mPicture, &QgsComposerPicture::pictureRotationChanged, this, &QgsComposerPictureWidget::setPicRotationSpinValue );
7979

8080
//connections for data defined buttons
8181
connect( mSourceDDBtn, &QgsPropertyOverrideButton::activated, mPictureLineEdit, &QLineEdit::setDisabled );

‎src/app/composer/qgscomposerpolygonwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ QgsComposerPolygonWidget::QgsComposerPolygonWidget( QgsComposerPolygon *composer
4141

4242
if ( mComposerPolygon )
4343
{
44-
connect( mComposerPolygon, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
44+
connect( mComposerPolygon, &QgsComposerObject::itemChanged, this, &QgsComposerPolygonWidget::setGuiElementValues );
4545
}
4646
}
4747

@@ -67,7 +67,7 @@ void QgsComposerPolygonWidget::on_mPolygonStyleButton_clicked()
6767
symbolContext.setExpressionContext( &context );
6868
d->setContext( symbolContext );
6969

70-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
70+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerPolygonWidget::updateStyleFromWidget );
7171
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolygonWidget::cleanUpStyleSelector );
7272
openPanel( d );
7373
mComposerPolygon->beginCommand( tr( "Polygon style changed" ) );

‎src/app/composer/qgscomposerpolylinewidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QgsComposerPolylineWidget::QgsComposerPolylineWidget( QgsComposerPolyline *compo
3939
updatePolylineStyle();
4040

4141
if ( mComposerPolyline )
42-
connect( mComposerPolyline, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
42+
connect( mComposerPolyline, &QgsComposerObject::itemChanged, this, &QgsComposerPolylineWidget::setGuiElementValues );
4343
}
4444

4545
QgsComposerPolylineWidget::~QgsComposerPolylineWidget()
@@ -62,7 +62,7 @@ void QgsComposerPolylineWidget::on_mLineStyleButton_clicked()
6262
symbolContext.setExpressionContext( &context );
6363
d->setContext( symbolContext );
6464

65-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
65+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerPolylineWidget::updateStyleFromWidget );
6666
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolylineWidget::cleanUpStyleSelector );
6767
openPanel( d );
6868
mComposerPolyline->beginCommand( tr( "Polyline style changed" ) );

‎src/app/composer/qgscomposerscalebarwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ QgsComposerScaleBarWidget::QgsComposerScaleBarWidget( QgsComposerScaleBar *scale
3737

3838
mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
3939
mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
40-
connect( &mSegmentSizeRadioGroup, SIGNAL( buttonClicked( QAbstractButton * ) ), this, SLOT( segmentSizeRadioChanged( QAbstractButton * ) ) );
40+
connect( &mSegmentSizeRadioGroup, static_cast < void ( QButtonGroup::* )( QAbstractButton * ) > ( &QButtonGroup::buttonClicked ), this, &QgsComposerScaleBarWidget::segmentSizeRadioChanged );
4141

4242
blockMemberSignals( true );
4343

@@ -89,7 +89,7 @@ QgsComposerScaleBarWidget::QgsComposerScaleBarWidget( QgsComposerScaleBar *scale
8989
mMapItemComboBox->setItemType( QgsComposerItem::ComposerMap );
9090
}
9191

92-
connect( mMapItemComboBox, SIGNAL( itemChanged( QgsComposerItem * ) ), this, SLOT( composerMapChanged( QgsComposerItem * ) ) );
92+
connect( mMapItemComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerScaleBarWidget::composerMapChanged );
9393

9494
registerDataDefinedButton( mFillColorDDBtn, QgsComposerObject::ScalebarFillColor );
9595
registerDataDefinedButton( mFillColor2DDBtn, QgsComposerObject::ScalebarFillColor2 );
@@ -567,15 +567,15 @@ void QgsComposerScaleBarWidget::connectUpdateSignal()
567567
{
568568
if ( mComposerScaleBar )
569569
{
570-
QObject::connect( mComposerScaleBar, SIGNAL( itemChanged() ), this, SLOT( setGuiElements() ) );
570+
connect( mComposerScaleBar, &QgsComposerObject::itemChanged, this, &QgsComposerScaleBarWidget::setGuiElements );
571571
}
572572
}
573573

574574
void QgsComposerScaleBarWidget::disconnectUpdateSignal()
575575
{
576576
if ( mComposerScaleBar )
577577
{
578-
QObject::disconnect( mComposerScaleBar, SIGNAL( itemChanged() ), this, SLOT( setGuiElements() ) );
578+
disconnect( mComposerScaleBar, &QgsComposerObject::itemChanged, this, &QgsComposerScaleBarWidget::setGuiElements );
579579
}
580580
}
581581

‎src/app/composer/qgscomposershapewidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape *composerShape
5151

5252
if ( mComposerShape )
5353
{
54-
connect( mComposerShape, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
54+
connect( mComposerShape, &QgsComposerObject::itemChanged, this, &QgsComposerShapeWidget::setGuiElementValues );
5555
}
5656
}
5757

@@ -116,7 +116,7 @@ void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
116116
symbolContext.setExpressionContext( &context );
117117
d->setContext( symbolContext );
118118

119-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolFromWidget() ) );
119+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerShapeWidget::updateSymbolFromWidget );
120120
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerShapeWidget::cleanUpSymbolSelector );
121121
openPanel( d );
122122
mComposerShape->beginCommand( tr( "Shape style changed" ) );

‎src/app/composer/qgscomposertablebackgroundcolorsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ QgsComposerTableBackgroundColorsDialog::QgsComposerTableBackgroundColorsDialog(
4949
mColorButtonMap.insert( QgsComposerTableV2::FirstRow, mFirstRowColorButton );
5050
mColorButtonMap.insert( QgsComposerTableV2::LastRow, mLastRowColorButton );
5151

52-
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
52+
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsComposerTableBackgroundColorsDialog::apply );
5353

5454
QgsSettings settings;
5555
restoreGeometry( settings.value( QStringLiteral( "Windows/ComposerTableBackgroundColorsDialog/geometry" ) ).toByteArray() );

‎src/app/composer/qgscompositionwidget.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgssymbollayerutils.h"
2525
#include "qgsexpressioncontext.h"
2626
#include "qgsproject.h"
27+
#include "qgsvectorlayer.h"
2728
#include <QColorDialog>
2829
#include <QWidget>
2930
#include <QPrinter> //for screen resolution
@@ -50,15 +51,15 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget *parent, QgsComposition *c )
5051
displayCompositionWidthHeight();
5152

5253
updateVariables();
53-
connect( mVariableEditor, SIGNAL( scopeChanged() ), this, SLOT( variablesChanged() ) );
54+
connect( mVariableEditor, &QgsVariableEditorWidget::scopeChanged, this, &QgsCompositionWidget::variablesChanged );
5455
// listen out for variable edits
5556
connect( QgsApplication::instance(), &QgsApplication::customVariablesChanged, this, &QgsCompositionWidget::updateVariables );
5657
connect( QgsProject::instance(), &QgsProject::customVariablesChanged, this, &QgsCompositionWidget::updateVariables );
5758

5859
if ( mComposition )
5960
{
6061
mNumPagesSpinBox->setValue( mComposition->numPages() );
61-
connect( mComposition, SIGNAL( nPagesChanged() ), this, SLOT( setNumberPages() ) );
62+
connect( mComposition, &QgsComposition::nPagesChanged, this, &QgsCompositionWidget::setNumberPages );
6263

6364
updatePageStyle();
6465

@@ -97,16 +98,16 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget *parent, QgsComposition *c )
9798
if ( atlas )
9899
{
99100
// repopulate data defined buttons if atlas layer changes
100-
connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer * ) ),
101-
this, SLOT( populateDataDefinedButtons() ) );
102-
connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( populateDataDefinedButtons() ) );
101+
connect( atlas, &QgsAtlasComposition::coverageLayerChanged,
102+
this, [ = ] { populateDataDefinedButtons(); } );
103+
connect( atlas, &QgsAtlasComposition::toggled, this, &QgsCompositionWidget::populateDataDefinedButtons );
103104
}
104105
}
105106

106-
connect( mTopMarginSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resizeMarginsChanged() ) );
107-
connect( mRightMarginSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resizeMarginsChanged() ) );
108-
connect( mBottomMarginSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resizeMarginsChanged() ) );
109-
connect( mLeftMarginSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resizeMarginsChanged() ) );
107+
connect( mTopMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsCompositionWidget::resizeMarginsChanged );
108+
connect( mRightMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsCompositionWidget::resizeMarginsChanged );
109+
connect( mBottomMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsCompositionWidget::resizeMarginsChanged );
110+
connect( mLeftMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsCompositionWidget::resizeMarginsChanged );
110111

111112
connect( mPaperSizeDDBtn, &QgsPropertyOverrideButton::activated, mPaperSizeComboBox, &QComboBox::setDisabled );
112113
connect( mPaperWidthDDBtn, &QgsPropertyOverrideButton::activated, mPaperWidthDoubleSpinBox, &QgsDoubleSpinBox::setDisabled );
@@ -547,7 +548,7 @@ void QgsCompositionWidget::on_mPageStyleButton_clicked()
547548
symbolContext.setExpressionContext( &context );
548549
d->setContext( symbolContext );
549550

550-
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
551+
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsCompositionWidget::updateStyleFromWidget );
551552
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsCompositionWidget::cleanUpStyleSelector );
552553
openPanel( d );
553554
}

‎src/app/gps/qgsgpsinformationwidget.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas *thepCanvas, QWid
241241
//SLM - added functionality
242242
mLogFile = nullptr;
243243

244-
connect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
245-
this, SLOT( updateCloseFeatureButton( QgsMapLayer * ) ) );
244+
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged,
245+
this, &QgsGPSInformationWidget::updateCloseFeatureButton );
246246

247247
mStackedWidget->setCurrentIndex( 3 ); // force to Options
248248
mBtnPosition->setFocus( Qt::TabFocusReason );
@@ -423,8 +423,8 @@ void QgsGPSInformationWidget::connectGps()
423423
showStatusBarMessage( tr( "Connecting to GPS device..." ) );
424424

425425
QgsGPSDetector *detector = new QgsGPSDetector( port );
426-
connect( detector, SIGNAL( detected( QgsGPSConnection * ) ), this, SLOT( connected( QgsGPSConnection * ) ) );
427-
connect( detector, SIGNAL( detectionFailed() ), this, SLOT( timedout() ) );
426+
connect( detector, static_cast < void ( QgsGPSDetector::* )( QgsGPSConnection * ) > ( &QgsGPSDetector::detected ), this, &QgsGPSInformationWidget::connected );
427+
connect( detector, &QgsGPSDetector::detectionFailed, this, &QgsGPSInformationWidget::timedout );
428428
detector->advance(); // start the detection process
429429
}
430430

@@ -439,8 +439,8 @@ void QgsGPSInformationWidget::timedout()
439439
void QgsGPSInformationWidget::connected( QgsGPSConnection *conn )
440440
{
441441
mNmea = conn;
442-
connect( mNmea, SIGNAL( stateChanged( const QgsGPSInformation & ) ),
443-
this, SLOT( displayGPSInformation( const QgsGPSInformation & ) ) );
442+
connect( mNmea, &QgsGPSConnection::stateChanged,
443+
this, &QgsGPSInformationWidget::displayGPSInformation );
444444
mGPSPlainTextEdit->appendPlainText( tr( "Connected!" ) );
445445
mConnectButton->setText( tr( "Dis&connect" ) );
446446
//insert connection into registry such that it can also be used by other dialogs or plugins
@@ -461,7 +461,7 @@ void QgsGPSInformationWidget::connected( QgsGPSConnection *conn )
461461
// crude way to separate chunks - use when manually editing file - NMEA parsers should discard
462462
mLogFileTextStream << "====" << "\r\n";
463463

464-
connect( mNmea, SIGNAL( nmeaSentenceReceived( const QString & ) ), this, SLOT( logNmeaSentence( const QString & ) ) ); // added to handle raw data
464+
connect( mNmea, &QgsGPSConnection::nmeaSentenceReceived, this, &QgsGPSInformationWidget::logNmeaSentence ); // added to handle raw data
465465
}
466466
else // error opening file
467467
{
@@ -478,7 +478,7 @@ void QgsGPSInformationWidget::disconnectGps()
478478
{
479479
if ( mLogFile && mLogFile->isOpen() )
480480
{
481-
disconnect( mNmea, SIGNAL( nmeaSentenceReceived( const QString & ) ), this, SLOT( logNmeaSentence( const QString & ) ) );
481+
disconnect( mNmea, &QgsGPSConnection::nmeaSentenceReceived, this, &QgsGPSInformationWidget::logNmeaSentence );
482482
mLogFile->close();
483483
delete mLogFile;
484484
mLogFile = nullptr;
@@ -980,8 +980,8 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
980980

981981
void QgsGPSInformationWidget::connectGpsSlot()
982982
{
983-
connect( mNmea, SIGNAL( stateChanged( const QgsGPSInformation & ) ),
984-
this, SLOT( displayGPSInformation( const QgsGPSInformation & ) ) );
983+
connect( mNmea, &QgsGPSConnection::stateChanged,
984+
this, &QgsGPSInformationWidget::displayGPSInformation );
985985
}
986986

987987
void QgsGPSInformationWidget::on_mBtnRefreshDevices_clicked()
@@ -1065,17 +1065,17 @@ void QgsGPSInformationWidget::updateCloseFeatureButton( QgsMapLayer *lyr )
10651065
{
10661066
if ( mpLastLayer ) // disconnect previous layer
10671067
{
1068-
disconnect( mpLastLayer, SIGNAL( editingStarted() ),
1069-
this, SLOT( layerEditStateChanged() ) );
1070-
disconnect( mpLastLayer, SIGNAL( editingStopped() ),
1071-
this, SLOT( layerEditStateChanged() ) );
1068+
disconnect( mpLastLayer, &QgsVectorLayer::editingStarted,
1069+
this, &QgsGPSInformationWidget::layerEditStateChanged );
1070+
disconnect( mpLastLayer, &QgsVectorLayer::editingStopped,
1071+
this, &QgsGPSInformationWidget::layerEditStateChanged );
10721072
}
10731073
if ( vlayer ) // connect new layer
10741074
{
1075-
connect( vlayer, SIGNAL( editingStarted() ),
1076-
this, SLOT( layerEditStateChanged() ) );
1077-
connect( vlayer, SIGNAL( editingStopped() ),
1078-
this, SLOT( layerEditStateChanged() ) );
1075+
connect( vlayer, &QgsVectorLayer::editingStarted,
1076+
this, &QgsGPSInformationWidget::layerEditStateChanged );
1077+
connect( vlayer, &QgsVectorLayer::editingStopped,
1078+
this, &QgsGPSInformationWidget::layerEditStateChanged );
10791079
}
10801080
mpLastLayer = vlayer;
10811081
}

‎src/app/nodetool/qgsmaptoolnodetool.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ void QgsMapToolNodeTool::canvasPressEvent( QgsMapMouseEvent *e )
250250
mSelectedFeature = new QgsSelectedFeature( snapResults[0].snappedAtGeometry, vlayer, mCanvas );
251251
updateSelectFeature();
252252
}
253-
connect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ), this, SLOT( currentLayerChanged( QgsMapLayer * ) ) );
254-
connect( mSelectedFeature, SIGNAL( destroyed() ), this, SLOT( selectedFeatureDestroyed() ) );
255-
connect( vlayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry & ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry & ) ) );
256-
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
253+
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsMapToolNodeTool::currentLayerChanged );
254+
connect( mSelectedFeature, &QObject::destroyed, this, &QgsMapToolNodeTool::selectedFeatureDestroyed );
255+
connect( vlayer, &QgsVectorLayer::geometryChanged, this, &QgsMapToolNodeTool::geometryChanged );
256+
connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgsMapToolNodeTool::editingToggled );
257257
mIsPoint = vlayer->geometryType() == QgsWkbTypes::PointGeometry;
258258
mNodeEditor = new QgsNodeEditor( vlayer, mSelectedFeature, mCanvas );
259259
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mNodeEditor );
260-
connect( mNodeEditor, SIGNAL( deleteSelectedRequested() ), this, SLOT( deleteNodeSelection() ) );
260+
connect( mNodeEditor, &QgsNodeEditor::deleteSelectedRequested, this, &QgsMapToolNodeTool::deleteNodeSelection );
261261
}
262262
else
263263
{
@@ -581,9 +581,9 @@ void QgsMapToolNodeTool::cleanTool( bool deleteSelectedFeature )
581581
QgsVectorLayer *vlayer = mSelectedFeature->vlayer();
582582
Q_ASSERT( vlayer );
583583

584-
disconnect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ), this, SLOT( currentLayerChanged( QgsMapLayer * ) ) );
585-
disconnect( mSelectedFeature, SIGNAL( destroyed() ), this, SLOT( selectedFeatureDestroyed() ) );
586-
disconnect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
584+
disconnect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsMapToolNodeTool::currentLayerChanged );
585+
disconnect( mSelectedFeature, &QObject::destroyed, this, &QgsMapToolNodeTool::selectedFeatureDestroyed );
586+
disconnect( vlayer, &QgsVectorLayer::editingStopped, this, &QgsMapToolNodeTool::editingToggled );
587587

588588
if ( deleteSelectedFeature )
589589
delete mSelectedFeature;

‎src/app/nodetool/qgsnodeeditor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ QgsNodeEditorModel::QgsNodeEditorModel( QgsVectorLayer *layer, QgsSelectedFeatur
6868
mWidgetFont = parentWidget->font();
6969
}
7070

71-
connect( mSelectedFeature, SIGNAL( vertexMapChanged() ), this, SLOT( featureChanged() ) );
71+
connect( mSelectedFeature, &QgsSelectedFeature::vertexMapChanged, this, &QgsNodeEditorModel::featureChanged );
7272
}
7373

7474
int QgsNodeEditorModel::rowCount( const QModelIndex &parent ) const
@@ -306,8 +306,8 @@ QgsNodeEditor::QgsNodeEditor(
306306

307307
setWidget( mTableView );
308308

309-
connect( mSelectedFeature, SIGNAL( selectionChanged() ), this, SLOT( updateTableSelection() ) );
310-
connect( mTableView->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SLOT( updateNodeSelection( QItemSelection, QItemSelection ) ) );
309+
connect( mSelectedFeature, &QgsSelectedFeature::selectionChanged, this, &QgsNodeEditor::updateTableSelection );
310+
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsNodeEditor::updateNodeSelection );
311311
}
312312

313313
void QgsNodeEditor::updateTableSelection()

‎src/app/nodetool/qgsselectedfeature.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,27 @@ void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLa
9494
mGeometry = nullptr;
9595

9696
// signal changing of current layer
97-
connect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ), this, SLOT( currentLayerChanged( QgsMapLayer * ) ) );
97+
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsSelectedFeature::currentLayerChanged );
9898

9999
// feature was deleted
100-
connect( mVlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
100+
connect( mVlayer, &QgsVectorLayer::featureDeleted, this, &QgsSelectedFeature::featureDeleted );
101101

102102
// rolling back
103-
connect( mVlayer, SIGNAL( beforeRollBack() ), this, SLOT( beforeRollBack() ) );
103+
connect( mVlayer, &QgsVectorLayer::beforeRollBack, this, &QgsSelectedFeature::beforeRollBack );
104104

105105
// projection or extents changed
106-
connect( canvas, SIGNAL( destinationCrsChanged() ), this, SLOT( updateVertexMarkersPosition() ) );
107-
connect( canvas, SIGNAL( extentsChanged() ), this, SLOT( updateVertexMarkersPosition() ) );
106+
connect( canvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
107+
connect( canvas, &QgsMapCanvas::extentsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
108108

109109
// geometry was changed
110-
connect( mVlayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry & ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry & ) ) );
110+
connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
111111

112112
replaceVertexMap();
113113
}
114114

115115
void QgsSelectedFeature::beforeRollBack()
116116
{
117-
disconnect( mVlayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry & ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry & ) ) );
117+
disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
118118
deleteVertexMap();
119119
}
120120

@@ -123,15 +123,15 @@ void QgsSelectedFeature::beginGeometryChange()
123123
Q_ASSERT( !mChangingGeometry );
124124
mChangingGeometry = true;
125125

126-
disconnect( mVlayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry & ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry & ) ) );
126+
disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
127127
}
128128

129129
void QgsSelectedFeature::endGeometryChange()
130130
{
131131
Q_ASSERT( mChangingGeometry );
132132
mChangingGeometry = false;
133133

134-
connect( mVlayer, SIGNAL( geometryChanged( QgsFeatureId, const QgsGeometry & ) ), this, SLOT( geometryChanged( QgsFeatureId, const QgsGeometry & ) ) );
134+
connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
135135
}
136136

137137
void QgsSelectedFeature::canvasLayersChanged()
@@ -185,8 +185,8 @@ void QgsSelectedFeature::validateGeometry( QgsGeometry *g )
185185
}
186186

187187
mValidator = new QgsGeometryValidator( g );
188-
connect( mValidator, SIGNAL( errorFound( QgsGeometry::Error ) ), this, SLOT( addError( QgsGeometry::Error ) ) );
189-
connect( mValidator, SIGNAL( finished() ), this, SLOT( validationFinished() ) );
188+
connect( mValidator, &QgsGeometryValidator::errorFound, this, &QgsSelectedFeature::addError );
189+
connect( mValidator, &QThread::finished, this, &QgsSelectedFeature::validationFinished );
190190
mValidator->start();
191191

192192
QStatusBar *sb = QgisApp::instance()->statusBar();

‎src/app/openstreetmap/qgsosmdownloaddialog.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ QgsOSMDownloadDialog::QgsOSMDownloadDialog( QWidget *parent )
4444
populateLayers();
4545
onExtentCanvas();
4646

47-
connect( radExtentCanvas, SIGNAL( clicked() ), this, SLOT( onExtentCanvas() ) );
48-
connect( radExtentLayer, SIGNAL( clicked() ), this, SLOT( onExtentLayer() ) );
49-
connect( radExtentManual, SIGNAL( clicked() ), this, SLOT( onExtentManual() ) );
50-
connect( cboLayers, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onCurrentLayerChanged( int ) ) );
51-
connect( btnBrowse, SIGNAL( clicked() ), this, SLOT( onBrowseClicked() ) );
52-
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) );
53-
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( onClose() ) );
54-
55-
connect( mDownload, SIGNAL( finished() ), this, SLOT( onFinished() ) );
56-
connect( mDownload, SIGNAL( downloadProgress( qint64, qint64 ) ), this, SLOT( onDownloadProgress( qint64, qint64 ) ) );
47+
connect( radExtentCanvas, &QAbstractButton::clicked, this, &QgsOSMDownloadDialog::onExtentCanvas );
48+
connect( radExtentLayer, &QAbstractButton::clicked, this, &QgsOSMDownloadDialog::onExtentLayer );
49+
connect( radExtentManual, &QAbstractButton::clicked, this, &QgsOSMDownloadDialog::onExtentManual );
50+
connect( cboLayers, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsOSMDownloadDialog::onCurrentLayerChanged );
51+
connect( btnBrowse, &QAbstractButton::clicked, this, &QgsOSMDownloadDialog::onBrowseClicked );
52+
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOSMDownloadDialog::onOK );
53+
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOSMDownloadDialog::onClose );
54+
55+
connect( mDownload, &QgsOSMDownload::finished, this, &QgsOSMDownloadDialog::onFinished );
56+
connect( mDownload, &QgsOSMDownload::downloadProgress, this, &QgsOSMDownloadDialog::onDownloadProgress );
5757
}
5858

5959
QgsOSMDownloadDialog::~QgsOSMDownloadDialog()

‎src/app/openstreetmap/qgsosmexportdialog.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ QgsOSMExportDialog::QgsOSMExportDialog( QWidget *parent )
3333
{
3434
setupUi( this );
3535

36-
connect( btnBrowseDb, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
37-
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) );
38-
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( onClose() ) );
39-
connect( editDbFileName, SIGNAL( textChanged( QString ) ), this, SLOT( updateLayerName() ) );
40-
connect( radPoints, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
41-
connect( radPolylines, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
42-
connect( radPolygons, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
43-
connect( btnLoadTags, SIGNAL( clicked() ), this, SLOT( onLoadTags() ) );
44-
connect( btnSelectAll, SIGNAL( clicked() ), this, SLOT( onSelectAll() ) );
45-
connect( btnDeselectAll, SIGNAL( clicked() ), this, SLOT( onDeselectAll() ) );
36+
connect( btnBrowseDb, &QAbstractButton::clicked, this, &QgsOSMExportDialog::onBrowse );
37+
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOSMExportDialog::onOK );
38+
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOSMExportDialog::onClose );
39+
connect( editDbFileName, &QLineEdit::textChanged, this, &QgsOSMExportDialog::updateLayerName );
40+
connect( radPoints, &QAbstractButton::clicked, this, &QgsOSMExportDialog::updateLayerName );
41+
connect( radPolylines, &QAbstractButton::clicked, this, &QgsOSMExportDialog::updateLayerName );
42+
connect( radPolygons, &QAbstractButton::clicked, this, &QgsOSMExportDialog::updateLayerName );
43+
connect( btnLoadTags, &QAbstractButton::clicked, this, &QgsOSMExportDialog::onLoadTags );
44+
connect( btnSelectAll, &QAbstractButton::clicked, this, &QgsOSMExportDialog::onSelectAll );
45+
connect( btnDeselectAll, &QAbstractButton::clicked, this, &QgsOSMExportDialog::onDeselectAll );
4646

4747
mTagsModel = new QStandardItemModel( this );
4848
mTagsModel->setHorizontalHeaderLabels( QStringList() << tr( "Tag" ) << tr( "Count" ) << tr( "Not null" ) );

‎src/app/openstreetmap/qgsosmimportdialog.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ QgsOSMImportDialog::QgsOSMImportDialog( QWidget *parent )
2828
{
2929
setupUi( this );
3030

31-
connect( btnBrowseXml, SIGNAL( clicked() ), this, SLOT( onBrowseXml() ) );
32-
connect( btnBrowseDb, SIGNAL( clicked() ), this, SLOT( onBrowseDb() ) );
33-
connect( editXmlFileName, SIGNAL( textChanged( const QString & ) ), this, SLOT( xmlFileNameChanged( const QString & ) ) );
34-
connect( editDbFileName, SIGNAL( textChanged( const QString & ) ), this, SLOT( dbFileNameChanged( const QString & ) ) );
35-
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) );
36-
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( onClose() ) );
37-
38-
connect( mImport, SIGNAL( progress( int ) ), this, SLOT( onProgress( int ) ) );
31+
connect( btnBrowseXml, &QAbstractButton::clicked, this, &QgsOSMImportDialog::onBrowseXml );
32+
connect( btnBrowseDb, &QAbstractButton::clicked, this, &QgsOSMImportDialog::onBrowseDb );
33+
connect( editXmlFileName, &QLineEdit::textChanged, this, &QgsOSMImportDialog::xmlFileNameChanged );
34+
connect( editDbFileName, &QLineEdit::textChanged, this, &QgsOSMImportDialog::dbFileNameChanged );
35+
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOSMImportDialog::onOK );
36+
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOSMImportDialog::onClose );
37+
38+
connect( mImport, &QgsOSMXmlImport::progress, this, &QgsOSMImportDialog::onProgress );
3939
}
4040

4141
QgsOSMImportDialog::~QgsOSMImportDialog()

‎src/app/pluginmanager/qgspluginmanager.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
106106
mOptionsListWidget->setCurrentRow( 0 );
107107

108108
// Connect other signals
109-
connect( mOptionsListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( setCurrentTab( int ) ) );
110-
connect( vwPlugins->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( currentPluginChanged( const QModelIndex & ) ) );
111-
connect( mModelPlugins, SIGNAL( itemChanged( QStandardItem * ) ), this, SLOT( pluginItemChanged( QStandardItem * ) ) );
109+
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, &QgsPluginManager::setCurrentTab );
110+
connect( vwPlugins->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsPluginManager::currentPluginChanged );
111+
connect( mModelPlugins, &QStandardItemModel::itemChanged, this, &QgsPluginManager::pluginItemChanged );
112112
// Force setting the status filter (if the active tab was 0, the setCurrentRow( 0 ) above doesn't take any action)
113113
setCurrentTab( 0 );
114114

@@ -180,10 +180,10 @@ void QgsPluginManager::setPythonUtils( QgsPythonUtils *pythonUtils )
180180
vwPlugins->addAction( actionSortByVote );
181181
vwPlugins->addAction( actionSortByStatus );
182182
vwPlugins->setContextMenuPolicy( Qt::ActionsContextMenu );
183-
connect( actionSortByName, SIGNAL( triggered() ), mModelProxy, SLOT( sortPluginsByName() ) );
184-
connect( actionSortByDownloads, SIGNAL( triggered() ), mModelProxy, SLOT( sortPluginsByDownloads() ) );
185-
connect( actionSortByVote, SIGNAL( triggered() ), mModelProxy, SLOT( sortPluginsByVote() ) );
186-
connect( actionSortByStatus, SIGNAL( triggered() ), mModelProxy, SLOT( sortPluginsByStatus() ) );
183+
connect( actionSortByName, &QAction::triggered, mModelProxy, &QgsPluginSortFilterProxyModel::sortPluginsByName );
184+
connect( actionSortByDownloads, &QAction::triggered, mModelProxy, &QgsPluginSortFilterProxyModel::sortPluginsByDownloads );
185+
connect( actionSortByVote, &QAction::triggered, mModelProxy, &QgsPluginSortFilterProxyModel::sortPluginsByVote );
186+
connect( actionSortByStatus, &QAction::triggered, mModelProxy, &QgsPluginSortFilterProxyModel::sortPluginsByStatus );
187187

188188
// get the QgsSettings group from the installer
189189
QString settingsGroup;
@@ -1010,12 +1010,12 @@ void QgsPluginManager::addToRepositoryList( const QMap<QString, QString> &reposi
10101010
buttonRefreshRepos->setText( tr( "Reload all repositories" ) );
10111011
QAction *actionEnableThisRepositoryOnly = new QAction( tr( "Only show plugins from selected repository" ), treeRepositories );
10121012
treeRepositories->addAction( actionEnableThisRepositoryOnly );
1013-
connect( actionEnableThisRepositoryOnly, SIGNAL( triggered() ), this, SLOT( setRepositoryFilter() ) );
1013+
connect( actionEnableThisRepositoryOnly, &QAction::triggered, this, &QgsPluginManager::setRepositoryFilter );
10141014
treeRepositories->setContextMenuPolicy( Qt::ActionsContextMenu );
10151015
QAction *actionClearFilter = new QAction( tr( "Clear filter" ), treeRepositories );
10161016
actionClearFilter->setEnabled( repository.value( QStringLiteral( "inspection_filter" ) ) == QLatin1String( "true" ) );
10171017
treeRepositories->addAction( actionClearFilter );
1018-
connect( actionClearFilter, SIGNAL( triggered() ), this, SLOT( clearRepositoryFilter() ) );
1018+
connect( actionClearFilter, &QAction::triggered, this, &QgsPluginManager::clearRepositoryFilter );
10191019
}
10201020

10211021
QString key = repository.value( QStringLiteral( "name" ) );

‎src/app/qgisappinterface.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ QgisAppInterface::QgisAppInterface( QgisApp *_qgis )
5151
, pluginManagerIface( _qgis->pluginManager() )
5252
{
5353
// connect signals
54-
connect( qgis->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
55-
this, SIGNAL( currentLayerChanged( QgsMapLayer * ) ) );
56-
connect( qgis, SIGNAL( currentThemeChanged( QString ) ),
57-
this, SIGNAL( currentThemeChanged( QString ) ) );
54+
connect( qgis->layerTreeView(), &QgsLayerTreeView::currentLayerChanged,
55+
this, &QgisInterface::currentLayerChanged );
56+
connect( qgis, &QgisApp::currentThemeChanged,
57+
this, &QgisAppInterface::currentThemeChanged );
5858
connect( qgis, &QgisApp::composerOpened, this, &QgisAppInterface::composerOpened );
5959
connect( qgis, &QgisApp::composerWillBeClosed, this, &QgisAppInterface::composerWillBeClosed );
6060
connect( qgis, &QgisApp::composerClosed, this, &QgisAppInterface::composerClosed );
61-
connect( qgis, SIGNAL( initializationCompleted() ),
62-
this, SIGNAL( initializationCompleted() ) );
63-
connect( qgis, SIGNAL( newProject() ),
64-
this, SIGNAL( newProjectCreated() ) );
65-
connect( qgis, SIGNAL( projectRead() ),
66-
this, SIGNAL( projectRead() ) );
67-
connect( qgis, SIGNAL( layerSavedAs( QgsMapLayer *, QString ) ),
68-
this, SIGNAL( layerSavedAs( QgsMapLayer *, QString ) ) );
61+
connect( qgis, &QgisApp::initializationCompleted,
62+
this, &QgisInterface::initializationCompleted );
63+
connect( qgis, &QgisApp::newProject,
64+
this, &QgisInterface::newProjectCreated );
65+
connect( qgis, &QgisApp::projectRead,
66+
this, &QgisInterface::projectRead );
67+
connect( qgis, &QgisApp::layerSavedAs,
68+
this, &QgisInterface::layerSavedAs );
6969
}
7070

7171
QgsPluginManagerInterface *QgisAppInterface::pluginManagerInterface()

‎src/app/qgsabout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void QgsAbout::init()
6565
developersMapView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
6666
developersMapView->setContextMenuPolicy( Qt::NoContextMenu );
6767

68-
connect( developersMapView, SIGNAL( linkClicked( const QUrl & ) ), this, SLOT( openUrl( const QUrl & ) ) );
68+
connect( developersMapView, &QWebView::linkClicked, this, &QgsAbout::openUrl );
6969

7070
// set the 60x60 icon pixmap
7171
qgisIcon->setPixmap( QPixmap( QgsApplication::appIconPath() ) );

‎src/app/qgsaddtaborgroup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ QgsAddTabOrGroup::QgsAddTabOrGroup( QgsVectorLayer *lyr, const QList < TabPair >
4949
mGroupButton->setEnabled( false );
5050
}
5151

52-
connect( mTabButton, SIGNAL( toggled( bool ) ), this, SLOT( on_mTabButton_toggled( bool ) ) );
53-
connect( mGroupButton, SIGNAL( toggled( bool ) ), this, SLOT( on_mGroupButton_toggled( bool ) ) );
52+
connect( mTabButton, &QAbstractButton::toggled, this, &QgsAddTabOrGroup::on_mTabButton_toggled );
53+
connect( mGroupButton, &QAbstractButton::toggled, this, &QgsAddTabOrGroup::on_mGroupButton_toggled );
5454

5555
mColumnCountSpinBox->setValue( QgsSettings().value( QStringLiteral( "/qgis/attributeForm/defaultTabColumnCount" ), 1 ).toInt() );
5656

‎src/app/qgsalignrasterdialog.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,31 @@ QgsAlignRasterDialog::QgsAlignRasterDialog( QWidget *parent )
8383
mAlign = new QgsAlignRaster;
8484
mAlign->setProgressHandler( new QgsAlignRasterDialogProgress( mProgress ) );
8585

86-
connect( mBtnAdd, SIGNAL( clicked( bool ) ), this, SLOT( addLayer() ) );
87-
connect( mBtnRemove, SIGNAL( clicked( bool ) ), this, SLOT( removeLayer() ) );
88-
connect( mBtnEdit, SIGNAL( clicked( bool ) ), this, SLOT( editLayer() ) );
86+
connect( mBtnAdd, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::addLayer );
87+
connect( mBtnRemove, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::removeLayer );
88+
connect( mBtnEdit, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::editLayer );
8989

90-
connect( mCboReferenceLayer, SIGNAL( currentIndexChanged( int ) ), this, SLOT( referenceLayerChanged() ) );
91-
connect( mCrsSelector, SIGNAL( crsChanged( QgsCoordinateReferenceSystem ) ), this, SLOT( destinationCrsChanged() ) );
92-
connect( mSpinCellSizeX, SIGNAL( valueChanged( double ) ), this, SLOT( updateParametersFromReferenceLayer() ) );
93-
connect( mSpinCellSizeY, SIGNAL( valueChanged( double ) ), this, SLOT( updateParametersFromReferenceLayer() ) );
94-
connect( mSpinGridOffsetX, SIGNAL( valueChanged( double ) ), this, SLOT( updateParametersFromReferenceLayer() ) );
95-
connect( mSpinGridOffsetY, SIGNAL( valueChanged( double ) ), this, SLOT( updateParametersFromReferenceLayer() ) );
90+
connect( mCboReferenceLayer, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [ = ] { referenceLayerChanged(); } );
91+
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsAlignRasterDialog::destinationCrsChanged );
92+
connect( mSpinCellSizeX, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsAlignRasterDialog::updateParametersFromReferenceLayer );
93+
connect( mSpinCellSizeY, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsAlignRasterDialog::updateParametersFromReferenceLayer );
94+
connect( mSpinGridOffsetX, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsAlignRasterDialog::updateParametersFromReferenceLayer );
95+
connect( mSpinGridOffsetY, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsAlignRasterDialog::updateParametersFromReferenceLayer );
9696

97-
connect( mChkCustomCRS, SIGNAL( clicked( bool ) ), this, SLOT( updateCustomCrs() ) );
98-
connect( mChkCustomCellSize, SIGNAL( clicked( bool ) ), this, SLOT( updateCustomCellSize() ) );
99-
connect( mChkCustomGridOffset, SIGNAL( clicked( bool ) ), this, SLOT( updateCustomGridOffset() ) );
97+
connect( mChkCustomCRS, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::updateCustomCrs );
98+
connect( mChkCustomCellSize, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::updateCustomCellSize );
99+
connect( mChkCustomGridOffset, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::updateCustomGridOffset );
100100

101101
mClipExtentGroupBox->setChecked( false );
102102
mClipExtentGroupBox->setCollapsed( true );
103103
mClipExtentGroupBox->setTitleBase( tr( "Clip to Extent" ) );
104104
QgsMapCanvas *mc = QgisApp::instance()->mapCanvas();
105105
mClipExtentGroupBox->setCurrentExtent( mc->extent(), mc->mapSettings().destinationCrs() );
106-
connect( mClipExtentGroupBox, SIGNAL( extentChanged( QgsRectangle ) ), this, SLOT( clipExtentChanged() ) );
106+
connect( mClipExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsAlignRasterDialog::clipExtentChanged );
107107

108108
// TODO: auto-detect reference layer
109109

110-
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( runAlign() ) );
110+
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsAlignRasterDialog::runAlign );
111111

112112
populateLayersView();
113113

@@ -402,7 +402,7 @@ QgsAlignRasterLayerConfigDialog::QgsAlignRasterLayerConfigDialog()
402402

403403
editOutput = new QLineEdit( this );
404404
btnBrowse = new QPushButton( tr( "Browse..." ), this );
405-
connect( btnBrowse, SIGNAL( clicked( bool ) ), this, SLOT( browseOutputFilename() ) );
405+
connect( btnBrowse, &QAbstractButton::clicked, this, &QgsAlignRasterLayerConfigDialog::browseOutputFilename );
406406

407407
QHBoxLayout *layoutOutput = new QHBoxLayout();
408408
layoutOutput->addWidget( editOutput );
@@ -411,8 +411,8 @@ QgsAlignRasterLayerConfigDialog::QgsAlignRasterLayerConfigDialog()
411411
chkRescale = new QCheckBox( tr( "Rescale values according to the cell size" ), this );
412412

413413
btnBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this );
414-
connect( btnBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
415-
connect( btnBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
414+
connect( btnBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
415+
connect( btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
416416

417417
layout->addWidget( new QLabel( tr( "Input raster layer:" ), this ) );
418418
layout->addWidget( cboLayers );

‎src/app/qgsapplayertreeviewmenuprovider.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
170170
colorWheel->setColor( singleRenderer->symbol()->color() );
171171
QgsColorWidgetAction *colorAction = new QgsColorWidgetAction( colorWheel, menuStyleManager, menuStyleManager );
172172
colorAction->setDismissOnColorSelection( false );
173-
connect( colorAction, SIGNAL( colorChanged( const QColor & ) ), this, SLOT( setVectorSymbolColor( const QColor & ) ) );
173+
connect( colorAction, &QgsColorWidgetAction::colorChanged, this, &QgsAppLayerTreeViewMenuProvider::setVectorSymbolColor );
174174
//store the layer id in action, so we can later retrieve the corresponding layer
175175
colorAction->setProperty( "layerId", vlayer->id() );
176176
menuStyleManager->addAction( colorAction );
@@ -184,14 +184,14 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
184184
recentColorAction->setProperty( "layerId", vlayer->id() );
185185
recentColorAction->setDismissOnColorSelection( false );
186186
menuStyleManager->addAction( recentColorAction );
187-
connect( recentColorAction, SIGNAL( colorChanged( const QColor & ) ), this, SLOT( setVectorSymbolColor( const QColor & ) ) );
187+
connect( recentColorAction, &QgsColorSwatchGridAction::colorChanged, this, &QgsAppLayerTreeViewMenuProvider::setVectorSymbolColor );
188188
}
189189

190190
menuStyleManager->addSeparator();
191191
QAction *editSymbolAction = new QAction( tr( "Edit Symbol..." ), menuStyleManager );
192192
//store the layer id in action, so we can later retrieve the corresponding layer
193193
editSymbolAction->setProperty( "layerId", vlayer->id() );
194-
connect( editSymbolAction, SIGNAL( triggered() ), this, SLOT( editVectorSymbol() ) );
194+
connect( editSymbolAction, &QAction::triggered, this, &QgsAppLayerTreeViewMenuProvider::editVectorSymbol );
195195
menuStyleManager->addAction( editSymbolAction );
196196
}
197197
}
@@ -305,7 +305,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
305305
colorWheel->setColor( symbolNode->symbol()->color() );
306306
QgsColorWidgetAction *colorAction = new QgsColorWidgetAction( colorWheel, menu, menu );
307307
colorAction->setDismissOnColorSelection( false );
308-
connect( colorAction, SIGNAL( colorChanged( const QColor & ) ), this, SLOT( setSymbolLegendNodeColor( const QColor & ) ) );
308+
connect( colorAction, &QgsColorWidgetAction::colorChanged, this, &QgsAppLayerTreeViewMenuProvider::setSymbolLegendNodeColor );
309309
//store the layer id and rule key in action, so we can later retrieve the corresponding
310310
//legend node, if it still exists
311311
colorAction->setProperty( "layerId", symbolNode->layerNode()->layerId() );
@@ -322,7 +322,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
322322
recentColorAction->setProperty( "ruleKey", symbolNode->data( QgsLayerTreeModelLegendNode::RuleKeyRole ).toString() );
323323
recentColorAction->setDismissOnColorSelection( false );
324324
menu->addAction( recentColorAction );
325-
connect( recentColorAction, SIGNAL( colorChanged( const QColor & ) ), this, SLOT( setSymbolLegendNodeColor( const QColor & ) ) );
325+
connect( recentColorAction, &QgsColorSwatchGridAction::colorChanged, this, &QgsAppLayerTreeViewMenuProvider::setSymbolLegendNodeColor );
326326
}
327327

328328
menu->addSeparator();
@@ -333,7 +333,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
333333
//legend node, if it still exists
334334
editSymbolAction->setProperty( "layerId", symbolNode->layerNode()->layerId() );
335335
editSymbolAction->setProperty( "ruleKey", symbolNode->data( QgsLayerTreeModelLegendNode::RuleKeyRole ).toString() );
336-
connect( editSymbolAction, SIGNAL( triggered() ), this, SLOT( editSymbolLegendNodeSymbol() ) );
336+
connect( editSymbolAction, &QAction::triggered, this, &QgsAppLayerTreeViewMenuProvider::editSymbolLegendNodeSymbol );
337337
menu->addAction( editSymbolAction );
338338
}
339339
}

‎src/app/qgsattributeactiondialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ QgsAttributeActionDialog::QgsAttributeActionDialog( const QgsActionManager &acti
4949
mAttributeActionTable->setCornerButtonEnabled( false );
5050
mAttributeActionTable->setEditTriggers( QAbstractItemView::AnyKeyPressed | QAbstractItemView::SelectedClicked );
5151

52-
connect( mAttributeActionTable, SIGNAL( itemDoubleClicked( QTableWidgetItem * ) ), this, SLOT( itemDoubleClicked( QTableWidgetItem * ) ) );
53-
connect( mAttributeActionTable, SIGNAL( itemSelectionChanged() ), this, SLOT( updateButtons() ) );
54-
connect( mMoveUpButton, SIGNAL( clicked() ), this, SLOT( moveUp() ) );
55-
connect( mMoveDownButton, SIGNAL( clicked() ), this, SLOT( moveDown() ) );
56-
connect( mRemoveButton, SIGNAL( clicked() ), this, SLOT( remove() ) );
57-
connect( mAddButton, SIGNAL( clicked( bool ) ), this, SLOT( insert() ) );
58-
connect( mAddDefaultActionsButton, SIGNAL( clicked() ), this, SLOT( addDefaultActions() ) );
52+
connect( mAttributeActionTable, &QTableWidget::itemDoubleClicked, this, &QgsAttributeActionDialog::itemDoubleClicked );
53+
connect( mAttributeActionTable, &QTableWidget::itemSelectionChanged, this, &QgsAttributeActionDialog::updateButtons );
54+
connect( mMoveUpButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveUp );
55+
connect( mMoveDownButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveDown );
56+
connect( mRemoveButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::remove );
57+
connect( mAddButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::insert );
58+
connect( mAddDefaultActionsButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::addDefaultActions );
5959

6060
init( actions, mLayer->attributeTableConfig() );
6161
}

‎src/app/qgsattributeactionpropertiesdialog.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ void QgsAttributeActionPropertiesDialog::init( const QSet<QString> &actionScopes
207207
mFieldExpression->setGeomCalculator( myDa );
208208
mFieldExpression->registerExpressionContextGenerator( this );
209209

210-
connect( mBrowseButton, SIGNAL( clicked( bool ) ), this, SLOT( browse() ) );
211-
connect( mInsertFieldOrExpression, SIGNAL( clicked( bool ) ), this, SLOT( insertExpressionOrField() ) );
212-
connect( mActionName, SIGNAL( textChanged( QString ) ), this, SLOT( updateButtons() ) );
213-
connect( mActionText, SIGNAL( textChanged() ), this, SLOT( updateButtons() ) );
214-
connect( mChooseIconButton, SIGNAL( clicked( bool ) ), this, SLOT( chooseIcon() ) );
210+
connect( mBrowseButton, &QAbstractButton::clicked, this, &QgsAttributeActionPropertiesDialog::browse );
211+
connect( mInsertFieldOrExpression, &QAbstractButton::clicked, this, &QgsAttributeActionPropertiesDialog::insertExpressionOrField );
212+
connect( mActionName, &QLineEdit::textChanged, this, &QgsAttributeActionPropertiesDialog::updateButtons );
213+
connect( mActionText, &QsciScintilla::textChanged, this, &QgsAttributeActionPropertiesDialog::updateButtons );
214+
connect( mChooseIconButton, &QAbstractButton::clicked, this, &QgsAttributeActionPropertiesDialog::chooseIcon );
215215

216216
updateButtons();
217217
}

‎src/app/qgsattributetabledialog.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -170,41 +170,41 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QWidget
170170
mActionEditedFilter->setIcon( filterIcon );
171171

172172
// Connect filter signals
173-
connect( mActionAdvancedFilter, SIGNAL( triggered() ), SLOT( filterExpressionBuilder() ) );
174-
connect( mActionShowAllFilter, SIGNAL( triggered() ), SLOT( filterShowAll() ) );
175-
connect( mActionSelectedFilter, SIGNAL( triggered() ), SLOT( filterSelected() ) );
176-
connect( mActionVisibleFilter, SIGNAL( triggered() ), SLOT( filterVisible() ) );
177-
connect( mActionEditedFilter, SIGNAL( triggered() ), SLOT( filterEdited() ) );
173+
connect( mActionAdvancedFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterExpressionBuilder );
174+
connect( mActionShowAllFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterShowAll );
175+
connect( mActionSelectedFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterSelected );
176+
connect( mActionVisibleFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterVisible );
177+
connect( mActionEditedFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterEdited );
178178
connect( mFilterActionMapper, SIGNAL( mapped( QObject * ) ), SLOT( filterColumnChanged( QObject * ) ) );
179-
connect( mFilterQuery, SIGNAL( returnPressed() ), SLOT( filterQueryAccepted() ) );
180-
connect( mActionApplyFilter, SIGNAL( triggered() ), SLOT( filterQueryAccepted() ) );
181-
connect( mActionSetStyles, SIGNAL( triggered() ), SLOT( openConditionalStyles() ) );
179+
connect( mFilterQuery, &QLineEdit::returnPressed, this, &QgsAttributeTableDialog::filterQueryAccepted );
180+
connect( mActionApplyFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterQueryAccepted );
181+
connect( mActionSetStyles, &QAction::triggered, this, &QgsAttributeTableDialog::openConditionalStyles );
182182

183183
// info from layer to table
184-
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
185-
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
186-
connect( mLayer, SIGNAL( destroyed() ), this, SLOT( close() ) );
184+
connect( mLayer, &QgsVectorLayer::editingStarted, this, &QgsAttributeTableDialog::editingToggled );
185+
connect( mLayer, &QgsVectorLayer::editingStopped, this, &QgsAttributeTableDialog::editingToggled );
186+
connect( mLayer, &QObject::destroyed, this, &QWidget::close );
187187
connect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsAttributeTableDialog::updateTitle );
188-
connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( updateTitle() ) );
189-
connect( mLayer, SIGNAL( featuresDeleted( QgsFeatureIds ) ), this, SLOT( updateTitle() ) );
190-
connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( columnBoxInit() ) );
191-
connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( columnBoxInit() ) );
188+
connect( mLayer, &QgsVectorLayer::featureAdded, this, &QgsAttributeTableDialog::updateTitle );
189+
connect( mLayer, &QgsVectorLayer::featuresDeleted, this, &QgsAttributeTableDialog::updateTitle );
190+
connect( mLayer, &QgsVectorLayer::attributeAdded, this, &QgsAttributeTableDialog::columnBoxInit );
191+
connect( mLayer, &QgsVectorLayer::attributeDeleted, this, &QgsAttributeTableDialog::columnBoxInit );
192192
connect( mLayer, &QgsVectorLayer::readOnlyChanged, this, &QgsAttributeTableDialog::editingToggled );
193193

194194
// connect table info to window
195-
connect( mMainView, SIGNAL( filterChanged() ), this, SLOT( updateTitle() ) );
196-
connect( mMainView, SIGNAL( filterExpressionSet( QString, QgsAttributeForm::FilterType ) ), this, SLOT( formFilterSet( QString, QgsAttributeForm::FilterType ) ) );
197-
connect( mMainView, SIGNAL( formModeChanged( QgsAttributeForm::Mode ) ), this, SLOT( viewModeChanged( QgsAttributeForm::Mode ) ) );
195+
connect( mMainView, &QgsDualView::filterChanged, this, &QgsAttributeTableDialog::updateTitle );
196+
connect( mMainView, &QgsDualView::filterExpressionSet, this, &QgsAttributeTableDialog::formFilterSet );
197+
connect( mMainView, &QgsDualView::formModeChanged, this, &QgsAttributeTableDialog::viewModeChanged );
198198

199199
// info from table to application
200-
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );
200+
connect( this, &QgsAttributeTableDialog::saveEdits, this, [ = ] { QgisApp::instance()->saveEdits(); } );
201201

202202
bool myDockFlag = settings.value( QStringLiteral( "qgis/dockAttributeTable" ), false ).toBool();
203203
if ( myDockFlag )
204204
{
205205
mDock = new QgsAttributeTableDock( tr( "%1 (%n Feature(s))", "feature count", mMainView->featureCount() ).arg( mLayer->name() ), QgisApp::instance() );
206206
mDock->setWidget( this );
207-
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
207+
connect( this, &QObject::destroyed, mDock, &QWidget::close );
208208
QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
209209
}
210210

@@ -283,11 +283,11 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QWidget
283283
mFieldCombo->setFilters( QgsFieldProxyModel::AllTypes | QgsFieldProxyModel::HideReadOnly );
284284
mFieldCombo->setLayer( mLayer );
285285

286-
connect( mRunFieldCalc, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpression() ) );
287-
connect( mRunFieldCalcSelected, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpressionSelected() ) );
286+
connect( mRunFieldCalc, &QAbstractButton::clicked, this, &QgsAttributeTableDialog::updateFieldFromExpression );
287+
connect( mRunFieldCalcSelected, &QAbstractButton::clicked, this, &QgsAttributeTableDialog::updateFieldFromExpressionSelected );
288288
// NW TODO Fix in 2.6 - Doesn't work with field model for some reason.
289289
// connect( mUpdateExpressionText, SIGNAL( returnPressed() ), this, SLOT( updateFieldFromExpression() ) );
290-
connect( mUpdateExpressionText, SIGNAL( fieldChanged( QString, bool ) ), this, SLOT( updateButtonStatus( QString, bool ) ) );
290+
connect( mUpdateExpressionText, static_cast < void ( QgsFieldExpressionWidget::* )( const QString &, bool ) > ( &QgsFieldExpressionWidget::fieldChanged ), this, &QgsAttributeTableDialog::updateButtonStatus );
291291
mUpdateExpressionText->setLayer( mLayer );
292292
mUpdateExpressionText->setLeftHandButtonStyle( true );
293293

@@ -299,8 +299,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QWidget
299299
mMainView->setView( static_cast< QgsDualView::ViewMode >( initialView ) );
300300
mMainViewButtonGroup->button( initialView )->setChecked( true );
301301

302-
connect( mActionToggleMultiEdit, SIGNAL( toggled( bool ) ), mMainView, SLOT( setMultiEditEnabled( bool ) ) );
303-
connect( mActionSearchForm, SIGNAL( toggled( bool ) ), mMainView, SLOT( toggleSearchMode( bool ) ) );
302+
connect( mActionToggleMultiEdit, &QAction::toggled, mMainView, &QgsDualView::setMultiEditEnabled );
303+
connect( mActionSearchForm, &QAction::toggled, mMainView, &QgsDualView::toggleSearchMode );
304304
updateMultiEditButtonState();
305305

306306
if ( mLayer->editFormConfig().layout() == QgsEditFormConfig::UiFileLayout )
@@ -566,12 +566,12 @@ void QgsAttributeTableDialog::filterColumnChanged( QObject *filterAction )
566566
createSearchWidget( setup.type(), mLayer, fldIdx, setup.config(), mFilterContainer, mEditorContext );
567567
if ( mCurrentSearchWidgetWrapper->applyDirectly() )
568568
{
569-
connect( mCurrentSearchWidgetWrapper, SIGNAL( expressionChanged( QString ) ), SLOT( filterQueryChanged( QString ) ) );
569+
connect( mCurrentSearchWidgetWrapper, &QgsSearchWidgetWrapper::expressionChanged, this, &QgsAttributeTableDialog::filterQueryChanged );
570570
mApplyFilterButton->setVisible( false );
571571
}
572572
else
573573
{
574-
connect( mCurrentSearchWidgetWrapper, SIGNAL( expressionChanged( QString ) ), SLOT( filterQueryAccepted() ) );
574+
connect( mCurrentSearchWidgetWrapper, &QgsSearchWidgetWrapper::expressionChanged, this, &QgsAttributeTableDialog::filterQueryAccepted );
575575
mApplyFilterButton->setVisible( true );
576576
}
577577

1 commit comments

Comments
 (1)

simon04 commented on Mar 31, 2017

@simon04
Contributor

When building 8a44161, I'm getting:

[ 64%] Building CXX object src/app/CMakeFiles/qgis_app.dir/qgsabout.cpp.o
/home/simon/src/QGIS/src/app/qgsabout.cpp: In member function ‘void QgsAbout::init()’:
/home/simon/src/QGIS/src/app/qgsabout.cpp:68:32: error: ‘QWebView’ has not been declared
   connect( developersMapView, &QWebView::linkClicked, this, &QgsAbout::openUrl );
                                ^~~~~~~~
make[2]: *** [src/app/CMakeFiles/qgis_app.dir/build.make:759: src/app/CMakeFiles/qgis_app.dir/qgsabout.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2785: src/app/CMakeFiles/qgis_app.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
Please sign in to comment.