Skip to content

Commit

Permalink
Fix some no such signal/slot warnings
Browse files Browse the repository at this point in the history
... in such a way that they'll never appear again
  • Loading branch information
nyalldawson committed Nov 1, 2016
1 parent 5e4bb00 commit 4f8ee78
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
3 changes: 0 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -10245,9 +10245,6 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *>& theLayers )
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
if ( rlayer )
{
// connect up any request the raster may make to update the app progress
connect( rlayer, SIGNAL( drawingProgress( int, int ) ), this, SLOT( showProgress( int, int ) ) );

// connect up any request the raster may make to update the statusbar message
connect( rlayer, &QgsRasterLayer::statusChanged, this, &QgisApp::showStatusMessage );

Expand Down
51 changes: 25 additions & 26 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -75,9 +75,9 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
initPython();
setFeature( feature );

connect( vl, SIGNAL( updatedFields() ), this, SLOT( onUpdatedFields() ) );
connect( vl, SIGNAL( beforeAddingExpressionField( QString ) ), this, SLOT( preventFeatureRefresh() ) );
connect( vl, SIGNAL( beforeRemovingExpressionField( int ) ), this, SLOT( preventFeatureRefresh() ) );
connect( vl, &QgsVectorLayer::updatedFields, this, &QgsAttributeForm::onUpdatedFields );
connect( vl, &QgsVectorLayer::beforeAddingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
connect( vl, &QgsVectorLayer::beforeRemovingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );

// constraints management
Expand All @@ -96,20 +96,20 @@ void QgsAttributeForm::hideButtonBox()

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

void QgsAttributeForm::showButtonBox()
{
mButtonBox->show();

disconnect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
disconnect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
}

void QgsAttributeForm::disconnectButtonBox()
{
disconnect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
disconnect( mButtonBox, SIGNAL( rejected() ), this, SLOT( resetValues() ) );
disconnect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsAttributeForm::save );
disconnect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsAttributeForm::resetValues );
}

void QgsAttributeForm::addInterface( QgsAttributeFormInterface* iface )
Expand Down Expand Up @@ -148,11 +148,11 @@ void QgsAttributeForm::setMode( QgsAttributeForm::Mode mode )

if ( mButtonBox->isVisible() && mMode == SingleEditMode )
{
connect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
connect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
}
else
{
disconnect( mLayer, SIGNAL( beforeModifiedCheck() ), this, SLOT( save() ) );
disconnect( mLayer, &QgsVectorLayer::beforeModifiedCheck, this, &QgsAttributeForm::save );
}

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

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

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

QToolButton* selectButton = new QToolButton();
selectButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
selectButton->setText( tr( "&Select features" ) );
selectButton->setPopupMode( QToolButton::MenuButtonPopup );
connect( selectButton, SIGNAL( clicked( bool ) ), this, SLOT( searchSetSelection() ) );
connect( selectButton, &QToolButton::clicked, this, &QgsAttributeForm::searchSetSelection );
QMenu* selectMenu = new QMenu( selectButton );
QAction* selectAction = new QAction( tr( "Select features" ), selectMenu );
connect( selectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchSetSelection() ) );
connect( selectAction, &QAction::triggered, this, &QgsAttributeForm::searchSetSelection );
selectMenu->addAction( selectAction );
QAction* addSelectAction = new QAction( tr( "Add to current selection" ), selectMenu );
connect( addSelectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchAddToSelection() ) );
connect( addSelectAction, &QAction::triggered, this, &QgsAttributeForm::searchAddToSelection );
selectMenu->addAction( addSelectAction );
QAction* filterSelectAction = new QAction( tr( "Filter current selection" ), selectMenu );
connect( filterSelectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchIntersectSelection() ) );
connect( filterSelectAction, &QAction::triggered, this, &QgsAttributeForm::searchIntersectSelection );
selectMenu->addAction( filterSelectAction );
QAction* deselectAction = new QAction( tr( "Remove from current selection" ), selectMenu );
connect( deselectAction, SIGNAL( triggered( bool ) ), this, SLOT( searchRemoveFromSelection() ) );
connect( deselectAction, &QAction::triggered, this, &QgsAttributeForm::searchRemoveFromSelection );
selectMenu->addAction( deselectAction );
selectButton->setMenu( selectMenu );
boxLayout->addWidget( selectButton );
Expand All @@ -1345,21 +1345,21 @@ void QgsAttributeForm::init()
filterButton->setText( tr( "Filter features" ) );
filterButton->setPopupMode( QToolButton::MenuButtonPopup );
filterButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
connect( filterButton, SIGNAL( clicked( bool ) ), this, SLOT( filterTriggered() ) );
connect( filterButton, &QToolButton::clicked, this, &QgsAttributeForm::filterTriggered );
QMenu* filterMenu = new QMenu( filterButton );
QAction* filterAndAction = new QAction( tr( "Filter within (\"AND\")" ), filterMenu );
connect( filterAndAction, SIGNAL( triggered( bool ) ), this, SLOT( filterAndTriggered() ) );
connect( filterAndAction, &QAction::triggered, this, &QgsAttributeForm::filterAndTriggered );
filterMenu->addAction( filterAndAction );
QAction* filterOrAction = new QAction( tr( "Extend filter (\"OR\")" ), filterMenu );
connect( filterOrAction, SIGNAL( triggered( bool ) ), this, SLOT( filterOrTriggered() ) );
connect( filterOrAction, &QAction::triggered, this, &QgsAttributeForm::filterOrTriggered );
filterMenu->addAction( filterOrAction );
filterButton->setMenu( filterMenu );
boxLayout->addWidget( filterButton );
}
else
{
QPushButton* closeButton = new QPushButton( tr( "Close" ), mSearchButtonBox );
connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( closed() ) );
connect( closeButton, &QPushButton::clicked, this, &QgsAttributeForm::closed );
closeButton->setShortcut( Qt::Key_Escape );
boxLayout->addWidget( closeButton );
}
Expand All @@ -1370,11 +1370,11 @@ void QgsAttributeForm::init()

afterWidgetInit();

connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( resetValues() ) );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsAttributeForm::save );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsAttributeForm::resetValues );

connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( synchronizeEnabledState() ) );
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( synchronizeEnabledState() ) );
connect( mLayer, &QgsVectorLayer::editingStarted, this, &QgsAttributeForm::synchronizeEnabledState );
connect( mLayer, &QgsVectorLayer::editingStopped, this, &QgsAttributeForm::synchronizeEnabledState );

Q_FOREACH ( QgsAttributeFormInterface* iface, mInterfaces )
{
Expand Down Expand Up @@ -1750,8 +1750,7 @@ void QgsAttributeForm::afterWidgetInit()
}

connect( eww, SIGNAL( valueChanged( const QVariant& ) ), this, SLOT( onAttributeChanged( const QVariant& ) ) );
connect( eww, SIGNAL( constraintStatusChanged( QString, QString, QString, bool ) ),
this, SLOT( onConstraintStatusChanged( QString, QString, QString, bool ) ) );
connect( eww, &QgsEditorWidgetWrapper::constraintStatusChanged, this, &QgsAttributeForm::onConstraintStatusChanged );
}
}

Expand Down

0 comments on commit 4f8ee78

Please sign in to comment.