Skip to content

Commit 4f8ee78

Browse files
committedNov 1, 2016
Fix some no such signal/slot warnings
... in such a way that they'll never appear again
1 parent 5e4bb00 commit 4f8ee78

File tree

2 files changed

+25
-29
lines changed

2 files changed

+25
-29
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10245,9 +10245,6 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *>& theLayers )
1024510245
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
1024610246
if ( rlayer )
1024710247
{
10248-
// connect up any request the raster may make to update the app progress
10249-
connect( rlayer, SIGNAL( drawingProgress( int, int ) ), this, SLOT( showProgress( int, int ) ) );
10250-
1025110248
// connect up any request the raster may make to update the statusbar message
1025210249
connect( rlayer, &QgsRasterLayer::statusChanged, this, &QgisApp::showStatusMessage );
1025310250

‎src/gui/qgsattributeform.cpp

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
7575
initPython();
7676
setFeature( feature );
7777

78-
connect( vl, SIGNAL( updatedFields() ), this, SLOT( onUpdatedFields() ) );
79-
connect( vl, SIGNAL( beforeAddingExpressionField( QString ) ), this, SLOT( preventFeatureRefresh() ) );
80-
connect( vl, SIGNAL( beforeRemovingExpressionField( int ) ), this, SLOT( preventFeatureRefresh() ) );
78+
connect( vl, &QgsVectorLayer::updatedFields, this, &QgsAttributeForm::onUpdatedFields );
79+
connect( vl, &QgsVectorLayer::beforeAddingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
80+
connect( vl, &QgsVectorLayer::beforeRemovingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
8181
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
8282

8383
// constraints management
@@ -96,20 +96,20 @@ void QgsAttributeForm::hideButtonBox()
9696

9797
// Make sure that changes are taken into account if somebody tries to figure out if there have been some
9898
if ( mMode == SingleEditMode )
99-
connect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
99+
connect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
100100
}
101101

102102
void QgsAttributeForm::showButtonBox()
103103
{
104104
mButtonBox->show();
105105

106-
disconnect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
106+
disconnect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
107107
}
108108

109109
void QgsAttributeForm::disconnectButtonBox()
110110
{
111-
disconnect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
112-
disconnect( mButtonBox, SIGNAL( rejected() ), this, SLOT( resetValues() ) );
111+
disconnect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsAttributeForm::save );
112+
disconnect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsAttributeForm::resetValues );
113113
}
114114

115115
void QgsAttributeForm::addInterface( QgsAttributeFormInterface* iface )
@@ -148,11 +148,11 @@ void QgsAttributeForm::setMode( QgsAttributeForm::Mode mode )
148148

149149
if ( mButtonBox->isVisible() && mMode == SingleEditMode )
150150
{
151-
connect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
151+
connect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
152152
}
153153
else
154154
{
155-
disconnect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
155+
disconnect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
156156
}
157157

158158
//update all form editor widget modes to match
@@ -660,7 +660,7 @@ void QgsAttributeForm::onAttributeChanged( const QVariant& value )
660660
QLabel *msgLabel = new QLabel( tr( "Unsaved multiedit changes: <a href=\"#apply\">apply changes</a> or <a href=\"#reset\">reset changes</a>." ), mMessageBar );
661661
msgLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
662662
msgLabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
663-
connect( msgLabel, SIGNAL( linkActivated( QString ) ), this, SLOT( multiEditMessageClicked( QString ) ) );
663+
connect( msgLabel, &QLabel::linkActivated, this, &QgsAttributeForm::multiEditMessageClicked );
664664
clearMultiEditMessages();
665665

666666
mMultiEditUnsavedMessageBarItem = new QgsMessageBarItem( msgLabel, QgsMessageBar::WARNING );
@@ -1314,27 +1314,27 @@ void QgsAttributeForm::init()
13141314
mSearchButtonBox->setObjectName( QStringLiteral( "searchButtonBox" ) );
13151315

13161316
QPushButton* clearButton = new QPushButton( tr( "&Reset form" ), mSearchButtonBox );
1317-
connect( clearButton, SIGNAL( clicked( bool ) ), this, SLOT( resetSearch() ) );
1317+
connect( clearButton, &QPushButton::clicked, this, &QgsAttributeForm::resetSearch );
13181318
boxLayout->addWidget( clearButton );
13191319
boxLayout->addStretch( 1 );
13201320

13211321
QToolButton* selectButton = new QToolButton();
13221322
selectButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
13231323
selectButton->setText( tr( "&Select features" ) );
13241324
selectButton->setPopupMode( QToolButton::MenuButtonPopup );
1325-
connect( selectButton, SIGNAL( clicked( bool ) ), this, SLOT( searchSetSelection() ) );
1325+
connect( selectButton, &QToolButton::clicked, this, &QgsAttributeForm::searchSetSelection );
13261326
QMenu* selectMenu = new QMenu( selectButton );
13271327
QAction* selectAction = new QAction( tr( "Select features" ), selectMenu );
1328-
connect( selectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchSetSelection() ) );
1328+
connect( selectAction, &QAction::triggered, this, &QgsAttributeForm::searchSetSelection );
13291329
selectMenu->addAction( selectAction );
13301330
QAction* addSelectAction = new QAction( tr( "Add to current selection" ), selectMenu );
1331-
connect( addSelectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchAddToSelection() ) );
1331+
connect( addSelectAction, &QAction::triggered, this, &QgsAttributeForm::searchAddToSelection );
13321332
selectMenu->addAction( addSelectAction );
13331333
QAction* filterSelectAction = new QAction( tr( "Filter current selection" ), selectMenu );
1334-
connect( filterSelectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchIntersectSelection() ) );
1334+
connect( filterSelectAction, &QAction::triggered, this, &QgsAttributeForm::searchIntersectSelection );
13351335
selectMenu->addAction( filterSelectAction );
13361336
QAction* deselectAction = new QAction( tr( "Remove from current selection" ), selectMenu );
1337-
connect( deselectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchRemoveFromSelection() ) );
1337+
connect( deselectAction, &QAction::triggered, this, &QgsAttributeForm::searchRemoveFromSelection );
13381338
selectMenu->addAction( deselectAction );
13391339
selectButton->setMenu( selectMenu );
13401340
boxLayout->addWidget( selectButton );
@@ -1345,21 +1345,21 @@ void QgsAttributeForm::init()
13451345
filterButton->setText( tr( "Filter features" ) );
13461346
filterButton->setPopupMode( QToolButton::MenuButtonPopup );
13471347
filterButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
1348-
connect( filterButton, SIGNAL( clicked( bool ) ), this, SLOT( filterTriggered() ) );
1348+
connect( filterButton, &QToolButton::clicked, this, &QgsAttributeForm::filterTriggered );
13491349
QMenu* filterMenu = new QMenu( filterButton );
13501350
QAction* filterAndAction = new QAction( tr( "Filter within (\"AND\")" ), filterMenu );
1351-
connect( filterAndAction, SIGNAL( triggered( bool ) ), this, SLOT( filterAndTriggered() ) );
1351+
connect( filterAndAction, &QAction::triggered, this, &QgsAttributeForm::filterAndTriggered );
13521352
filterMenu->addAction( filterAndAction );
13531353
QAction* filterOrAction = new QAction( tr( "Extend filter (\"OR\")" ), filterMenu );
1354-
connect( filterOrAction, SIGNAL( triggered( bool ) ), this, SLOT( filterOrTriggered() ) );
1354+
connect( filterOrAction, &QAction::triggered, this, &QgsAttributeForm::filterOrTriggered );
13551355
filterMenu->addAction( filterOrAction );
13561356
filterButton->setMenu( filterMenu );
13571357
boxLayout->addWidget( filterButton );
13581358
}
13591359
else
13601360
{
13611361
QPushButton* closeButton = new QPushButton( tr( "Close" ), mSearchButtonBox );
1362-
connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( closed() ) );
1362+
connect( closeButton, &QPushButton::clicked, this, &QgsAttributeForm::closed );
13631363
closeButton->setShortcut( Qt::Key_Escape );
13641364
boxLayout->addWidget( closeButton );
13651365
}
@@ -1370,11 +1370,11 @@ void QgsAttributeForm::init()
13701370

13711371
afterWidgetInit();
13721372

1373-
connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
1374-
connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( resetValues() ) );
1373+
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsAttributeForm::save );
1374+
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsAttributeForm::resetValues );
13751375

1376-
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( synchronizeEnabledState() ) );
1377-
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( synchronizeEnabledState() ) );
1376+
connect( mLayer, &QgsVectorLayer::editingStarted, this, &QgsAttributeForm::synchronizeEnabledState );
1377+
connect( mLayer, &QgsVectorLayer::editingStopped, this, &QgsAttributeForm::synchronizeEnabledState );
13781378

13791379
Q_FOREACH ( QgsAttributeFormInterface* iface, mInterfaces )
13801380
{
@@ -1750,8 +1750,7 @@ void QgsAttributeForm::afterWidgetInit()
17501750
}
17511751

17521752
connect( eww, SIGNAL( valueChanged( const QVariant& ) ), this, SLOT( onAttributeChanged( const QVariant& ) ) );
1753-
connect( eww, SIGNAL( constraintStatusChanged( QString, QString, QString, bool ) ),
1754-
this, SLOT( onConstraintStatusChanged( QString, QString, QString, bool ) ) );
1753+
connect( eww, &QgsEditorWidgetWrapper::constraintStatusChanged, this, &QgsAttributeForm::onConstraintStatusChanged );
17551754
}
17561755
}
17571756

0 commit comments

Comments
 (0)
Please sign in to comment.