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

View File

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

View File

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

View File

@ -57,10 +57,10 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se
mLastDirSettingsName = QStringLiteral( "/UI/lastCustomizationDir" );
//treeWidget->hideColumn(0)
connect( buttonBox->button( QDialogButtonBox::Ok ), SIGNAL( clicked() ), this, SLOT( ok() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( buttonBox->button( QDialogButtonBox::Cancel ), SIGNAL( clicked() ), this, SLOT( cancel() ) );
connect( buttonBox->button( QDialogButtonBox::Reset ), SIGNAL( clicked() ), this, SLOT( reset() ) );
connect( buttonBox->button( QDialogButtonBox::Ok ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::ok );
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::apply );
connect( buttonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::cancel );
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() );
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationCopyrightDialog::apply );
grpEnable->setChecked( mDeco.enabled() );
// text

View File

@ -61,7 +61,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
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() );
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationNorthArrowDialog::apply );
// rotation
rotatePixmap( mDeco.mRotationInt );

View File

@ -30,7 +30,7 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationScaleBar/geometry" ) ).toByteArray() );
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
spnSize->setShowClearButton( false );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -89,8 +89,8 @@ QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QgsWeb
#ifdef QGISDEBUG
settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif
connect( page(), SIGNAL( downloadRequested( QNetworkRequest ) ), this, SLOT( downloadRequested( QNetworkRequest ) ) );
connect( page(), SIGNAL( unsupportedContent( QNetworkReply * ) ), this, SLOT( unsupportedContent( QNetworkReply * ) ) );
connect( page(), &QWebPage::downloadRequested, this, &QgsIdentifyResultsWebView::downloadRequested );
connect( page(), &QWebPage::unsupportedContent, this, &QgsIdentifyResultsWebView::unsupportedContent );
}
@ -153,7 +153,7 @@ void QgsIdentifyResultsWebView::contextMenuEvent( QContextMenuEvent *e )
return;
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->exec( e->globalPos() );
delete menu;
@ -272,7 +272,7 @@ QgsIdentifyResultsWebViewItem::QgsIdentifyResultsWebViewItem( QTreeWidget *treeW
mWebView = new QgsIdentifyResultsWebView( treeWidget );
mWebView->hide();
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 )
@ -285,7 +285,7 @@ void QgsIdentifyResultsWebViewItem::loadFinished( bool ok )
// Span columns to save some space, must be after setItemWidget() to take effect.
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->updateGeometry();
connect( lstResults, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
this, SLOT( itemExpanded( QTreeWidgetItem * ) ) );
connect( lstResults, &QTreeWidget::itemExpanded,
this, &QgsIdentifyResultsDialog::itemExpanded );
connect( lstResults, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ),
this, SLOT( handleCurrentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ) );
connect( lstResults, &QTreeWidget::currentItemChanged,
this, &QgsIdentifyResultsDialog::handleCurrentItemChanged );
connect( lstResults, SIGNAL( itemClicked( QTreeWidgetItem *, int ) ),
this, SLOT( itemClicked( QTreeWidgetItem *, int ) ) );
connect( lstResults, &QTreeWidget::itemClicked,
this, &QgsIdentifyResultsDialog::itemClicked );
connect( mActionPrint, SIGNAL( triggered( bool ) ), this, SLOT( printCurrentItem() ) );
connect( mOpenFormAction, SIGNAL( triggered( bool ) ), this, SLOT( featureForm() ) );
connect( mClearResultsAction, SIGNAL( triggered( bool ) ), this, SLOT( clear() ) );
connect( mHelpToolButton, SIGNAL( clicked() ), this, SLOT( helpRequested() ) );
connect( mActionPrint, &QAction::triggered, this, &QgsIdentifyResultsDialog::printCurrentItem );
connect( mOpenFormAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::featureForm );
connect( mClearResultsAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::clear );
connect( mHelpToolButton, &QAbstractButton::clicked, this, &QgsIdentifyResultsDialog::helpRequested );
}
QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
@ -453,13 +453,13 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( vlayer ) ) );
lstResults->addTopLevelItem( layItem );
connect( vlayer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
connect( vlayer, SIGNAL( crsChanged() ), this, SLOT( layerDestroyed() ) );
connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
connect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ),
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) );
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
connect( vlayer, &QObject::destroyed, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( vlayer, &QgsMapLayer::crsChanged, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( vlayer, &QgsVectorLayer::featureDeleted, this, &QgsIdentifyResultsDialog::featureDeleted );
connect( vlayer, &QgsVectorLayer::attributeValueChanged,
this, &QgsIdentifyResultsDialog::attributeValueChanged );
connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgsIdentifyResultsDialog::editingToggled );
connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgsIdentifyResultsDialog::editingToggled );
}
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 ) ) );
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" ) );
layItem->addChild( formatItem );
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
{
delete formatCombo;
}
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
connect( layer, SIGNAL( crsChanged() ), this, SLOT( layerDestroyed() ) );
connect( layer, &QObject::destroyed, this, &QgsIdentifyResultsDialog::layerDestroyed );
connect( layer, &QgsMapLayer::crsChanged, this, &QgsIdentifyResultsDialog::layerDestroyed );
}
// Set/reset getFeatureInfoUrl (currently only available for Feature, so it may change if format changes)
layItem->setData( 0, GetFeatureInfoUrlRole, params.value( QStringLiteral( "getFeatureInfoUrl" ) ) );
@ -1481,14 +1482,14 @@ void QgsIdentifyResultsDialog::disconnectLayer( QObject *layer )
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( vlayer )
{
disconnect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
disconnect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ),
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) );
disconnect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
disconnect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
disconnect( vlayer, &QgsVectorLayer::featureDeleted, this, &QgsIdentifyResultsDialog::featureDeleted );
disconnect( vlayer, &QgsVectorLayer::attributeValueChanged,
this, &QgsIdentifyResultsDialog::attributeValueChanged );
disconnect( vlayer, &QgsVectorLayer::editingStarted, this, &QgsIdentifyResultsDialog::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 )
@ -1742,9 +1743,11 @@ void QgsIdentifyResultsDialog::layerProperties()
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() ) );
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 )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture *par
{
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 )
{
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,
labeltext, nullptr );
connect( &d, SIGNAL( applied() ), this, SLOT( dialogPropertiesApplied() ) );
connect( &d, &QgsLabelPropertyDialog::applied, this, &QgsMapToolChangeLabelProperties::dialogPropertiesApplied );
if ( d.exec() == QDialog::Accepted )
{
applyChanges( d.changedProperties() );

View File

@ -159,7 +159,7 @@ void QgsMapToolCircularStringRadius::createRadiusSpinBox()
mRadiusSpinBox->setPrefix( tr( "Radius: " ) );
mRadiusSpinBox->setValue( mRadius );
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 );
}

View File

@ -52,12 +52,12 @@ QgsMapToolIdentifyAction::QgsMapToolIdentifyAction( QgsMapCanvas *canvas )
QPixmap myIdentifyQPixmap = QPixmap( ( const char ** ) identify_cursor );
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 );
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 );
}
@ -75,8 +75,8 @@ QgsIdentifyResultsDialog *QgsMapToolIdentifyAction::resultsDialog()
{
mResultsDialog = new QgsIdentifyResultsDialog( mCanvas, mCanvas->window() );
connect( mResultsDialog, SIGNAL( formatChanged( QgsRasterLayer * ) ), this, SLOT( formatChanged( QgsRasterLayer * ) ) );
connect( mResultsDialog, SIGNAL( copyToClipboard( QgsFeatureStore & ) ), this, SLOT( handleCopyToClipboard( QgsFeatureStore & ) ) );
connect( mResultsDialog.data(), static_cast<void ( QgsIdentifyResultsDialog::* )( QgsRasterLayer * )>( &QgsIdentifyResultsDialog::formatChanged ), this, &QgsMapToolIdentify::formatChanged );
connect( mResultsDialog.data(), &QgsIdentifyResultsDialog::copyToClipboard, this, &QgsMapToolIdentifyAction::handleCopyToClipboard );
}
return mResultsDialog;
@ -115,8 +115,8 @@ void QgsMapToolIdentifyAction::canvasPressEvent( QgsMapMouseEvent *e )
void QgsMapToolIdentifyAction::canvasReleaseEvent( QgsMapMouseEvent *e )
{
resultsDialog()->clear();
connect( this, SIGNAL( identifyProgress( int, int ) ), QgisApp::instance(), SLOT( showProgress( int, int ) ) );
connect( this, SIGNAL( identifyMessage( QString ) ), QgisApp::instance(), SLOT( showStatusMessage( QString ) ) );
connect( this, &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance(), &QgisApp::showProgress );
connect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );
identifyMenu()->setResultsIfExternalAction( false );
@ -129,8 +129,8 @@ void QgsMapToolIdentifyAction::canvasReleaseEvent( QgsMapMouseEvent *e )
QList<IdentifyResult> results = QgsMapToolIdentify::identify( e->x(), e->y(), mode );
disconnect( this, SIGNAL( identifyProgress( int, int ) ), QgisApp::instance(), SLOT( showProgress( int, int ) ) );
disconnect( this, SIGNAL( identifyMessage( QString ) ), QgisApp::instance(), SLOT( showStatusMessage( QString ) ) );
disconnect( this, &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance(), &QgisApp::showProgress );
disconnect( this, &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance(), &QgisApp::showStatusMessage );
if ( results.isEmpty() )
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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