Skip to content

Commit 106d95b

Browse files
committedApr 2, 2017
More new style Qt5 connects
1 parent 6f9f087 commit 106d95b

13 files changed

+63
-62
lines changed
 

‎src/gui/effects/qgseffectstackpropertieswidget.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ QgsEffectStackPropertiesWidget::QgsEffectStackPropertiesWidget( QgsEffectStack *
118118
mEffectsList->setModel( mModel );
119119

120120
QItemSelectionModel *selModel = mEffectsList->selectionModel();
121-
connect( selModel, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( effectChanged() ) );
121+
connect( selModel, &QItemSelectionModel::currentChanged, this, &QgsEffectStackPropertiesWidget::effectChanged );
122122

123123
loadStack( stack );
124124
updatePreview();
125125

126-
connect( mUpButton, SIGNAL( clicked() ), this, SLOT( moveEffectUp() ) );
127-
connect( mDownButton, SIGNAL( clicked() ), this, SLOT( moveEffectDown() ) );
128-
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addEffect() ) );
129-
connect( mRemoveButton, SIGNAL( clicked() ), this, SLOT( removeEffect() ) );
126+
connect( mUpButton, &QAbstractButton::clicked, this, &QgsEffectStackPropertiesWidget::moveEffectUp );
127+
connect( mDownButton, &QAbstractButton::clicked, this, &QgsEffectStackPropertiesWidget::moveEffectDown );
128+
connect( mAddButton, &QAbstractButton::clicked, this, &QgsEffectStackPropertiesWidget::addEffect );
129+
connect( mRemoveButton, &QAbstractButton::clicked, this, &QgsEffectStackPropertiesWidget::removeEffect );
130130

131131
updateUi();
132132

@@ -253,12 +253,11 @@ void QgsEffectStackPropertiesWidget::effectChanged()
253253
if ( !currentItem )
254254
return;
255255

256-
QWidget *effectPropertiesWidget = new QgsPaintEffectPropertiesWidget( currentItem->effect() );
256+
QgsPaintEffectPropertiesWidget *effectPropertiesWidget = new QgsPaintEffectPropertiesWidget( currentItem->effect() );
257257
setWidget( effectPropertiesWidget );
258258

259-
connect( effectPropertiesWidget, SIGNAL( changeEffect( QgsPaintEffect * ) ), this, SLOT( changeEffect( QgsPaintEffect * ) ) );
260-
connect( effectPropertiesWidget, SIGNAL( changed() ), this, SLOT( updatePreview() ) );
261-
259+
connect( effectPropertiesWidget, &QgsPaintEffectPropertiesWidget::changeEffect, this, &QgsEffectStackPropertiesWidget::changeEffect );
260+
connect( effectPropertiesWidget, &QgsPaintEffectPropertiesWidget::changed, this, &QgsEffectStackPropertiesWidget::updatePreview );
262261
}
263262

264263
void QgsEffectStackPropertiesWidget::setWidget( QWidget *widget )
@@ -408,8 +407,8 @@ QgsEffectStackCompactWidget::QgsEffectStackCompactWidget( QWidget *parent, QgsPa
408407
setFocusPolicy( Qt::StrongFocus );
409408
setFocusProxy( mEnabledCheckBox );
410409

411-
connect( mButton, SIGNAL( clicked() ), this, SLOT( showDialog() ) );
412-
connect( mEnabledCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( enableToggled( bool ) ) );
410+
connect( mButton, &QAbstractButton::clicked, this, &QgsEffectStackCompactWidget::showDialog );
411+
connect( mEnabledCheckBox, &QAbstractButton::toggled, this, &QgsEffectStackCompactWidget::enableToggled );
413412

414413
setPaintEffect( effect );
415414
}
@@ -466,7 +465,7 @@ void QgsEffectStackCompactWidget::showDialog()
466465
{
467466
widget->setPreviewPicture( *mPreviewPicture );
468467
}
469-
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( updateEffectLive() ) );
468+
connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsEffectStackCompactWidget::updateEffectLive );
470469
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsEffectStackCompactWidget::updateAcceptWidget );
471470
openPanel( widget );
472471
}

‎src/gui/effects/qgspainteffectpropertieswidget.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ QgsPaintEffectPropertiesWidget::QgsPaintEffectPropertiesWidget( QgsPaintEffect *
8282
}
8383
// set the corresponding widget
8484
updateEffectWidget( effect );
85-
connect( mEffectTypeCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( effectTypeChanged() ) );
85+
connect( mEffectTypeCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPaintEffectPropertiesWidget::effectTypeChanged );
8686
}
8787

8888

@@ -112,7 +112,8 @@ void QgsPaintEffectPropertiesWidget::updateEffectWidget( QgsPaintEffect *effect
112112
if ( stackedWidget->currentWidget() != pageDummy )
113113
{
114114
// stop updating from the original widget
115-
disconnect( stackedWidget->currentWidget(), SIGNAL( changed() ), this, SLOT( emitSignalChanged() ) );
115+
if ( QgsPaintEffectWidget *pew = qobject_cast< QgsPaintEffectWidget * >( stackedWidget->currentWidget() ) )
116+
disconnect( pew, &QgsPaintEffectWidget::changed, this, &QgsPaintEffectPropertiesWidget::emitSignalChanged );
116117
stackedWidget->removeWidget( stackedWidget->currentWidget() );
117118
}
118119

@@ -127,7 +128,7 @@ void QgsPaintEffectPropertiesWidget::updateEffectWidget( QgsPaintEffect *effect
127128
stackedWidget->addWidget( w );
128129
stackedWidget->setCurrentWidget( w );
129130
// start receiving updates from widget
130-
connect( w, SIGNAL( changed() ), this, SLOT( emitSignalChanged() ) );
131+
connect( w, &QgsPaintEffectWidget::changed, this, &QgsPaintEffectPropertiesWidget::emitSignalChanged );
131132
return;
132133
}
133134
}

‎src/gui/effects/qgspainteffectwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ QgsGlowWidget::QgsGlowWidget( QWidget *parent )
429429
initGui();
430430

431431
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsGlowWidget::applyColorRamp );
432-
connect( radioSingleColor, SIGNAL( toggled( bool ) ), this, SLOT( colorModeChanged() ) );
432+
connect( radioSingleColor, &QAbstractButton::toggled, this, &QgsGlowWidget::colorModeChanged );
433433
}
434434

435435
void QgsGlowWidget::setPaintEffect( QgsPaintEffect *effect )

‎src/gui/layertree/qgslayertreeembeddedconfigwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ void QgsLayerTreeEmbeddedConfigWidget::setLayer( QgsMapLayer *layer )
3232
{
3333
mLayer = layer;
3434

35-
connect( mBtnAdd, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) );
36-
connect( mBtnRemove, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) );
35+
connect( mBtnAdd, &QAbstractButton::clicked, this, &QgsLayerTreeEmbeddedConfigWidget::onAddClicked );
36+
connect( mBtnRemove, &QAbstractButton::clicked, this, &QgsLayerTreeEmbeddedConfigWidget::onRemoveClicked );
3737

3838
QStandardItemModel *modelAvailable = new QStandardItemModel( this );
3939
QStandardItemModel *modelUsed = new QStandardItemModel( this );

‎src/gui/layertree/qgslayertreeembeddedwidgetsimpl.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ QgsLayerTreeTransparencyWidget::QgsLayerTreeTransparencyWidget( QgsMapLayer *lay
4343
mTimer = new QTimer( this );
4444
mTimer->setSingleShot( true );
4545
mTimer->setInterval( 100 );
46-
connect( mTimer, SIGNAL( timeout() ), this, SLOT( updateTransparencyFromSlider() ) );
46+
connect( mTimer, &QTimer::timeout, this, &QgsLayerTreeTransparencyWidget::updateTransparencyFromSlider );
4747

48-
connect( mSlider, SIGNAL( valueChanged( int ) ), this, SLOT( sliderValueChanged( int ) ) );
48+
connect( mSlider, &QAbstractSlider::valueChanged, this, &QgsLayerTreeTransparencyWidget::sliderValueChanged );
4949

5050
// init from layer
5151
if ( mLayer->type() == QgsMapLayer::VectorLayer )
5252
{
53-
mSlider->setValue( qobject_cast<QgsVectorLayer *>( mLayer )->layerTransparency() );
54-
connect( mLayer, SIGNAL( layerTransparencyChanged( int ) ), this, SLOT( layerTrChanged() ) );
53+
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mLayer );
54+
mSlider->setValue( vl->layerTransparency() );
55+
connect( vl, &QgsVectorLayer::layerTransparencyChanged, this, &QgsLayerTreeTransparencyWidget::layerTrChanged );
5556
}
5657
else if ( mLayer->type() == QgsMapLayer::RasterLayer )
5758
{

‎src/gui/layertree/qgslayertreeview.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ QgsLayerTreeView::QgsLayerTreeView( QWidget *parent )
4242
setSelectionMode( ExtendedSelection );
4343
setDefaultDropAction( Qt::MoveAction );
4444

45-
connect( this, SIGNAL( collapsed( QModelIndex ) ), this, SLOT( updateExpandedStateToNode( QModelIndex ) ) );
46-
connect( this, SIGNAL( expanded( QModelIndex ) ), this, SLOT( updateExpandedStateToNode( QModelIndex ) ) );
45+
connect( this, &QTreeView::collapsed, this, &QgsLayerTreeView::updateExpandedStateToNode );
46+
connect( this, &QTreeView::expanded, this, &QgsLayerTreeView::updateExpandedStateToNode );
4747
}
4848

4949
QgsLayerTreeView::~QgsLayerTreeView()
@@ -56,16 +56,16 @@ void QgsLayerTreeView::setModel( QAbstractItemModel *model )
5656
if ( !qobject_cast<QgsLayerTreeModel *>( model ) )
5757
return;
5858

59-
connect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( modelRowsInserted( QModelIndex, int, int ) ) );
60-
connect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( modelRowsRemoved() ) );
59+
connect( model, &QAbstractItemModel::rowsInserted, this, &QgsLayerTreeView::modelRowsInserted );
60+
connect( model, &QAbstractItemModel::rowsRemoved, this, &QgsLayerTreeView::modelRowsRemoved );
6161

6262
QTreeView::setModel( model );
6363

64-
connect( layerTreeModel()->rootGroup(), SIGNAL( expandedChanged( QgsLayerTreeNode *, bool ) ), this, SLOT( onExpandedChanged( QgsLayerTreeNode *, bool ) ) );
64+
connect( layerTreeModel()->rootGroup(), &QgsLayerTreeNode::expandedChanged, this, &QgsLayerTreeView::onExpandedChanged );
6565

66-
connect( selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SLOT( onCurrentChanged() ) );
66+
connect( selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsLayerTreeView::onCurrentChanged );
6767

68-
connect( layerTreeModel(), SIGNAL( modelReset() ), this, SLOT( onModelReset() ) );
68+
connect( layerTreeModel(), &QAbstractItemModel::modelReset, this, &QgsLayerTreeView::onModelReset );
6969

7070
updateExpandedStateFromNode( layerTreeModel()->rootGroup() );
7171
}

‎src/gui/layertree/qgslayertreeviewdefaultactions.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ QgsLayerTreeViewDefaultActions::QgsLayerTreeViewDefaultActions( QgsLayerTreeView
3434
QAction *QgsLayerTreeViewDefaultActions::actionAddGroup( QObject *parent )
3535
{
3636
QAction *a = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddGroup.svg" ) ), tr( "&Add Group" ), parent );
37-
connect( a, SIGNAL( triggered() ), this, SLOT( addGroup() ) );
37+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::addGroup );
3838
return a;
3939
}
4040

4141
QAction *QgsLayerTreeViewDefaultActions::actionRemoveGroupOrLayer( QObject *parent )
4242
{
4343
QAction *a = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionRemoveLayer.svg" ) ), tr( "&Remove" ), parent );
44-
connect( a, SIGNAL( triggered() ), this, SLOT( removeGroupOrLayer() ) );
44+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::removeGroupOrLayer );
4545
return a;
4646
}
4747

@@ -52,7 +52,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionShowInOverview( QObject *parent )
5252
return nullptr;
5353

5454
QAction *a = new QAction( tr( "&Show in Overview" ), parent );
55-
connect( a, SIGNAL( triggered() ), this, SLOT( showInOverview() ) );
55+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::showInOverview );
5656
a->setCheckable( true );
5757
a->setChecked( node->customProperty( QStringLiteral( "overview" ), 0 ).toInt() );
5858
return a;
@@ -61,7 +61,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionShowInOverview( QObject *parent )
6161
QAction *QgsLayerTreeViewDefaultActions::actionRenameGroupOrLayer( QObject *parent )
6262
{
6363
QAction *a = new QAction( tr( "Re&name" ), parent );
64-
connect( a, SIGNAL( triggered() ), this, SLOT( renameGroupOrLayer() ) );
64+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::renameGroupOrLayer );
6565
return a;
6666
}
6767

@@ -72,7 +72,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionShowFeatureCount( QObject *parent
7272
return nullptr;
7373

7474
QAction *a = new QAction( tr( "Show Feature Count" ), parent );
75-
connect( a, SIGNAL( triggered() ), this, SLOT( showFeatureCount() ) );
75+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::showFeatureCount );
7676
a->setCheckable( true );
7777
a->setChecked( node->customProperty( QStringLiteral( "showFeatureCount" ), 0 ).toInt() );
7878
return a;
@@ -83,7 +83,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionZoomToLayer( QgsMapCanvas *canvas
8383
QAction *a = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomToLayer.svg" ) ),
8484
tr( "&Zoom to Layer" ), parent );
8585
a->setData( QVariant::fromValue( reinterpret_cast<void *>( canvas ) ) );
86-
connect( a, SIGNAL( triggered() ), this, SLOT( zoomToLayer() ) );
86+
connect( a, &QAction::triggered, this, static_cast<void ( QgsLayerTreeViewDefaultActions::* )()>( &QgsLayerTreeViewDefaultActions::zoomToLayer ) );
8787
return a;
8888
}
8989

@@ -92,21 +92,21 @@ QAction *QgsLayerTreeViewDefaultActions::actionZoomToGroup( QgsMapCanvas *canvas
9292
QAction *a = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomToLayer.svg" ) ),
9393
tr( "&Zoom to Group" ), parent );
9494
a->setData( QVariant::fromValue( reinterpret_cast<void *>( canvas ) ) );
95-
connect( a, SIGNAL( triggered() ), this, SLOT( zoomToGroup() ) );
95+
connect( a, &QAction::triggered, this, static_cast<void ( QgsLayerTreeViewDefaultActions::* )()>( &QgsLayerTreeViewDefaultActions::zoomToGroup ) );
9696
return a;
9797
}
9898

9999
QAction *QgsLayerTreeViewDefaultActions::actionMakeTopLevel( QObject *parent )
100100
{
101101
QAction *a = new QAction( tr( "&Move to Top-level" ), parent );
102-
connect( a, SIGNAL( triggered() ), this, SLOT( makeTopLevel() ) );
102+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::makeTopLevel );
103103
return a;
104104
}
105105

106106
QAction *QgsLayerTreeViewDefaultActions::actionGroupSelected( QObject *parent )
107107
{
108108
QAction *a = new QAction( tr( "&Group Selected" ), parent );
109-
connect( a, SIGNAL( triggered() ), this, SLOT( groupSelected() ) );
109+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::groupSelected );
110110
return a;
111111
}
112112

@@ -119,7 +119,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionMutuallyExclusiveGroup( QObject *
119119
QAction *a = new QAction( tr( "Mutually Exclusive Group" ), parent );
120120
a->setCheckable( true );
121121
a->setChecked( QgsLayerTree::toGroup( node )->isMutuallyExclusive() );
122-
connect( a, SIGNAL( triggered() ), this, SLOT( mutuallyExclusiveGroup() ) );
122+
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::mutuallyExclusiveGroup );
123123
return a;
124124
}
125125

‎src/gui/qgsattributeform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,8 +1697,8 @@ void QgsAttributeForm::addWidgetWrapper( QgsEditorWidgetWrapper *eww )
16971697
{
16981698
if ( meww->field() == eww->field() )
16991699
{
1700-
connect( meww, SIGNAL( valueChanged( QVariant ) ), eww, SLOT( setValue( QVariant ) ) );
1701-
connect( eww, SIGNAL( valueChanged( QVariant ) ), meww, SLOT( setValue( QVariant ) ) );
1700+
connect( meww, static_cast<void ( QgsEditorWidgetWrapper::* )( const QVariant & )>( &QgsEditorWidgetWrapper::valueChanged ), eww, &QgsEditorWidgetWrapper::setValue );
1701+
connect( eww, static_cast<void ( QgsEditorWidgetWrapper::* )( const QVariant & )>( &QgsEditorWidgetWrapper::valueChanged ), meww, &QgsEditorWidgetWrapper::setValue );
17021702
break;
17031703
}
17041704
}
@@ -1762,7 +1762,7 @@ void QgsAttributeForm::afterWidgetInit()
17621762
isFirstEww = false;
17631763
}
17641764

1765-
connect( eww, SIGNAL( valueChanged( const QVariant & ) ), this, SLOT( onAttributeChanged( const QVariant & ) ) );
1765+
connect( eww, static_cast<void ( QgsEditorWidgetWrapper::* )( const QVariant & )>( &QgsEditorWidgetWrapper::valueChanged ), this, &QgsAttributeForm::onAttributeChanged );
17661766
connect( eww, &QgsEditorWidgetWrapper::constraintStatusChanged, this, &QgsAttributeForm::onConstraintStatusChanged );
17671767
}
17681768
}

‎src/gui/qgsattributeformeditorwidget.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ QgsAttributeFormEditorWidget::QgsAttributeFormEditorWidget( QgsEditorWidgetWrapp
5555
mSearchPage->setLayout( l );
5656
l->addWidget( mSearchFrame, 1 );
5757
mSearchWidgetToolButton = new QgsSearchWidgetToolButton();
58-
connect( mSearchWidgetToolButton, SIGNAL( activeFlagsChanged( QgsSearchWidgetWrapper::FilterFlags ) ),
59-
this, SLOT( searchWidgetFlagsChanged( QgsSearchWidgetWrapper::FilterFlags ) ) );
58+
connect( mSearchWidgetToolButton, &QgsSearchWidgetToolButton::activeFlagsChanged,
59+
this, &QgsAttributeFormEditorWidget::searchWidgetFlagsChanged );
6060
l->addWidget( mSearchWidgetToolButton, 0 );
6161

6262

@@ -79,9 +79,9 @@ QgsAttributeFormEditorWidget::QgsAttributeFormEditorWidget( QgsEditorWidgetWrapp
7979
{
8080
mWidget->widget()->setObjectName( mWidget->field().name() );
8181
}
82-
connect( mWidget, SIGNAL( valueChanged( const QVariant & ) ), this, SLOT( editorWidgetChanged( const QVariant & ) ) );
83-
connect( mMultiEditButton, SIGNAL( resetFieldValueTriggered() ), this, SLOT( resetValue() ) );
84-
connect( mMultiEditButton, SIGNAL( setFieldValueTriggered() ), this, SLOT( setFieldTriggered() ) );
82+
connect( mWidget, static_cast<void ( QgsEditorWidgetWrapper::* )( const QVariant &value )>( &QgsEditorWidgetWrapper::valueChanged ), this, &QgsAttributeFormEditorWidget::editorWidgetChanged );
83+
connect( mMultiEditButton, &QgsMultiEditToolButton::resetFieldValueTriggered, this, &QgsAttributeFormEditorWidget::resetValue );
84+
connect( mMultiEditButton, &QgsMultiEditToolButton::setFieldValueTriggered, this, &QgsAttributeFormEditorWidget::setFieldTriggered );
8585

8686
mMultiEditButton->setField( mWidget->field() );
8787

@@ -119,8 +119,8 @@ void QgsAttributeFormEditorWidget::setSearchWidgetWrapper( QgsSearchWidgetWrappe
119119
mSearchWidgetToolButton->setAvailableFlags( wrapper->supportedFlags() );
120120
mSearchWidgetToolButton->setActiveFlags( QgsSearchWidgetWrapper::FilterFlags() );
121121
mSearchWidgetToolButton->setDefaultFlags( wrapper->defaultFlags() );
122-
connect( wrapper, SIGNAL( valueChanged() ), mSearchWidgetToolButton, SLOT( searchWidgetValueChanged() ) );
123-
connect( wrapper, SIGNAL( valueCleared() ), mSearchWidgetToolButton, SLOT( setInactive() ) );
122+
connect( wrapper, &QgsSearchWidgetWrapper::valueChanged, mSearchWidgetToolButton, &QgsSearchWidgetToolButton::setActive );
123+
connect( wrapper, &QgsSearchWidgetWrapper::valueCleared, mSearchWidgetToolButton, &QgsSearchWidgetToolButton::setInactive );
124124
}
125125

126126
QWidget *QgsAttributeFormEditorWidget::searchWidgetFrame()

‎src/gui/qgsattributetypeloaddialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ QgsAttributeTypeLoadDialog::QgsAttributeTypeLoadDialog( QgsVectorLayer *vl )
4141
{
4242
setupUi( this );
4343

44-
connect( layerComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( fillComboBoxes( int ) ) );
45-
connect( keyComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( createPreview( int ) ) );
46-
connect( valueComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( createPreview( int ) ) );
47-
connect( previewButton, SIGNAL( pressed() ), this, SLOT( previewButtonPushed() ) );
44+
connect( layerComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsAttributeTypeLoadDialog::fillComboBoxes );
45+
connect( keyComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [ = ]( int index ) { createPreview( index ); } );
46+
connect( valueComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [ = ]( int index ) { createPreview( index ); } );
47+
connect( previewButton, &QAbstractButton::pressed, this, &QgsAttributeTypeLoadDialog::previewButtonPushed );
4848

4949
fillLayerList();
5050

‎src/gui/qgscharacterselectdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ QgsCharacterSelectorDialog::QgsCharacterSelectorDialog( QWidget *parent, Qt::Win
2525
setupUi( this );
2626
mCharWidget = new CharacterWidget( this );
2727
mCharSelectScrollArea->setWidget( mCharWidget );
28-
connect( mCharWidget, SIGNAL( characterSelected( const QChar & ) ), this, SLOT( setCharacter( const QChar & ) ) );
28+
connect( mCharWidget, &CharacterWidget::characterSelected, this, &QgsCharacterSelectorDialog::setCharacter );
2929
}
3030

3131
const QChar &QgsCharacterSelectorDialog::selectCharacter( bool *gotChar, const QFont &font, const QString &style )

‎src/gui/qgscollapsiblegroupbox.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ void QgsCollapsibleGroupBoxBasic::init()
6969
setFocusProxy( mCollapseButton );
7070
setFocusPolicy( Qt::StrongFocus );
7171

72-
connect( mCollapseButton, SIGNAL( clicked() ), this, SLOT( toggleCollapsed() ) );
73-
connect( this, SIGNAL( toggled( bool ) ), this, SLOT( checkToggled( bool ) ) );
74-
connect( this, SIGNAL( clicked( bool ) ), this, SLOT( checkClicked( bool ) ) );
72+
connect( mCollapseButton, &QAbstractButton::clicked, this, &QgsCollapsibleGroupBoxBasic::toggleCollapsed );
73+
connect( this, &QGroupBox::toggled, this, &QgsCollapsibleGroupBoxBasic::checkToggled );
74+
connect( this, &QGroupBox::clicked, this, &QgsCollapsibleGroupBoxBasic::checkClicked );
7575
}
7676

7777
void QgsCollapsibleGroupBoxBasic::showEvent( QShowEvent *event )

‎src/gui/qgscolorbrewercolorrampdialog.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ QgsColorBrewerColorRampWidget::QgsColorBrewerColorRampWidget( const QgsColorBrew
5353
}
5454

5555
updateUi();
56-
connect( cboSchemeName, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setSchemeName() ) );
57-
connect( cboColors, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setColors() ) );
56+
connect( cboSchemeName, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsColorBrewerColorRampWidget::setSchemeName );
57+
connect( cboColors, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsColorBrewerColorRampWidget::setColors );
5858
}
5959

6060
void QgsColorBrewerColorRampWidget::setRamp( const QgsColorBrewerColorRamp &ramp )
@@ -125,9 +125,9 @@ QgsColorBrewerColorRampDialog::QgsColorBrewerColorRampDialog( const QgsColorBrew
125125
mWidget = new QgsColorBrewerColorRampWidget( ramp );
126126
vLayout->addWidget( mWidget );
127127
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
128-
connect( bbox, SIGNAL( accepted() ), this, SLOT( accept() ) );
129-
connect( bbox, SIGNAL( rejected() ), this, SLOT( reject() ) );
128+
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
129+
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
130130
vLayout->addWidget( bbox );
131131
setLayout( vLayout );
132-
connect( mWidget, SIGNAL( changed() ), this, SIGNAL( changed() ) );
132+
connect( mWidget, &QgsColorBrewerColorRampWidget::changed, this, &QgsColorBrewerColorRampDialog::changed );
133133
}

0 commit comments

Comments
 (0)
Please sign in to comment.