More Qt5 style connect conversions

This commit is contained in:
Nyall Dawson 2017-03-28 09:18:59 +10:00
parent 4d8df75098
commit 943d1a2ca5
34 changed files with 189 additions and 183 deletions

View File

@ -798,6 +798,12 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void renameView(); void renameView();
void showProgress( int progress, int totalSteps );
void showStatusMessage( const QString &message );
//! set the active layer
bool setActiveLayer( QgsMapLayer * );
protected: protected:
//! Handle state changes (WindowTitleChange) //! Handle state changes (WindowTitleChange)
@ -1118,8 +1124,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void showSelectedLayers(); void showSelectedLayers();
//! Return pointer to the active layer //! Return pointer to the active layer
QgsMapLayer *activeLayer(); QgsMapLayer *activeLayer();
//! set the active layer
bool setActiveLayer( QgsMapLayer * );
//! Open the help contents in a browser //! Open the help contents in a browser
void helpContents(); void helpContents();
//! Open the API documentation in a browser //! Open the API documentation in a browser
@ -1263,10 +1267,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void selectionChanged( QgsMapLayer *layer ); void selectionChanged( QgsMapLayer *layer );
void showProgress( int progress, int totalSteps );
void extentChanged(); void extentChanged();
void showRotation(); void showRotation();
void showStatusMessage( const QString &message );
void displayMapToolMessage( const QString &message, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO ); void displayMapToolMessage( const QString &message, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO );
void displayMessage( const QString &title, const QString &message, QgsMessageBar::MessageLevel level ); void displayMessage( const QString &title, const QString &message, QgsMessageBar::MessageLevel level );
void removeMapToolMessage(); void removeMapToolMessage();

View File

@ -56,13 +56,13 @@ QgsBookmarks::QgsBookmarks( QWidget *parent )
QAction *btnImport = share->addAction( tr( "&Import" ) ); QAction *btnImport = share->addAction( tr( "&Import" ) );
btnExport->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ) ); btnExport->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ) );
btnImport->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ) ); btnImport->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ) );
connect( btnExport, SIGNAL( triggered() ), this, SLOT( exportToXml() ) ); connect( btnExport, &QAction::triggered, this, &QgsBookmarks::exportToXml );
connect( btnImport, SIGNAL( triggered() ), this, SLOT( importFromXml() ) ); connect( btnImport, &QAction::triggered, this, &QgsBookmarks::importFromXml );
btnImpExp->setMenu( share ); btnImpExp->setMenu( share );
connect( actionAdd, SIGNAL( triggered() ), this, SLOT( addClicked() ) ); connect( actionAdd, &QAction::triggered, this, &QgsBookmarks::addClicked );
connect( actionDelete, SIGNAL( triggered() ), this, SLOT( deleteClicked() ) ); connect( actionDelete, &QAction::triggered, this, &QgsBookmarks::deleteClicked );
connect( actionZoomTo, SIGNAL( triggered() ), this, SLOT( zoomToBookmark() ) ); connect( actionZoomTo, &QAction::triggered, this, &QgsBookmarks::zoomToBookmark );
mBookmarkToolbar->addWidget( btnImpExp ); mBookmarkToolbar->addWidget( btnImpExp );
@ -394,9 +394,9 @@ void QgsBookmarks::exportToXml()
QgsProjectBookmarksTableModel::QgsProjectBookmarksTableModel() QgsProjectBookmarksTableModel::QgsProjectBookmarksTableModel()
{ {
QObject::connect( connect(
QgisApp::instance(), SIGNAL( projectRead() ), QgisApp::instance(), &QgisApp::projectRead,
this, SLOT( projectRead() ) ); this, &QgsProjectBookmarksTableModel::projectRead );
} }
int QgsProjectBookmarksTableModel::rowCount( const QModelIndex &parent ) const int QgsProjectBookmarksTableModel::rowCount( const QModelIndex &parent ) const
@ -507,25 +507,25 @@ QgsMergedBookmarksTableModel::QgsMergedBookmarksTableModel( QAbstractTableModel
, mProjectOpen( false ) , mProjectOpen( false )
{ {
connect( connect(
QgisApp::instance(), SIGNAL( projectRead() ), QgisApp::instance(), &QgisApp::projectRead,
this, SLOT( projectRead() ) ); this, &QgsMergedBookmarksTableModel::projectRead );
connect( connect(
&mQgisTableModel, SIGNAL( layoutChanged() ), &mQgisTableModel, &QAbstractTableModel::layoutChanged,
this, SLOT( allLayoutChanged() ) ); this, &QgsMergedBookmarksTableModel::allLayoutChanged );
connect( connect(
&mQgisTableModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ), &mQgisTableModel, &QAbstractTableModel::dataChanged,
this, SLOT( qgisDataChanged( const QModelIndex &, const QModelIndex & ) ) ); this, &QgsMergedBookmarksTableModel::qgisDataChanged );
connect( connect(
&mQgisTableModel, SIGNAL( rowsInserted( const QModelIndex &, int, int ) ), &mQgisTableModel, &QAbstractTableModel::rowsInserted,
this, SLOT( allLayoutChanged() ) ); this, &QgsMergedBookmarksTableModel::allLayoutChanged );
connect( connect(
&mQgisTableModel, SIGNAL( rowsRemoved( const QModelIndex &, int, int ) ), &mQgisTableModel, &QAbstractTableModel::rowsRemoved,
this, SLOT( allLayoutChanged() ) ); this, &QgsMergedBookmarksTableModel::allLayoutChanged );
connect( connect(
&projectTableModel, SIGNAL( layoutChanged() ), &projectTableModel, &QAbstractTableModel::layoutChanged,
this, SLOT( allLayoutChanged() ) ); this, &QgsMergedBookmarksTableModel::allLayoutChanged );
} }
int QgsMergedBookmarksTableModel::rowCount( const QModelIndex &parent ) const int QgsMergedBookmarksTableModel::rowCount( const QModelIndex &parent ) const

View File

@ -84,8 +84,8 @@ class QgsMergedBookmarksTableModel: public QAbstractTableModel
void moveBookmark( QAbstractTableModel &modelFrom, QAbstractTableModel &modelTo, int row ); void moveBookmark( QAbstractTableModel &modelFrom, QAbstractTableModel &modelTo, int row );
private slots: private slots:
void projectRead() { mProjectOpen = true; }; void projectRead() { mProjectOpen = true; }
void allLayoutChanged() { emit layoutChanged(); }; void allLayoutChanged() { emit layoutChanged(); }
void qgisDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight ) void qgisDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight )
{ {
emit dataChanged( topLeft, bottomRight ); emit dataChanged( topLeft, bottomRight );

View File

@ -43,7 +43,7 @@ QgsClipboard::QgsClipboard()
, mFeatureFields() , mFeatureFields()
, mUseSystemClipboard( false ) , mUseSystemClipboard( false )
{ {
connect( QApplication::clipboard(), SIGNAL( dataChanged() ), this, SLOT( systemClipboardChanged() ) ); connect( QApplication::clipboard(), &QClipboard::dataChanged, this, &QgsClipboard::systemClipboardChanged );
} }
QgsClipboard::~QgsClipboard() QgsClipboard::~QgsClipboard()

View File

@ -57,10 +57,10 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se
mLastDirSettingsName = QStringLiteral( "/UI/lastCustomizationDir" ); mLastDirSettingsName = QStringLiteral( "/UI/lastCustomizationDir" );
//treeWidget->hideColumn(0) //treeWidget->hideColumn(0)
connect( buttonBox->button( QDialogButtonBox::Ok ), SIGNAL( clicked() ), this, SLOT( ok() ) ); connect( buttonBox->button( QDialogButtonBox::Ok ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::ok );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::apply );
connect( buttonBox->button( QDialogButtonBox::Cancel ), SIGNAL( clicked() ), this, SLOT( cancel() ) ); connect( buttonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::cancel );
connect( buttonBox->button( QDialogButtonBox::Reset ), SIGNAL( clicked() ), this, SLOT( reset() ) ); connect( buttonBox->button( QDialogButtonBox::Reset ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::reset );
} }

View File

@ -33,7 +33,7 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationCopyright/geometry" ) ).toByteArray() ); restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationCopyright/geometry" ) ).toByteArray() );
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply ); QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationCopyrightDialog::apply );
grpEnable->setChecked( mDeco.enabled() ); grpEnable->setChecked( mDeco.enabled() );
// text // text

View File

@ -61,7 +61,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
updateGuiElements(); updateGuiElements();
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsDecorationGridDialog::apply );
} }

View File

@ -31,7 +31,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationNorthArrow/geometry" ) ).toByteArray() ); restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationNorthArrow/geometry" ) ).toByteArray() );
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply ); QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationNorthArrowDialog::apply );
// rotation // rotation
rotatePixmap( mDeco.mRotationInt ); rotatePixmap( mDeco.mRotationInt );

View File

@ -30,7 +30,7 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationScaleBar/geometry" ) ).toByteArray() ); restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationScaleBar/geometry" ) ).toByteArray() );
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply ); QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationScaleBarDialog::apply );
// set the map units in the spin box // set the map units in the spin box
spnSize->setShowClearButton( false ); spnSize->setShowClearButton( false );

View File

@ -440,10 +440,10 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
mTreeView->resizeColumnToContents( 0 ); mTreeView->resizeColumnToContents( 0 );
mTreeView->header()->show(); mTreeView->header()->show();
connect( mFileLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setOkEnabled() ) ); connect( mFileLineEdit, &QLineEdit::textChanged, this, &QgsDxfExportDialog::setOkEnabled );
connect( this, SIGNAL( accepted() ), this, SLOT( saveSettings() ) ); connect( this, &QDialog::accepted, this, &QgsDxfExportDialog::saveSettings );
connect( mSelectAllButton, SIGNAL( clicked() ), this, SLOT( selectAll() ) ); connect( mSelectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::selectAll );
connect( mDeselectAllButton, SIGNAL( clicked() ), this, SLOT( deSelectAll() ) ); connect( mDeselectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deSelectAll );
mFileLineEdit->setFocus(); mFileLineEdit->setFocus();

View File

@ -84,11 +84,11 @@ QgsAttributeDialog *QgsFeatureAction::newDialog( bool cloneFeature )
QgsFeature &feat = const_cast<QgsFeature &>( *dialog->feature() ); QgsFeature &feat = const_cast<QgsFeature &>( *dialog->feature() );
QgsFeatureAction *a = new QgsFeatureAction( action.name(), feat, mLayer, action.id(), -1, dialog ); QgsFeatureAction *a = new QgsFeatureAction( action.name(), feat, mLayer, action.id(), -1, dialog );
dialog->addAction( a ); dialog->addAction( a );
connect( a, SIGNAL( triggered() ), a, SLOT( execute() ) ); connect( a, &QAction::triggered, a, &QgsFeatureAction::execute );
QAbstractButton *pb = dialog->findChild<QAbstractButton *>( action.name() ); QAbstractButton *pb = dialog->findChild<QAbstractButton *>( action.name() );
if ( pb ) if ( pb )
connect( pb, SIGNAL( clicked() ), a, SLOT( execute() ) ); connect( pb, &QAbstractButton::clicked, a, &QgsFeatureAction::execute );
} }
} }
@ -207,7 +207,7 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap &defaultAttributes, boo
dialog->setMode( QgsAttributeForm::AddFeatureMode ); dialog->setMode( QgsAttributeForm::AddFeatureMode );
dialog->setEditCommandMessage( text() ); dialog->setEditCommandMessage( text() );
connect( dialog->attributeForm(), SIGNAL( featureSaved( const QgsFeature & ) ), this, SLOT( onFeatureSaved( const QgsFeature & ) ) ); connect( dialog->attributeForm(), &QgsAttributeForm::featureSaved, this, &QgsFeatureAction::onFeatureSaved );
if ( !showModal ) if ( !showModal )
{ {

View File

@ -51,8 +51,8 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer *vl, QWidget *parent )
populateFields(); populateFields();
populateOutputFieldTypes(); populateOutputFieldTypes();
connect( builder, SIGNAL( expressionParsed( bool ) ), this, SLOT( setOkButtonState() ) ); connect( builder, &QgsExpressionBuilderWidget::expressionParsed, this, &QgsFieldCalculator::setOkButtonState );
connect( mOutputFieldWidthSpinBox, SIGNAL( editingFinished() ), this, SLOT( setPrecisionMinMax() ) ); connect( mOutputFieldWidthSpinBox, &QAbstractSpinBox::editingFinished, this, &QgsFieldCalculator::setPrecisionMinMax );
QgsDistanceArea myDa; QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs() ); myDa.setSourceCrs( vl->crs() );

View File

@ -63,11 +63,11 @@ QgsFieldsProperties::QgsFieldsProperties( QgsVectorLayer *layer, QWidget *parent
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionToggleEditing.svg" ) ) ); mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionToggleEditing.svg" ) ) );
mCalculateFieldButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCalculateField.svg" ) ) ); mCalculateFieldButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCalculateField.svg" ) ) );
connect( mToggleEditingButton, SIGNAL( clicked() ), this, SIGNAL( toggleEditing() ) ); connect( mToggleEditingButton, &QAbstractButton::clicked, this, &QgsFieldsProperties::toggleEditing );
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); connect( mLayer, &QgsVectorLayer::editingStarted, this, &QgsFieldsProperties::editingToggled );
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); connect( mLayer, &QgsVectorLayer::editingStopped, this, &QgsFieldsProperties::editingToggled );
connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) ); connect( mLayer, &QgsVectorLayer::attributeAdded, this, &QgsFieldsProperties::attributeAdded );
connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) ); connect( mLayer, &QgsVectorLayer::attributeDeleted, this, &QgsFieldsProperties::attributeDeleted );
// tab and group display // tab and group display
mAddItemButton->setEnabled( false ); mAddItemButton->setEnabled( false );
@ -100,8 +100,8 @@ QgsFieldsProperties::QgsFieldsProperties( QgsVectorLayer *layer, QWidget *parent
mFieldsList->setSelectionMode( QAbstractItemView::ExtendedSelection ); mFieldsList->setSelectionMode( QAbstractItemView::ExtendedSelection );
mFieldsList->verticalHeader()->hide(); mFieldsList->verticalHeader()->hide();
connect( mDesignerTree, SIGNAL( itemSelectionChanged() ), this, SLOT( onAttributeSelectionChanged() ) ); connect( mDesignerTree, &QTreeWidget::itemSelectionChanged, this, &QgsFieldsProperties::onAttributeSelectionChanged );
connect( mFieldsList, SIGNAL( itemSelectionChanged() ), this, SLOT( onAttributeSelectionChanged() ) ); connect( mFieldsList, &QTableWidget::itemSelectionChanged, this, &QgsFieldsProperties::onAttributeSelectionChanged );
mRelationsList = new DragList( mRelationsFrame ); mRelationsList = new DragList( mRelationsFrame );
mRelationsFrameLayout->addWidget( mRelationsList ); mRelationsFrameLayout->addWidget( mRelationsList );
@ -262,7 +262,7 @@ void QgsFieldsProperties::loadAttributeEditorTree()
void QgsFieldsProperties::loadRows() void QgsFieldsProperties::loadRows()
{ {
disconnect( mFieldsList, SIGNAL( cellChanged( int, int ) ), this, SLOT( attributesListCellChanged( int, int ) ) ); disconnect( mFieldsList, &QTableWidget::cellChanged, this, &QgsFieldsProperties::attributesListCellChanged );
const QgsFields &fields = mLayer->fields(); const QgsFields &fields = mLayer->fields();
mIndexedWidgets.clear(); mIndexedWidgets.clear();
@ -272,7 +272,7 @@ void QgsFieldsProperties::loadRows()
attributeAdded( i ); attributeAdded( i );
mFieldsList->resizeColumnsToContents(); mFieldsList->resizeColumnsToContents();
connect( mFieldsList, SIGNAL( cellChanged( int, int ) ), this, SLOT( attributesListCellChanged( int, int ) ) ); connect( mFieldsList, &QTableWidget::cellChanged, this, &QgsFieldsProperties::attributesListCellChanged );
updateFieldRenamingStatus(); updateFieldRenamingStatus();
} }
@ -310,7 +310,7 @@ void QgsFieldsProperties::setRow( int row, int idx, const QgsField &field )
QToolButton *editExpressionButton = new QToolButton; QToolButton *editExpressionButton = new QToolButton;
editExpressionButton->setProperty( "Index", idx ); editExpressionButton->setProperty( "Index", idx );
editExpressionButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconExpression.svg" ) ) ); editExpressionButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconExpression.svg" ) ) );
connect( editExpressionButton, SIGNAL( clicked() ), this, SLOT( updateExpression() ) ); connect( editExpressionButton, &QAbstractButton::clicked, this, &QgsFieldsProperties::updateExpression );
expressionWidget->layout()->setContentsMargins( 0, 0, 0, 0 ); expressionWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
expressionWidget->layout()->addWidget( editExpressionButton ); expressionWidget->layout()->addWidget( editExpressionButton );
expressionWidget->layout()->addWidget( new QLabel( mLayer->expressionField( idx ) ) ); expressionWidget->layout()->addWidget( new QLabel( mLayer->expressionField( idx ) ) );
@ -343,7 +343,7 @@ void QgsFieldsProperties::setRow( int row, int idx, const QgsField &field )
cfg.mButton = pb; cfg.mButton = pb;
mFieldsList->setCellWidget( row, AttrEditTypeCol, pb ); mFieldsList->setCellWidget( row, AttrEditTypeCol, pb );
connect( pb, SIGNAL( pressed() ), this, SLOT( attributeTypeDialog() ) ); connect( pb, &QAbstractButton::pressed, this, &QgsFieldsProperties::attributeTypeDialog );
setConfigForRow( row, cfg ); setConfigForRow( row, cfg );
@ -1167,7 +1167,7 @@ DesignerTree::DesignerTree( QgsVectorLayer *layer, QWidget *parent )
: QTreeWidget( parent ) : QTreeWidget( parent )
, mLayer( layer ) , mLayer( layer )
{ {
connect( this, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), this, SLOT( onItemDoubleClicked( QTreeWidgetItem *, int ) ) ); connect( this, &QTreeWidget::itemDoubleClicked, this, &DesignerTree::onItemDoubleClicked );
} }
QTreeWidgetItem *DesignerTree::addItem( QTreeWidgetItem *parent, QgsFieldsProperties::DesignerTreeItemData data ) QTreeWidgetItem *DesignerTree::addItem( QTreeWidgetItem *parent, QgsFieldsProperties::DesignerTreeItemData data )
@ -1370,8 +1370,8 @@ void DesignerTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok
| QDialogButtonBox::Cancel ); | QDialogButtonBox::Cancel );
connect( buttonBox, SIGNAL( accepted() ), &dlg, SLOT( accept() ) ); connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, SIGNAL( rejected() ), &dlg, SLOT( reject() ) ); connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
layout->addWidget( buttonBox ); layout->addWidget( buttonBox );
@ -1408,8 +1408,8 @@ void DesignerTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel ); QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
connect( buttonBox, SIGNAL( accepted() ), &dlg, SLOT( accept() ) ); connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, SIGNAL( rejected() ), &dlg, SLOT( reject() ) ); connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
dlg.layout()->addWidget( buttonBox ); dlg.layout()->addWidget( buttonBox );
@ -1434,8 +1434,8 @@ void DesignerTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok
| QDialogButtonBox::Cancel ); | QDialogButtonBox::Cancel );
connect( buttonBox, SIGNAL( accepted() ), &dlg, SLOT( accept() ) ); connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, SIGNAL( rejected() ), &dlg, SLOT( reject() ) ); connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
dlg.layout()->addWidget( buttonBox ); dlg.layout()->addWidget( buttonBox );

View File

@ -178,8 +178,8 @@ void QgsGuiVectorLayerTools::commitError( QgsVectorLayer *vlayer ) const
showMore->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ); showMore->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
showMore->addAction( act ); showMore->addAction( act );
showMore->setDefaultAction( act ); showMore->setDefaultAction( act );
connect( showMore, SIGNAL( triggered( QAction * ) ), mv, SLOT( exec() ) ); connect( showMore, &QToolButton::triggered, mv, &QDialog::exec );
connect( showMore, SIGNAL( triggered( QAction * ) ), showMore, SLOT( deleteLater() ) ); connect( showMore, &QToolButton::triggered, showMore, &QObject::deleteLater );
// no timeout set, since notice needs attention and is only shown first time layer is labeled // no timeout set, since notice needs attention and is only shown first time layer is labeled
QgsMessageBarItem *errorMsg = new QgsMessageBarItem( QgsMessageBarItem *errorMsg = new QgsMessageBarItem(

View File

@ -72,9 +72,9 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers )
buttonBox->addButton( mBrowseButton, QDialogButtonBox::ActionRole ); buttonBox->addButton( mBrowseButton, QDialogButtonBox::ActionRole );
mBrowseButton->setDisabled( true ); mBrowseButton->setDisabled( true );
connect( mLayerList, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) ); connect( mLayerList, &QTableWidget::itemSelectionChanged, this, &QgsHandleBadLayers::selectionChanged );
connect( mBrowseButton, SIGNAL( clicked() ), this, SLOT( browseClicked() ) ); connect( mBrowseButton, &QAbstractButton::clicked, this, &QgsHandleBadLayers::browseClicked );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsHandleBadLayers::apply );
mLayerList->clear(); mLayerList->clear();
mLayerList->setSortingEnabled( true ); mLayerList->setSortingEnabled( true );
@ -133,7 +133,7 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers )
btn->setMinimumHeight( 24 ); btn->setMinimumHeight( 24 );
btn->setText( tr( "Edit" ) ); btn->setText( tr( "Edit" ) );
btn->setProperty( "row", j ); btn->setProperty( "row", j );
connect( btn, SIGNAL( clicked() ), this, SLOT( editAuthCfg() ) ); connect( btn, &QAbstractButton::clicked, this, &QgsHandleBadLayers::editAuthCfg );
mLayerList->setCellWidget( j, 3, btn ); mLayerList->setCellWidget( j, 3, btn );
} }
else else

View File

@ -89,8 +89,8 @@ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QgsWeb
#ifdef QGISDEBUG #ifdef QGISDEBUG
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true ); settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif #endif
connect( page(), SIGNAL( downloadRequested( QNetworkRequest ) ), this, SLOT( downloadRequested( QNetworkRequest ) ) ); connect( page(), &QWebPage::downloadRequested, this, &QgsIdentifyResultsWebView::downloadRequested );
connect( page(), SIGNAL( unsupportedContent( QNetworkReply * ) ), this, SLOT( unsupportedContent( QNetworkReply * ) ) ); connect( page(), &QWebPage::unsupportedContent, this, &QgsIdentifyResultsWebView::unsupportedContent );
} }
@ -153,7 +153,7 @@ void QgsIdentifyResultsWebView::contextMenuEvent( QContextMenuEvent *e )
return; return;
QAction *action = new QAction( tr( "Print" ), this ); QAction *action = new QAction( tr( "Print" ), this );
connect( action, SIGNAL( triggered() ), this, SLOT( print() ) ); connect( action, &QAction::triggered, this, &QgsIdentifyResultsWebView::print );
menu->addAction( action ); menu->addAction( action );
menu->exec( e->globalPos() ); menu->exec( e->globalPos() );
delete menu; delete menu;
@ -272,7 +272,7 @@ QgsIdentifyResultsWebViewItem::QgsIdentifyResultsWebViewItem( QTreeWidget *treeW
mWebView = new QgsIdentifyResultsWebView( treeWidget ); mWebView = new QgsIdentifyResultsWebView( treeWidget );
mWebView->hide(); mWebView->hide();
setText( 0, tr( "Loading..." ) ); setText( 0, tr( "Loading..." ) );
connect( mWebView->page(), SIGNAL( loadFinished( bool ) ), this, SLOT( loadFinished( bool ) ) ); connect( mWebView->page(), &QWebPage::loadFinished, this, &QgsIdentifyResultsWebViewItem::loadFinished );
} }
void QgsIdentifyResultsWebViewItem::loadFinished( bool ok ) void QgsIdentifyResultsWebViewItem::loadFinished( bool ok )
@ -285,7 +285,7 @@ void QgsIdentifyResultsWebViewItem::loadFinished( bool ok )
// Span columns to save some space, must be after setItemWidget() to take effect. // Span columns to save some space, must be after setItemWidget() to take effect.
setFirstColumnSpanned( true ); setFirstColumnSpanned( true );
disconnect( mWebView->page(), SIGNAL( loadFinished( bool ) ), this, SLOT( loadFinished( bool ) ) ); disconnect( mWebView->page(), &QWebPage::loadFinished, this, &QgsIdentifyResultsWebViewItem::loadFinished );
} }
@ -389,19 +389,19 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
mPlot->setSizePolicy( sizePolicy ); mPlot->setSizePolicy( sizePolicy );
mPlot->updateGeometry(); mPlot->updateGeometry();
connect( lstResults, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), connect( lstResults, &QTreeWidget::itemExpanded,
this, SLOT( itemExpanded( QTreeWidgetItem * ) ) ); this, &QgsIdentifyResultsDialog::itemExpanded );
connect( lstResults, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ), connect( lstResults, &QTreeWidget::currentItemChanged,
this, SLOT( handleCurrentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ) ); this, &QgsIdentifyResultsDialog::handleCurrentItemChanged );
connect( lstResults, SIGNAL( itemClicked( QTreeWidgetItem *, int ) ), connect( lstResults, &QTreeWidget::itemClicked,
this, SLOT( itemClicked( QTreeWidgetItem *, int ) ) ); this, &QgsIdentifyResultsDialog::itemClicked );
connect( mActionPrint, SIGNAL( triggered( bool ) ), this, SLOT( printCurrentItem() ) ); connect( mActionPrint, &QAction::triggered, this, &QgsIdentifyResultsDialog::printCurrentItem );
connect( mOpenFormAction, SIGNAL( triggered( bool ) ), this, SLOT( featureForm() ) ); connect( mOpenFormAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::featureForm );
connect( mClearResultsAction, SIGNAL( triggered( bool ) ), this, SLOT( clear() ) ); connect( mClearResultsAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::clear );
connect( mHelpToolButton, SIGNAL( clicked() ), this, SLOT( helpRequested() ) ); connect( mHelpToolButton, &QAbstractButton::clicked, this, &QgsIdentifyResultsDialog::helpRequested );
} }
QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog() QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
@ -453,13 +453,13 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( vlayer ) ) ); layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( vlayer ) ) );
lstResults->addTopLevelItem( layItem ); lstResults->addTopLevelItem( layItem );
connect( vlayer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) ); connect( vlayer, &QObject::destroyed, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( vlayer, SIGNAL( crsChanged() ), this, SLOT( layerDestroyed() ) ); connect( vlayer, &QgsMapLayer::crsChanged, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); connect( vlayer, &QgsVectorLayer::featureDeleted, this, &QgsIdentifyResultsDialog::featureDeleted );
connect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ), connect( vlayer, &QgsVectorLayer::attributeValueChanged,
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) ); this, &QgsIdentifyResultsDialog::attributeValueChanged );
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgsIdentifyResultsDialog::editingToggled );
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgsIdentifyResultsDialog::editingToggled );
} }
QgsIdentifyResultsFeatureItem *featItem = new QgsIdentifyResultsFeatureItem( vlayer->fields(), f, vlayer->crs() ); QgsIdentifyResultsFeatureItem *featItem = new QgsIdentifyResultsFeatureItem( vlayer->fields(), f, vlayer->crs() );
@ -522,7 +522,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
twi->setData( 0, Qt::UserRole + 1, qVariantFromValue( qobject_cast<QObject *>( action ) ) ); twi->setData( 0, Qt::UserRole + 1, qVariantFromValue( qobject_cast<QObject *>( action ) ) );
actionItem->addChild( twi ); actionItem->addChild( twi );
connect( action, SIGNAL( destroyed() ), this, SLOT( mapLayerActionDestroyed() ) ); connect( action, &QObject::destroyed, this, &QgsIdentifyResultsDialog::mapLayerActionDestroyed );
} }
} }
@ -798,15 +798,16 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
QTreeWidgetItem *formatItem = new QTreeWidgetItem( QStringList() << ' ' + tr( "Format" ) ); QTreeWidgetItem *formatItem = new QTreeWidgetItem( QStringList() << ' ' + tr( "Format" ) );
layItem->addChild( formatItem ); layItem->addChild( formatItem );
lstResults->setItemWidget( formatItem, 1, formatCombo ); lstResults->setItemWidget( formatItem, 1, formatCombo );
connect( formatCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( formatChanged( int ) ) ); connect( formatCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
this, static_cast<void ( QgsIdentifyResultsDialog::* )( int )>( &QgsIdentifyResultsDialog::formatChanged ) );
} }
else else
{ {
delete formatCombo; delete formatCombo;
} }
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) ); connect( layer, &QObject::destroyed, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( layer, SIGNAL( crsChanged() ), this, SLOT( layerDestroyed() ) ); connect( layer, &QgsMapLayer::crsChanged, this, &QgsIdentifyResultsDialog::layerDestroyed );
} }
// Set/reset getFeatureInfoUrl (currently only available for Feature, so it may change if format changes) // Set/reset getFeatureInfoUrl (currently only available for Feature, so it may change if format changes)
layItem->setData( 0, GetFeatureInfoUrlRole, params.value( QStringLiteral( "getFeatureInfoUrl" ) ) ); layItem->setData( 0, GetFeatureInfoUrlRole, params.value( QStringLiteral( "getFeatureInfoUrl" ) ) );
@ -1481,14 +1482,14 @@ void QgsIdentifyResultsDialog::disconnectLayer( QObject *layer )
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer ); QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( vlayer ) if ( vlayer )
{ {
disconnect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); disconnect( vlayer, &QgsVectorLayer::featureDeleted, this, &QgsIdentifyResultsDialog::featureDeleted );
disconnect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ), disconnect( vlayer, &QgsVectorLayer::attributeValueChanged,
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) ); this, &QgsIdentifyResultsDialog::attributeValueChanged );
disconnect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); disconnect( vlayer, &QgsVectorLayer::editingStarted, this, &QgsIdentifyResultsDialog::editingToggled );
disconnect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); disconnect( vlayer, &QgsVectorLayer::editingStopped, this, &QgsIdentifyResultsDialog::editingToggled );
} }
disconnect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) ); disconnect( layer, &QObject::destroyed, this, &QgsIdentifyResultsDialog::layerDestroyed );
} }
void QgsIdentifyResultsDialog::featureDeleted( QgsFeatureId fid ) void QgsIdentifyResultsDialog::featureDeleted( QgsFeatureId fid )
@ -1742,9 +1743,11 @@ void QgsIdentifyResultsDialog::layerProperties()
void QgsIdentifyResultsDialog::activateLayer() void QgsIdentifyResultsDialog::activateLayer()
{ {
connect( this, SIGNAL( activateLayer( QgsMapLayer * ) ), QgisApp::instance(), SLOT( setActiveLayer( QgsMapLayer * ) ) ); connect( this, static_cast<void ( QgsIdentifyResultsDialog::* )( QgsMapLayer * )>( &QgsIdentifyResultsDialog::activateLayer )
, QgisApp::instance(), &QgisApp::setActiveLayer );
emit activateLayer( layer( lstResults->currentItem() ) ); emit activateLayer( layer( lstResults->currentItem() ) );
disconnect( this, SIGNAL( activateLayer( QgsMapLayer * ) ), QgisApp::instance(), SLOT( setActiveLayer( QgsMapLayer * ) ) ); disconnect( this, static_cast<void ( QgsIdentifyResultsDialog::* )( QgsMapLayer * )>( &QgsIdentifyResultsDialog::activateLayer ),
QgisApp::instance(), &QgisApp::setActiveLayer );
} }
void QgsIdentifyResultsDialog::layerProperties( QTreeWidgetItem *item ) void QgsIdentifyResultsDialog::layerProperties( QTreeWidgetItem *item )

View File

@ -57,8 +57,8 @@ QgsJoinDialog::QgsJoinDialog( QgsVectorLayer *layer, QList<QgsMapLayer *> alread
} }
connect( mJoinLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsJoinDialog::checkDefinitionValid ); connect( mJoinLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsJoinDialog::checkDefinitionValid );
connect( mJoinFieldComboBox, SIGNAL( fieldChanged( QString ) ), this, SLOT( checkDefinitionValid() ) ); connect( mJoinFieldComboBox, &QgsFieldComboBox::fieldChanged, this, &QgsJoinDialog::checkDefinitionValid );
connect( mTargetFieldComboBox, SIGNAL( fieldChanged( QString ) ), this, SLOT( checkDefinitionValid() ) ); connect( mTargetFieldComboBox, &QgsFieldComboBox::fieldChanged, this, &QgsJoinDialog::checkDefinitionValid );
checkDefinitionValid(); checkDefinitionValid();
} }

View File

@ -26,9 +26,9 @@ QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QWidget *parent )
{ {
setupUi( this ); setupUi( this );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( onOK() ) ); connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsLabelEngineConfigDialog::onOK );
connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), SIGNAL( clicked() ), connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), &QAbstractButton::clicked,
this, SLOT( setDefaults() ) ); this, &QgsLabelEngineConfigDialog::setDefaults );
QgsLabelingEngine engine; QgsLabelingEngine engine;
engine.readSettingsFromProject( QgsProject::instance() ); engine.readSettingsFromProject( QgsProject::instance() );

View File

@ -63,13 +63,13 @@ QgsLabelingGui::QgsLabelingGui( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas,
, mMode( NoLabels ) , mMode( NoLabels )
{ {
// connections for groupboxes with separate activation checkboxes (that need to honor data defined setting) // connections for groupboxes with separate activation checkboxes (that need to honor data defined setting)
connect( mBufferDrawChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mBufferDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mShapeDrawChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mShapeDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mShadowDrawChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mShadowDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mDirectSymbChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mDirectSymbChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mFormatNumChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mFormatNumChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mScaleBasedVisibilityChkBx, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mScaleBasedVisibilityChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mFontLimitPixelChkBox, SIGNAL( toggled( bool ) ), this, SLOT( updateUi() ) ); connect( mFontLimitPixelChkBox, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
mFieldExpressionWidget->registerExpressionContextGenerator( this ); mFieldExpressionWidget->registerExpressionContextGenerator( this );

View File

@ -33,14 +33,14 @@ QgsLabelingWidget::QgsLabelingWidget( QgsVectorLayer *layer, QgsMapCanvas *canva
{ {
setupUi( this ); setupUi( this );
connect( mEngineSettingsButton, SIGNAL( clicked() ), this, SLOT( showEngineConfigDialog() ) ); connect( mEngineSettingsButton, &QAbstractButton::clicked, this, &QgsLabelingWidget::showEngineConfigDialog );
mLabelModeComboBox->setCurrentIndex( -1 ); mLabelModeComboBox->setCurrentIndex( -1 );
mLabelGui = new QgsLabelingGui( nullptr, mCanvas, nullptr, this ); mLabelGui = new QgsLabelingGui( nullptr, mCanvas, nullptr, this );
mStackedWidget->addWidget( mLabelGui ); mStackedWidget->addWidget( mLabelGui );
connect( mLabelModeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( labelModeChanged( int ) ) ); connect( mLabelModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLabelingWidget::labelModeChanged );
connect( mLabelGui, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) ); connect( mLabelGui, &QgsTextFormatWidget::widgetChanged, this, &QgsLabelingWidget::widgetChanged );
setLayer( layer ); setLayer( layer );
} }

View File

@ -58,7 +58,7 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<
{ {
setupUi( this ); setupUi( this );
connect( QgsProject::instance(), SIGNAL( layerWillBeRemoved( QgsMapLayer * ) ), this, SLOT( layerAboutToBeRemoved( QgsMapLayer * ) ) ); connect( QgsProject::instance(), static_cast < void ( QgsProject::* )( QgsMapLayer * ) > ( &QgsProject::layerWillBeRemoved ), this, &QgsLayerStylingWidget::layerAboutToBeRemoved );
QgsSettings settings; QgsSettings settings;
mLiveApplyCheck->setChecked( settings.value( QStringLiteral( "UI/autoApplyStyling" ), true ).toBool() ); mLiveApplyCheck->setChecked( settings.value( QStringLiteral( "UI/autoApplyStyling" ), true ).toBool() );
@ -76,15 +76,15 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<
QList<QgsMapLayerConfigWidgetFactory *> l; QList<QgsMapLayerConfigWidgetFactory *> l;
setPageFactories( pages ); setPageFactories( pages );
connect( mUndoButton, SIGNAL( pressed() ), this, SLOT( undo() ) ); connect( mUndoButton, &QAbstractButton::pressed, this, &QgsLayerStylingWidget::undo );
connect( mRedoButton, SIGNAL( pressed() ), this, SLOT( redo() ) ); connect( mRedoButton, &QAbstractButton::pressed, this, &QgsLayerStylingWidget::redo );
connect( mAutoApplyTimer, SIGNAL( timeout() ), this, SLOT( apply() ) ); connect( mAutoApplyTimer, &QTimer::timeout, this, &QgsLayerStylingWidget::apply );
connect( mOptionsListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( updateCurrentWidgetLayer() ) ); connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
connect( mButtonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) ); connect( mButtonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsLayerStylingWidget::apply );
connect( mLayerCombo, &QgsMapLayerComboBox::layerChanged, this, &QgsLayerStylingWidget::setLayer ); connect( mLayerCombo, &QgsMapLayerComboBox::layerChanged, this, &QgsLayerStylingWidget::setLayer );
connect( mLiveApplyCheck, SIGNAL( toggled( bool ) ), this, SLOT( liveApplyToggled( bool ) ) ); connect( mLiveApplyCheck, &QAbstractButton::toggled, this, &QgsLayerStylingWidget::liveApplyToggled );
mStackedWidget->setCurrentIndex( 0 ); mStackedWidget->setCurrentIndex( 0 );
} }
@ -108,11 +108,11 @@ void QgsLayerStylingWidget::blockUpdates( bool blocked )
if ( blocked ) if ( blocked )
{ {
disconnect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); disconnect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
} }
else else
{ {
connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); connect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
} }
} }
@ -123,7 +123,7 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
if ( mCurrentLayer ) if ( mCurrentLayer )
{ {
disconnect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); disconnect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
} }
if ( !layer || !layer->isSpatial() ) if ( !layer || !layer->isSpatial() )
@ -145,7 +145,7 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
mUndoWidget->setUndoStack( layer->undoStackStyles() ); mUndoWidget->setUndoStack( layer->undoStackStyles() );
connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); connect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
int lastPage = mOptionsListWidget->currentIndex().row(); int lastPage = mOptionsListWidget->currentIndex().row();
mOptionsListWidget->blockSignals( true ); mOptionsListWidget->blockSignals( true );
@ -222,7 +222,7 @@ void QgsLayerStylingWidget::apply()
if ( !mCurrentLayer ) if ( !mCurrentLayer )
return; return;
disconnect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); disconnect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
QString undoName = QStringLiteral( "Style Change" ); QString undoName = QStringLiteral( "Style Change" );
@ -270,7 +270,7 @@ void QgsLayerStylingWidget::apply()
QgsProject::instance()->setDirty( true ); QgsProject::instance()->setDirty( true );
mCurrentLayer->triggerRepaint(); mCurrentLayer->triggerRepaint();
} }
connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) ); connect( mCurrentLayer, &QgsMapLayer::styleChanged, this, &QgsLayerStylingWidget::updateCurrentWidgetLayer );
} }
void QgsLayerStylingWidget::autoApply() void QgsLayerStylingWidget::autoApply()
@ -332,7 +332,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
QgsMapLayerConfigWidget *panel = mUserPages[row]->createWidget( mCurrentLayer, mMapCanvas, true, mWidgetStack ); QgsMapLayerConfigWidget *panel = mUserPages[row]->createWidget( mCurrentLayer, mMapCanvas, true, mWidgetStack );
if ( panel ) if ( panel )
{ {
connect( panel, SIGNAL( widgetChanged( QgsPanelWidget * ) ), this, SLOT( autoApply() ) ); connect( panel, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
mWidgetStack->setMainPanel( panel ); mWidgetStack->setMainPanel( panel );
} }
} }
@ -353,7 +353,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
QgsRendererPropertiesDialog *styleWidget = new QgsRendererPropertiesDialog( vlayer, QgsStyle::defaultStyle(), true, mStackedWidget ); QgsRendererPropertiesDialog *styleWidget = new QgsRendererPropertiesDialog( vlayer, QgsStyle::defaultStyle(), true, mStackedWidget );
styleWidget->setMapCanvas( mMapCanvas ); styleWidget->setMapCanvas( mMapCanvas );
styleWidget->setDockMode( true ); styleWidget->setDockMode( true );
connect( styleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( styleWidget, &QgsRendererPropertiesDialog::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
QgsPanelWidgetWrapper *wrapper = new QgsPanelWidgetWrapper( styleWidget, mStackedWidget ); QgsPanelWidgetWrapper *wrapper = new QgsPanelWidgetWrapper( styleWidget, mStackedWidget );
wrapper->setDockMode( true ); wrapper->setDockMode( true );
connect( styleWidget, &QgsRendererPropertiesDialog::showPanel, wrapper, &QgsPanelWidget::openPanel ); connect( styleWidget, &QgsRendererPropertiesDialog::showPanel, wrapper, &QgsPanelWidget::openPanel );
@ -366,7 +366,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
{ {
mLabelingWidget = new QgsLabelingWidget( 0, mMapCanvas, mWidgetStack ); mLabelingWidget = new QgsLabelingWidget( 0, mMapCanvas, mWidgetStack );
mLabelingWidget->setDockMode( true ); mLabelingWidget->setDockMode( true );
connect( mLabelingWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( mLabelingWidget, &QgsLabelingWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
} }
mLabelingWidget->setLayer( vlayer ); mLabelingWidget->setLayer( vlayer );
mWidgetStack->setMainPanel( mLabelingWidget ); mWidgetStack->setMainPanel( mLabelingWidget );
@ -415,7 +415,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
} }
} }
mRasterStyleWidget->setDockMode( true ); mRasterStyleWidget->setDockMode( true );
connect( mRasterStyleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( mRasterStyleWidget, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
mWidgetStack->setMainPanel( mRasterStyleWidget ); mWidgetStack->setMainPanel( mRasterStyleWidget );
break; break;
} }
@ -424,7 +424,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
{ {
QgsRasterTransparencyWidget *transwidget = new QgsRasterTransparencyWidget( rlayer, mMapCanvas, mWidgetStack ); QgsRasterTransparencyWidget *transwidget = new QgsRasterTransparencyWidget( rlayer, mMapCanvas, mWidgetStack );
transwidget->setDockMode( true ); transwidget->setDockMode( true );
connect( transwidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( transwidget, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
mWidgetStack->setMainPanel( transwidget ); mWidgetStack->setMainPanel( transwidget );
break; break;
} }
@ -437,10 +437,10 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
mRasterStyleWidget = new QgsRendererRasterPropertiesWidget( rlayer, mMapCanvas, mWidgetStack ); mRasterStyleWidget = new QgsRendererRasterPropertiesWidget( rlayer, mMapCanvas, mWidgetStack );
mRasterStyleWidget->syncToLayer( rlayer ); mRasterStyleWidget->syncToLayer( rlayer );
} }
connect( mRasterStyleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( mRasterStyleWidget, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
QgsRasterHistogramWidget *widget = new QgsRasterHistogramWidget( rlayer, mWidgetStack ); QgsRasterHistogramWidget *widget = new QgsRasterHistogramWidget( rlayer, mWidgetStack );
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) ); connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
QString name = mRasterStyleWidget->currentRenderWidget()->renderer()->type(); QString name = mRasterStyleWidget->currentRenderWidget()->renderer()->type();
widget->setRendererWidget( name, mRasterStyleWidget->currentRenderWidget() ); widget->setRendererWidget( name, mRasterStyleWidget->currentRenderWidget() );
widget->setDockMode( true ); widget->setDockMode( true );

View File

@ -35,14 +35,14 @@ QAction *QgsMapLayerStyleGuiUtils::actionAddStyle( QgsMapLayer *layer, QObject *
{ {
QAction *a = new QAction( tr( "Add..." ), parent ); QAction *a = new QAction( tr( "Add..." ), parent );
a->setData( QVariant::fromValue<QObject *>( layer ) ); a->setData( QVariant::fromValue<QObject *>( layer ) );
connect( a, SIGNAL( triggered() ), this, SLOT( addStyle() ) ); connect( a, &QAction::triggered, this, &QgsMapLayerStyleGuiUtils::addStyle );
return a; return a;
} }
QAction *QgsMapLayerStyleGuiUtils::actionRemoveStyle( QgsMapLayer *layer, QObject *parent ) QAction *QgsMapLayerStyleGuiUtils::actionRemoveStyle( QgsMapLayer *layer, QObject *parent )
{ {
QAction *a = new QAction( tr( "Remove Current" ), parent ); QAction *a = new QAction( tr( "Remove Current" ), parent );
a->connect( a, SIGNAL( triggered() ), this, SLOT( removeStyle() ) ); connect( a, &QAction::triggered, this, &QgsMapLayerStyleGuiUtils::removeStyle );
a->setData( QVariant::fromValue<QObject *>( layer ) ); a->setData( QVariant::fromValue<QObject *>( layer ) );
a->setEnabled( layer->styleManager()->styles().count() > 1 ); a->setEnabled( layer->styleManager()->styles().count() > 1 );
return a; return a;
@ -51,7 +51,7 @@ QAction *QgsMapLayerStyleGuiUtils::actionRemoveStyle( QgsMapLayer *layer, QObjec
QAction *QgsMapLayerStyleGuiUtils::actionRenameStyle( QgsMapLayer *layer, QObject *parent ) QAction *QgsMapLayerStyleGuiUtils::actionRenameStyle( QgsMapLayer *layer, QObject *parent )
{ {
QAction *a = new QAction( tr( "Rename Current..." ), parent ); QAction *a = new QAction( tr( "Rename Current..." ), parent );
a->connect( a, SIGNAL( triggered() ), this, SLOT( renameStyle() ) ); connect( a, &QAction::triggered, this, &QgsMapLayerStyleGuiUtils::renameStyle );
a->setData( QVariant::fromValue<QObject *>( layer ) ); a->setData( QVariant::fromValue<QObject *>( layer ) );
return a; return a;
} }
@ -68,7 +68,7 @@ QList<QAction *> QgsMapLayerStyleGuiUtils::actionsUseStyle( QgsMapLayer *layer,
if ( name.isEmpty() ) if ( name.isEmpty() )
name = defaultStyleName(); name = defaultStyleName();
QAction *actionUse = new QAction( name, parent ); QAction *actionUse = new QAction( name, parent );
connect( actionUse, SIGNAL( triggered() ), this, SLOT( useStyle() ) ); connect( actionUse, &QAction::triggered, this, &QgsMapLayerStyleGuiUtils::useStyle );
actionUse->setCheckable( true ); actionUse->setCheckable( true );
actionUse->setChecked( active ); actionUse->setChecked( active );
actionUse->setEnabled( !onlyOneStyle ); actionUse->setEnabled( !onlyOneStyle );

View File

@ -34,7 +34,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture *par
{ {
if ( mCanvas ) if ( mCanvas )
{ {
connect( mCanvas, SIGNAL( mapToolSet( QgsMapTool *, QgsMapTool * ) ), this, SLOT( setParentTool( QgsMapTool *, QgsMapTool * ) ) ); connect( mCanvas, &QgsMapCanvas::mapToolSet, this, &QgsMapToolAddCircularString::setParentTool );
} }
} }
@ -48,7 +48,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapCanvas *canvas )
{ {
if ( mCanvas ) if ( mCanvas )
{ {
connect( mCanvas, SIGNAL( mapToolSet( QgsMapTool *, QgsMapTool * ) ), this, SLOT( setParentTool( QgsMapTool *, QgsMapTool * ) ) ); connect( mCanvas, &QgsMapCanvas::mapToolSet, this, &QgsMapToolAddCircularString::setParentTool );
} }
} }

View File

@ -66,7 +66,7 @@ void QgsMapToolChangeLabelProperties::canvasReleaseEvent( QgsMapMouseEvent *e )
mCurrentLabel.pos.labelFont, mCurrentLabel.pos.labelFont,
labeltext, nullptr ); labeltext, nullptr );
connect( &d, SIGNAL( applied() ), this, SLOT( dialogPropertiesApplied() ) ); connect( &d, &QgsLabelPropertyDialog::applied, this, &QgsMapToolChangeLabelProperties::dialogPropertiesApplied );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
applyChanges( d.changedProperties() ); applyChanges( d.changedProperties() );

View File

@ -159,7 +159,7 @@ void QgsMapToolCircularStringRadius::createRadiusSpinBox()
mRadiusSpinBox->setPrefix( tr( "Radius: " ) ); mRadiusSpinBox->setPrefix( tr( "Radius: " ) );
mRadiusSpinBox->setValue( mRadius ); mRadiusSpinBox->setValue( mRadius );
QgisApp::instance()->addUserInputWidget( mRadiusSpinBox ); QgisApp::instance()->addUserInputWidget( mRadiusSpinBox );
QObject::connect( mRadiusSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( updateRadiusFromSpinBox( double ) ) ); connect( mRadiusSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsMapToolCircularStringRadius::updateRadiusFromSpinBox );
mRadiusSpinBox->setFocus( Qt::TabFocusReason ); mRadiusSpinBox->setFocus( Qt::TabFocusReason );
} }

View File

@ -52,12 +52,12 @@ QgsMapToolIdentifyAction::QgsMapToolIdentifyAction( QgsMapCanvas *canvas )
QPixmap myIdentifyQPixmap = QPixmap( ( const char ** ) identify_cursor ); QPixmap myIdentifyQPixmap = QPixmap( ( const char ** ) identify_cursor );
mCursor = QCursor( myIdentifyQPixmap, 1, 1 ); mCursor = QCursor( myIdentifyQPixmap, 1, 1 );
connect( this, SIGNAL( changedRasterResults( QList<IdentifyResult> & ) ), this, SLOT( handleChangedRasterResults( QList<IdentifyResult> & ) ) ); connect( this, &QgsMapToolIdentify::changedRasterResults, this, &QgsMapToolIdentifyAction::handleChangedRasterResults );
mIdentifyMenu->setAllowMultipleReturn( true ); mIdentifyMenu->setAllowMultipleReturn( true );
QgsMapLayerAction *attrTableAction = new QgsMapLayerAction( tr( "Show attribute table" ), mIdentifyMenu, QgsMapLayer::VectorLayer, QgsMapLayerAction::MultipleFeatures ); QgsMapLayerAction *attrTableAction = new QgsMapLayerAction( tr( "Show attribute table" ), mIdentifyMenu, QgsMapLayer::VectorLayer, QgsMapLayerAction::MultipleFeatures );
connect( attrTableAction, SIGNAL( triggeredForFeatures( QgsMapLayer *, const QList<QgsFeature> ) ), this, SLOT( showAttributeTable( QgsMapLayer *, const QList<QgsFeature> ) ) ); connect( attrTableAction, &QgsMapLayerAction::triggeredForFeatures, this, &QgsMapToolIdentifyAction::showAttributeTable );
identifyMenu()->addCustomAction( attrTableAction ); identifyMenu()->addCustomAction( attrTableAction );
} }
@ -75,8 +75,8 @@ QgsIdentifyResultsDialog *QgsMapToolIdentifyAction::resultsDialog()
{ {
mResultsDialog = new QgsIdentifyResultsDialog( mCanvas, mCanvas->window() ); mResultsDialog = new QgsIdentifyResultsDialog( mCanvas, mCanvas->window() );
connect( mResultsDialog, SIGNAL( formatChanged( QgsRasterLayer * ) ), this, SLOT( formatChanged( QgsRasterLayer * ) ) ); connect( mResultsDialog.data(), static_cast<void ( QgsIdentifyResultsDialog::* )( QgsRasterLayer * )>( &QgsIdentifyResultsDialog::formatChanged ), this, &QgsMapToolIdentify::formatChanged );
connect( mResultsDialog, SIGNAL( copyToClipboard( QgsFeatureStore & ) ), this, SLOT( handleCopyToClipboard( QgsFeatureStore & ) ) ); connect( mResultsDialog.data(), &QgsIdentifyResultsDialog::copyToClipboard, this, &QgsMapToolIdentifyAction::handleCopyToClipboard );
} }
return mResultsDialog; return mResultsDialog;
@ -115,8 +115,8 @@ void QgsMapToolIdentifyAction::canvasPressEvent( QgsMapMouseEvent *e )
void QgsMapToolIdentifyAction::canvasReleaseEvent( QgsMapMouseEvent *e ) void QgsMapToolIdentifyAction::canvasReleaseEvent( QgsMapMouseEvent *e )
{ {
resultsDialog()->clear(); resultsDialog()->clear();
connect( this, SIGNAL( identifyProgress( int, int ) ), QgisApp::instance(), SLOT( showProgress( int, int ) ) ); connect( this, &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance(), &QgisApp::showProgress );
connect( this, SIGNAL( identifyMessage( QString ) ), QgisApp::instance(), SLOT( showStatusMessage( QString ) ) ); connect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );
identifyMenu()->setResultsIfExternalAction( false ); identifyMenu()->setResultsIfExternalAction( false );
@ -129,8 +129,8 @@ void QgsMapToolIdentifyAction::canvasReleaseEvent( QgsMapMouseEvent *e )
QList<IdentifyResult> results = QgsMapToolIdentify::identify( e->x(), e->y(), mode ); QList<IdentifyResult> results = QgsMapToolIdentify::identify( e->x(), e->y(), mode );
disconnect( this, SIGNAL( identifyProgress( int, int ) ), QgisApp::instance(), SLOT( showProgress( int, int ) ) ); disconnect( this, &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance(), &QgisApp::showProgress );
disconnect( this, SIGNAL( identifyMessage( QString ) ), QgisApp::instance(), SLOT( showStatusMessage( QString ) ) ); disconnect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );
if ( results.isEmpty() ) if ( results.isEmpty() )
{ {

View File

@ -34,8 +34,8 @@ QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas *canvas )
{ {
mToolName = tr( "Measure angle" ); mToolName = tr( "Measure angle" );
connect( canvas, SIGNAL( destinationCrsChanged() ), connect( canvas, &QgsMapCanvas::destinationCrsChanged,
this, SLOT( updateSettings() ) ); this, &QgsMapToolMeasureAngle::updateSettings );
} }
QgsMapToolMeasureAngle::~QgsMapToolMeasureAngle() QgsMapToolMeasureAngle::~QgsMapToolMeasureAngle()
@ -96,7 +96,7 @@ void QgsMapToolMeasureAngle::canvasReleaseEvent( QgsMapMouseEvent *e )
{ {
mResultDisplay = new QgsDisplayAngle( this ); mResultDisplay = new QgsDisplayAngle( this );
mResultDisplay->setWindowFlags( mResultDisplay->windowFlags() | Qt::Tool ); mResultDisplay->setWindowFlags( mResultDisplay->windowFlags() | Qt::Tool );
QObject::connect( mResultDisplay, SIGNAL( rejected() ), this, SLOT( stopMeasuring() ) ); connect( mResultDisplay, &QDialog::rejected, this, &QgsMapToolMeasureAngle::stopMeasuring );
} }
configureDistanceArea(); configureDistanceArea();
createRubberBand(); createRubberBand();

View File

@ -334,16 +334,16 @@ void QgsMapToolOffsetCurve::createDistanceWidget()
mDistanceWidget->setFocus( Qt::TabFocusReason ); mDistanceWidget->setFocus( Qt::TabFocusReason );
QObject::connect( mDistanceWidget, SIGNAL( valueChanged( double ) ), this, SLOT( placeOffsetCurveToValue() ) ); connect( mDistanceWidget, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsMapToolOffsetCurve::placeOffsetCurveToValue );
QObject::connect( mDistanceWidget, SIGNAL( editingFinished() ), this, SLOT( applyOffset() ) ); connect( mDistanceWidget, &QAbstractSpinBox::editingFinished, this, &QgsMapToolOffsetCurve::applyOffset );
} }
void QgsMapToolOffsetCurve::deleteDistanceWidget() void QgsMapToolOffsetCurve::deleteDistanceWidget()
{ {
if ( mDistanceWidget ) if ( mDistanceWidget )
{ {
QObject::disconnect( mDistanceWidget, SIGNAL( valueChanged( double ) ), this, SLOT( placeOffsetCurveToValue() ) ); disconnect( mDistanceWidget, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsMapToolOffsetCurve::placeOffsetCurveToValue );
QObject::disconnect( mDistanceWidget, SIGNAL( editingFinished() ), this, SLOT( applyOffset() ) ); disconnect( mDistanceWidget, &QAbstractSpinBox::editingFinished, this, &QgsMapToolOffsetCurve::applyOffset );
mDistanceWidget->releaseKeyboard(); mDistanceWidget->releaseKeyboard();
mDistanceWidget->deleteLater(); mDistanceWidget->deleteLater();
} }

View File

@ -36,8 +36,8 @@ QgsMapToolPinLabels::QgsMapToolPinLabels( QgsMapCanvas *canvas )
{ {
mToolName = tr( "Pin labels" ); mToolName = tr( "Pin labels" );
connect( QgisApp::instance()->actionToggleEditing(), SIGNAL( triggered() ), this, SLOT( updatePinnedLabels() ) ); connect( QgisApp::instance()->actionToggleEditing(), &QAction::triggered, this, &QgsMapToolPinLabels::updatePinnedLabels );
connect( canvas, SIGNAL( renderComplete( QPainter * ) ), this, SLOT( highlightPinnedLabels() ) ); connect( canvas, &QgsMapCanvas::renderComplete, this, &QgsMapToolPinLabels::highlightPinnedLabels );
} }
QgsMapToolPinLabels::~QgsMapToolPinLabels() QgsMapToolPinLabels::~QgsMapToolPinLabels()

View File

@ -74,7 +74,7 @@ QgsAngleMagnetWidget::QgsAngleMagnetWidget( const QString &label, QWidget *paren
// connect signals // connect signals
mAngleSpinBox->installEventFilter( this ); mAngleSpinBox->installEventFilter( this );
connect( mAngleSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( angleSpinBoxValueChanged( double ) ) ); connect( mAngleSpinBox, static_cast < void ( QgsDoubleSpinBox::* )( double ) > ( &QgsDoubleSpinBox::valueChanged ), this, &QgsAngleMagnetWidget::angleSpinBoxValueChanged );
// config focus // config focus
setFocusProxy( mAngleSpinBox ); setFocusProxy( mAngleSpinBox );
@ -466,16 +466,16 @@ void QgsMapToolRotateFeature::createRotationWidget()
QgisApp::instance()->addUserInputWidget( mRotationWidget ); QgisApp::instance()->addUserInputWidget( mRotationWidget );
mRotationWidget->setFocus( Qt::TabFocusReason ); mRotationWidget->setFocus( Qt::TabFocusReason );
QObject::connect( mRotationWidget, SIGNAL( angleChanged( double ) ), this, SLOT( updateRubberband( double ) ) ); connect( mRotationWidget, &QgsAngleMagnetWidget::angleChanged, this, &QgsMapToolRotateFeature::updateRubberband );
QObject::connect( mRotationWidget, SIGNAL( angleEditingFinished( double ) ), this, SLOT( applyRotation( double ) ) ); connect( mRotationWidget, &QgsAngleMagnetWidget::angleEditingFinished, this, &QgsMapToolRotateFeature::applyRotation );
} }
void QgsMapToolRotateFeature::deleteRotationWidget() void QgsMapToolRotateFeature::deleteRotationWidget()
{ {
if ( mRotationWidget ) if ( mRotationWidget )
{ {
QObject::disconnect( mRotationWidget, SIGNAL( angleChanged( double ) ), this, SLOT( updateRubberband( double ) ) ); disconnect( mRotationWidget, &QgsAngleMagnetWidget::angleChanged, this, &QgsMapToolRotateFeature::updateRubberband );
QObject::disconnect( mRotationWidget, SIGNAL( angleEditingFinished( double ) ), this, SLOT( applyRotation( double ) ) ); disconnect( mRotationWidget, &QgsAngleMagnetWidget::angleEditingFinished, this, &QgsMapToolRotateFeature::applyRotation );
mRotationWidget->releaseKeyboard(); mRotationWidget->releaseKeyboard();
mRotationWidget->deleteLater(); mRotationWidget->deleteLater();
} }

View File

@ -39,9 +39,9 @@ QgsSimplifyDialog::QgsSimplifyDialog( QgsMapToolSimplify *tool, QWidget *parent
cboToleranceUnits->setCurrentIndex( ( int ) mTool->toleranceUnits() ); cboToleranceUnits->setCurrentIndex( ( int ) mTool->toleranceUnits() );
// communication with map tool // communication with map tool
connect( spinTolerance, SIGNAL( valueChanged( double ) ), mTool, SLOT( setTolerance( double ) ) ); connect( spinTolerance, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), mTool, &QgsMapToolSimplify::setTolerance );
connect( cboToleranceUnits, SIGNAL( currentIndexChanged( int ) ), mTool, SLOT( setToleranceUnits( int ) ) ); connect( cboToleranceUnits, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), mTool, &QgsMapToolSimplify::setToleranceUnits );
connect( okButton, SIGNAL( clicked() ), mTool, SLOT( storeSimplified() ) ); connect( okButton, &QAbstractButton::clicked, mTool, &QgsMapToolSimplify::storeSimplified );
} }
void QgsSimplifyDialog::updateStatusText() void QgsSimplifyDialog::updateStatusText()

View File

@ -39,12 +39,12 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f )
QPushButton *nb = new QPushButton( tr( "&New" ) ); QPushButton *nb = new QPushButton( tr( "&New" ) );
buttonBox->addButton( nb, QDialogButtonBox::ActionRole ); buttonBox->addButton( nb, QDialogButtonBox::ActionRole );
connect( nb, SIGNAL( clicked() ), this, SLOT( restart() ) ); connect( nb, &QAbstractButton::clicked, this, &QgsMeasureDialog::restart );
// Add a configuration button // Add a configuration button
QPushButton *cb = new QPushButton( tr( "&Configuration" ) ); QPushButton *cb = new QPushButton( tr( "&Configuration" ) );
buttonBox->addButton( cb, QDialogButtonBox::ActionRole ); buttonBox->addButton( cb, QDialogButtonBox::ActionRole );
connect( cb, SIGNAL( clicked() ), this, SLOT( openConfigTab() ) ); connect( cb, &QAbstractButton::clicked, this, &QgsMeasureDialog::openConfigTab );
mMeasureArea = tool->measureArea(); mMeasureArea = tool->measureArea();
mTotal = 0.; mTotal = 0.;
@ -66,8 +66,8 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f )
updateSettings(); updateSettings();
connect( mUnitsCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( unitsChanged( int ) ) ); connect( mUnitsCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsMeasureDialog::unitsChanged );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsMeasureDialog::reject );
connect( mTool->canvas(), &QgsMapCanvas::destinationCrsChanged, this, &QgsMeasureDialog::crsChanged ); connect( mTool->canvas(), &QgsMapCanvas::destinationCrsChanged, this, &QgsMeasureDialog::crsChanged );
groupBox->setCollapsed( true ); groupBox->setCollapsed( true );

View File

@ -62,7 +62,7 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
QHeaderView *verticalHeader = mTableWidget->verticalHeader(); QHeaderView *verticalHeader = mTableWidget->verticalHeader();
if ( verticalHeader ) if ( verticalHeader )
{ {
QObject::connect( mTableWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( selectedRowChanged() ) ); connect( mTableWidget, &QTableWidget::itemSelectionChanged, this, &QgsMergeAttributesDialog::selectedRowChanged );
} }
mTableWidget->setSelectionBehavior( QAbstractItemView::SelectRows ); mTableWidget->setSelectionBehavior( QAbstractItemView::SelectRows );
mTableWidget->setSelectionMode( QAbstractItemView::SingleSelection ); mTableWidget->setSelectionMode( QAbstractItemView::SingleSelection );
@ -73,8 +73,8 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
QgsSettings settings; QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/MergeAttributes/geometry" ) ).toByteArray() ); restoreGeometry( settings.value( QStringLiteral( "Windows/MergeAttributes/geometry" ) ).toByteArray() );
connect( mSkipAllButton, SIGNAL( clicked() ), this, SLOT( setAllToSkip() ) ); connect( mSkipAllButton, &QAbstractButton::clicked, this, &QgsMergeAttributesDialog::setAllToSkip );
connect( mTableWidget, SIGNAL( cellChanged( int, int ) ), this, SLOT( tableWidgetCellChanged( int, int ) ) ); connect( mTableWidget, &QTableWidget::cellChanged, this, &QgsMergeAttributesDialog::tableWidgetCellChanged );
} }
QgsMergeAttributesDialog::QgsMergeAttributesDialog() QgsMergeAttributesDialog::QgsMergeAttributesDialog()
@ -210,8 +210,8 @@ QComboBox *QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnT
newComboBox->addItem( tr( "Skip attribute" ), "skip" ); newComboBox->addItem( tr( "Skip attribute" ), "skip" );
newComboBox->addItem( tr( "Manual value" ), "manual" ); newComboBox->addItem( tr( "Manual value" ), "manual" );
QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString & ) ), connect( newComboBox, static_cast<void ( QComboBox::* )( const QString & )>( &QComboBox::currentIndexChanged ),
this, SLOT( comboValueChanged( const QString & ) ) ); this, &QgsMergeAttributesDialog::comboValueChanged );
return newComboBox; return newComboBox;
} }

View File

@ -78,10 +78,10 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
pbnFindSRID->setEnabled( mDatabaseComboBox->count() ); pbnFindSRID->setEnabled( mDatabaseComboBox->count() );
connect( mNameEdit, SIGNAL( textChanged( QString ) ), this, SLOT( nameChanged( QString ) ) ); connect( mNameEdit, &QLineEdit::textChanged, this, &QgsNewSpatialiteLayerDialog::nameChanged );
connect( mAttributeView, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) ); connect( mAttributeView, &QTreeWidget::itemSelectionChanged, this, &QgsNewSpatialiteLayerDialog::selectionChanged );
connect( leLayerName, SIGNAL( textChanged( QString ) ), this, SLOT( checkOk() ) ); connect( leLayerName, &QLineEdit::textChanged, this, &QgsNewSpatialiteLayerDialog::checkOk );
connect( checkBoxPrimaryKey, SIGNAL( clicked() ), this, SLOT( checkOk() ) ); connect( checkBoxPrimaryKey, &QAbstractButton::clicked, this, &QgsNewSpatialiteLayerDialog::checkOk );
mAddAttributeButton->setEnabled( false ); mAddAttributeButton->setEnabled( false );
mRemoveAttributeButton->setEnabled( false ); mRemoveAttributeButton->setEnabled( false );