Compare commits

..

1 Commits

Author SHA1 Message Date
Jorge Gustavo Rocha
18e38abd84
Merge fdae3f318e388bbc42701bfc6ba5fd9438185dc3 into d1528ee83d3173f504e5208dd8651dd3baf6a9da 2025-06-30 02:58:45 +02:00
397 changed files with 1847 additions and 1816 deletions

View File

@ -979,31 +979,7 @@ if (WITH_CORE)
else()
# UNIX
set (DEFAULT_BIN_SUBDIR bin)
# From https://www.cyberciti.biz/faq/how-do-i-find-the-url-for-my-cgi-bin/
execute_process(COMMAND lsb_release -a OUTPUT_VARIABLE LSB_RELEASE_A)
if(EXISTS "/etc/fedora-release")
# in /var/www/cgi-bin
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
# in /usr/local/www/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
elseif (${CMAKE_HOST_SYSTEM_NAME} MATCHES "BSD")
# in /usr/local/libexec/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR libexec/cgi-bin)
elseif ("${LSB_RELEASE_A}" MATCHES "Ubuntu" OR "${LSB_RELEASE_A}" MATCHES "Debian" OR "${LSB_RELEASE_A}" MATCHES "Mint")
# in /usr/lib/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR lib/cgi-bin)
else()
# others: Red Hat/CentOS/Rocky/Alma Linux
# in /var/www/cgi-bin/
set (DEFAULT_CGIBIN_SUBDIR www/cgi-bin)
endif()
set (DEFAULT_CGIBIN_SUBDIR bin)
set (DEFAULT_LIB_SUBDIR lib${LIB_SUFFIX})
set (DEFAULT_DATA_SUBDIR share/qgis)
set (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)

View File

@ -62,7 +62,7 @@ Returns intensity of the light
Sets intensity of the light
%End
bool operator==( const QgsDirectionalLightSettings &other ) const;
bool operator==( const QgsDirectionalLightSettings &other );
};

View File

@ -95,7 +95,7 @@ Returns quadratic attenuation (A_2)
Sets quadratic attenuation (A_2)
%End
bool operator==( const QgsPointLightSettings &other ) const;
bool operator==( const QgsPointLightSettings &other );
};

View File

@ -62,7 +62,7 @@ Returns intensity of the light
Sets intensity of the light
%End
bool operator==( const QgsDirectionalLightSettings &other ) const;
bool operator==( const QgsDirectionalLightSettings &other );
};

View File

@ -95,7 +95,7 @@ Returns quadratic attenuation (A_2)
Sets quadratic attenuation (A_2)
%End
bool operator==( const QgsPointLightSettings &other ) const;
bool operator==( const QgsPointLightSettings &other );
};

View File

@ -659,9 +659,6 @@ class Repositories(QObject):
.strip()
)
if not qgisMaximumVersion:
if qgisMinimumVersion[0] == "3" and supports_qt6:
qgisMaximumVersion = "4.99"
else:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
# if compatible, add the plugin to the list
if not pluginNodes.item(i).firstChildElement(
@ -848,9 +845,6 @@ class Plugins(QObject):
qgisMinimumVersion = "0"
qgisMaximumVersion = pluginMetadata("qgisMaximumVersion").strip()
if not qgisMaximumVersion:
if qgisMinimumVersion[0] == "3" and supports_qt6:
qgisMaximumVersion = "4.99"
else:
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
# if compatible, add the plugin to the list
if not isCompatible(

View File

@ -64,7 +64,7 @@ void QgsDirectionalLightSettings::readXml( const QDomElement &elem, const QgsRea
mIntensity = elem.attribute( QStringLiteral( "intensity" ) ).toFloat();
}
bool QgsDirectionalLightSettings::operator==( const QgsDirectionalLightSettings &other ) const
bool QgsDirectionalLightSettings::operator==( const QgsDirectionalLightSettings &other )
{
return mDirection == other.mDirection && mColor == other.mColor && mIntensity == other.mIntensity;
}

View File

@ -58,7 +58,7 @@ class _3D_EXPORT QgsDirectionalLightSettings : public QgsLightSource
void setIntensity( float intensity ) { mIntensity = intensity; }
// TODO c++20 - replace with = default
bool operator==( const QgsDirectionalLightSettings &other ) const;
bool operator==( const QgsDirectionalLightSettings &other );
private:
QgsVector3D mDirection { -0.32, 0.27, -0.91 };

View File

@ -107,7 +107,7 @@ void QgsPointLightSettings::readXml( const QDomElement &elem, const QgsReadWrite
mQuadraticAttenuation = elem.attribute( QStringLiteral( "attenuation-2" ) ).toDouble();
}
bool QgsPointLightSettings::operator==( const QgsPointLightSettings &other ) const
bool QgsPointLightSettings::operator==( const QgsPointLightSettings &other )
{
return mPosition == other.mPosition && mColor == other.mColor && mIntensity == other.mIntensity && mConstantAttenuation == other.mConstantAttenuation && mLinearAttenuation == other.mLinearAttenuation && mQuadraticAttenuation == other.mQuadraticAttenuation;
}

View File

@ -79,7 +79,7 @@ class _3D_EXPORT QgsPointLightSettings : public QgsLightSource
void setQuadraticAttenuation( float value ) { mQuadraticAttenuation = value; }
// TODO c++20 - replace with = default
bool operator==( const QgsPointLightSettings &other ) const;
bool operator==( const QgsPointLightSettings &other );
private:
QgsVector3D mPosition { 0, 0, 1000 };

View File

@ -66,7 +66,7 @@ Qgs3DMapCanvas::Qgs3DMapCanvas()
const QgsSettings setting;
mEngine = new QgsWindow3DEngine( this );
connect( mEngine, &QgsAbstract3DEngine::imageCaptured, this, [this]( const QImage &image ) {
connect( mEngine, &QgsAbstract3DEngine::imageCaptured, this, [=]( const QImage &image ) {
if ( image.save( mCaptureFileName, mCaptureFileFormat.toLocal8Bit().data() ) )
{
emit savedAsImage( mCaptureFileName );
@ -169,7 +169,7 @@ void Qgs3DMapCanvas::setMapSettings( Qgs3DMapSettings *mapSettings )
resetView();
connect( cameraController(), &QgsCameraController::setCursorPosition, this, [this]( QPoint point ) {
connect( cameraController(), &QgsCameraController::setCursorPosition, this, [=]( QPoint point ) {
QCursor::setPos( mapToGlobal( point ) );
} );
connect( cameraController(), &QgsCameraController::cameraMovementSpeedChanged, mMapSettings, &Qgs3DMapSettings::setCameraMovementSpeed );
@ -216,7 +216,7 @@ void Qgs3DMapCanvas::saveAsImage( const QString &fileName, const QString &fileFo
Qt3DLogic::QFrameAction *screenCaptureFrameAction = new Qt3DLogic::QFrameAction;
mScene->addComponent( screenCaptureFrameAction );
// Wait to have the render capture enabled in the next frame
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [this, screenCaptureFrameAction]( float ) {
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [=]( float ) {
mEngine->requestCaptureImage();
mScene->removeComponent( screenCaptureFrameAction );
screenCaptureFrameAction->deleteLater();
@ -232,7 +232,7 @@ void Qgs3DMapCanvas::captureDepthBuffer()
Qt3DLogic::QFrameAction *screenCaptureFrameAction = new Qt3DLogic::QFrameAction;
mScene->addComponent( screenCaptureFrameAction );
// Wait to have the render capture enabled in the next frame
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [this, screenCaptureFrameAction]( float ) {
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [=]( float ) {
mEngine->requestDepthBufferCapture();
mScene->removeComponent( screenCaptureFrameAction );
screenCaptureFrameAction->deleteLater();

View File

@ -159,7 +159,7 @@ Qgs3DMapScene::Qgs3DMapScene( Qgs3DMapSettings &map, QgsAbstract3DEngine *engine
connect( &map, &Qgs3DMapSettings::originChanged, this, &Qgs3DMapScene::onOriginChanged );
connect( QgsApplication::sourceCache(), &QgsSourceCache::remoteSourceFetched, this, [this]( const QString &url ) {
connect( QgsApplication::sourceCache(), &QgsSourceCache::remoteSourceFetched, this, [=]( const QString &url ) {
const QList<QgsMapLayer *> modelVectorLayers = mModelVectorLayers;
for ( QgsMapLayer *layer : modelVectorLayers )
{

View File

@ -33,7 +33,7 @@ void QgsAbstract3DEngine::requestCaptureImage()
mFrameGraph->setRenderCaptureEnabled( true );
captureReply = mFrameGraph->renderCapture()->requestCapture();
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [this, captureReply] {
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [=] {
emit imageCaptured( captureReply->image() );
captureReply->deleteLater();
mFrameGraph->setRenderCaptureEnabled( false );
@ -45,7 +45,7 @@ void QgsAbstract3DEngine::requestDepthBufferCapture()
Qt3DRender::QRenderCaptureReply *captureReply;
captureReply = mFrameGraph->depthRenderCapture()->requestCapture();
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [this, captureReply] {
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [=] {
emit depthBufferCaptured( captureReply->image() );
captureReply->deleteLater();
} );

View File

@ -522,8 +522,8 @@ void QgsCameraController::onPositionChangedTerrainNavigation( Qt3DInput::QMouseE
const int dx = mouse->x() - mMousePos.x();
const int dy = mouse->y() - mMousePos.y();
const bool hasShift = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ShiftModifier );
const bool hasCtrl = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier );
const bool hasShift = ( mouse->modifiers() & Qt::ShiftModifier );
const bool hasCtrl = ( mouse->modifiers() & Qt::ControlModifier );
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
const bool hasRightButton = ( mouse->buttons() & Qt::RightButton );
@ -676,8 +676,8 @@ void QgsCameraController::onPositionChangedTerrainNavigation( Qt3DInput::QMouseE
void QgsCameraController::onPositionChangedGlobeTerrainNavigation( Qt3DInput::QMouseEvent *mouse )
{
const bool hasShift = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ShiftModifier );
const bool hasCtrl = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier );
const bool hasShift = ( mouse->modifiers() & Qt::ShiftModifier );
const bool hasCtrl = ( mouse->modifiers() & Qt::ControlModifier );
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
@ -815,7 +815,7 @@ void QgsCameraController::onWheel( Qt3DInput::QWheelEvent *wheel )
{
case Qgis::NavigationMode::Walk:
{
const float scaling = ( ( wheel->modifiers() & Qt3DInput::QWheelEvent::Modifiers::ControlModifier ) != 0 ? 0.1f : 1.0f ) / 1000.f;
const float scaling = ( ( wheel->modifiers() & Qt::ControlModifier ) != 0 ? 0.1f : 1.0f ) / 1000.f;
setCameraMovementSpeed( mCameraMovementSpeed + mCameraMovementSpeed * scaling * wheel->angleDelta().y() );
break;
}
@ -824,7 +824,7 @@ void QgsCameraController::onWheel( Qt3DInput::QWheelEvent *wheel )
{
// Scale our variable to roughly "number of normal steps", with Ctrl
// increasing granularity 10x
const double scaling = ( 1.0 / 120.0 ) * ( ( wheel->modifiers() & Qt3DInput::QWheelEvent::Modifiers::ControlModifier ) != 0 ? 0.1 : 1.0 );
const double scaling = ( 1.0 / 120.0 ) * ( ( wheel->modifiers() & Qt::ControlModifier ) != 0 ? 0.1 : 1.0 );
// Apparently angleDelta needs to be accumulated
// see: https://doc.qt.io/qt-5/qwheelevent.html#angleDelta
@ -861,7 +861,7 @@ void QgsCameraController::onMousePressed( Qt3DInput::QMouseEvent *mouse )
mKeyboardHandler->setFocus( true );
if ( mouse->button() == Qt3DInput::QMouseEvent::MiddleButton || ( ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ShiftModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ) || ( ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ) )
if ( mouse->button() == Qt3DInput::QMouseEvent::MiddleButton || ( ( mouse->modifiers() & Qt::ShiftModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ) || ( ( mouse->modifiers() & Qt::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ) )
{
mMousePos = QPoint( mouse->x(), mouse->y() );
@ -869,7 +869,7 @@ void QgsCameraController::onMousePressed( Qt3DInput::QMouseEvent *mouse )
mIgnoreNextMouseMove = true;
const MouseOperation operation {
( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ? MouseOperation::RotationCamera : MouseOperation::RotationCenter
( mouse->modifiers() & Qt::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ? MouseOperation::RotationCamera : MouseOperation::RotationCenter
};
setMouseParameters( operation, mMousePos );
}

View File

@ -278,7 +278,7 @@ class QgsGlobeChunkLoader : public QgsChunkLoader
, mTextureGenerator( textureGenerator )
, mGlobeCrsToLatLon( globeCrsToLatLon )
{
connect( mTextureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [this]( int job, const QImage &img ) {
connect( mTextureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [=]( int job, const QImage &img ) {
if ( job == mJobId )
{
mTexture = img;
@ -436,7 +436,7 @@ class QgsGlobeMapUpdateJob : public QgsChunkQueueJob
QgsTerrainTextureImage *terrainTexImage = qobject_cast<QgsTerrainTextureImage *>( texImages[0] );
Q_ASSERT( terrainTexImage );
connect( textureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [this, terrainTexImage]( int jobId, const QImage &image ) {
connect( textureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [=]( int jobId, const QImage &image ) {
if ( mJobId == jobId )
{
terrainTexImage->setImage( image );
@ -487,7 +487,7 @@ class QgsGlobeMapUpdateJobFactory : public QgsChunkQueueJobFactory
QgsGlobeEntity::QgsGlobeEntity( Qgs3DMapSettings *mapSettings )
: QgsChunkedEntity( mapSettings, mapSettings->terrainSettings()->maximumScreenError(), new QgsGlobeChunkLoaderFactory( mapSettings ), true )
{
connect( mapSettings, &Qgs3DMapSettings::showTerrainBoundingBoxesChanged, this, [this, mapSettings] {
connect( mapSettings, &Qgs3DMapSettings::showTerrainBoundingBoxesChanged, this, [=] {
setShowBoundingBoxes( mapSettings->showTerrainBoundingBoxes() );
} );
connect( mapSettings, &Qgs3DMapSettings::showTerrainTilesInfoChanged, this, &QgsGlobeEntity::invalidateMapImages );

View File

@ -135,7 +135,7 @@ bool QgsVectorWarperTask::run()
QgsVectorWarper warper( mMethod, mPoints, mDestinationCrs );
connect( mFeedback.get(), &QgsFeedback::processedCountChanged, this, [this]( long long count ) {
connect( mFeedback.get(), &QgsFeedback::processedCountChanged, this, [=]( long long count ) {
const double newProgress = 100.0 * count / mFeatureCount;
// avoid flooding with too many events
if ( static_cast<int>( newProgress * 10 ) != static_cast<int>( mLastProgress * 10 ) )

View File

@ -73,10 +73,10 @@ QVariantMap QgsPdalInformationAlgorithm::processAlgorithm( const QVariantMap &pa
QStringList commandOutput;
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
wrenchProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
wrenchProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba.trimmed() );
} );
wrenchProcess.setStdOutHandler( [feedback, &commandOutput]( const QByteArray &ba ) {
wrenchProcess.setStdOutHandler( [=, &commandOutput]( const QByteArray &ba ) {
feedback->pushConsoleInfo( ba.trimmed() );
commandOutput << ba;
} );

View File

@ -189,10 +189,10 @@ QVariantMap QgsPdalAlgorithmBase::processAlgorithm( const QVariantMap &parameter
QString buffer;
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
wrenchProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
wrenchProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba.trimmed() );
} );
wrenchProcess.setStdOutHandler( [feedback, &progress, &buffer]( const QByteArray &ba ) {
wrenchProcess.setStdOutHandler( [=, &progress, &buffer]( const QByteArray &ba ) {
QString data( ba );
QRegularExpression re( "\\.*(\\d+)?\\.*$" );

View File

@ -137,7 +137,7 @@ QgsFeatureList QgsDrapeAlgorithmBase::processFeature( const QgsFeature &feature,
// a pointless iteration over all vertices
if ( !mRasterExtent.isNull() && geometry.boundingBoxIntersects( mRasterExtent ) )
{
geometry.transformVertices( [this, nodata, scale, offset, feedback, &f]( const QgsPoint &p ) -> QgsPoint {
geometry.transformVertices( [=]( const QgsPoint &p ) -> QgsPoint {
QgsPointXY t;
double val = nodata;
try

View File

@ -111,10 +111,10 @@ QVariantMap QgsConvertGpxFeatureTypeAlgorithm::processAlgorithm( const QVariantM
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + babelPath + ' ' + logArgs.join( ' ' ) );
QgsBlockingProcess babelProcess( babelPath, processArgs );
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba );
} );
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
feedback->pushDebugInfo( ba );
} );
@ -355,10 +355,10 @@ QVariantMap QgsConvertGpsDataAlgorithm::processAlgorithm( const QVariantMap &par
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + logCommand.join( ' ' ) );
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba );
} );
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
feedback->pushDebugInfo( ba );
} );
@ -576,10 +576,10 @@ QVariantMap QgsDownloadGpsDataAlgorithm::processAlgorithm( const QVariantMap &pa
feedback->pushCommandInfo( QObject::tr( "Download command: " ) + logCommand.join( ' ' ) );
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba );
} );
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
feedback->pushDebugInfo( ba );
} );
@ -796,10 +796,10 @@ QVariantMap QgsUploadGpsDataAlgorithm::processAlgorithm( const QVariantMap &para
feedback->pushCommandInfo( QObject::tr( "Upload command: " ) + logCommand.join( ' ' ) );
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
feedback->reportError( ba );
} );
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
feedback->pushDebugInfo( ba );
} );

View File

@ -142,7 +142,7 @@ QVariantMap QgsPackageAlgorithm::processAlgorithm( const QVariantMap &parameters
int recursionGuard { 0 };
// This function recursively finds referenced layers
const auto findReferenced = [this, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferenced ) -> void {
const auto findReferenced = [=, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferenced ) -> void {
const QgsVectorLayer *originalLayer { qobject_cast<QgsVectorLayer *>( project->mapLayer( mClonedLayerIds.value( vLayer->id(), vLayer->id() ) ) ) };
Q_ASSERT( originalLayer );
const QList<QgsRelation> relations { project->relationManager()->referencingRelations( originalLayer ) };
@ -208,7 +208,7 @@ QVariantMap QgsPackageAlgorithm::processAlgorithm( const QVariantMap &parameters
};
// This function recursively finds referencing layers
const auto findReferencing = [this, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferencing ) -> void {
const auto findReferencing = [=, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferencing ) -> void {
const QgsVectorLayer *originalLayer { qobject_cast<QgsVectorLayer *>( project->mapLayer( mClonedLayerIds.value( vLayer->id(), vLayer->id() ) ) ) };
Q_ASSERT( originalLayer );
const QList<QgsRelation> relations { project->relationManager()->referencedRelations( originalLayer ) };

View File

@ -179,7 +179,7 @@ QVariantMap QgsRasterBooleanLogicAlgorithmBase::processAlgorithm( const QVariant
QgsRasterLogicalOrAlgorithm::QgsRasterLogicalOrAlgorithm()
{
mExtractValFunc = []( const std::vector<std::unique_ptr<QgsRasterBlock>> &inputs, bool &res, bool &resIsNoData, int row, int column, bool treatNoDataAsFalse ) {
mExtractValFunc = [=]( const std::vector<std::unique_ptr<QgsRasterBlock>> &inputs, bool &res, bool &resIsNoData, int row, int column, bool treatNoDataAsFalse ) {
res = false;
resIsNoData = false;
bool isNoData = false;
@ -252,7 +252,7 @@ QgsRasterLogicalOrAlgorithm *QgsRasterLogicalOrAlgorithm::createInstance() const
QgsRasterLogicalAndAlgorithm::QgsRasterLogicalAndAlgorithm()
{
mExtractValFunc = []( const std::vector<std::unique_ptr<QgsRasterBlock>> &inputs, bool &res, bool &resIsNoData, int row, int column, bool treatNoDataAsFalse ) {
mExtractValFunc = [=]( const std::vector<std::unique_ptr<QgsRasterBlock>> &inputs, bool &res, bool &resIsNoData, int row, int column, bool treatNoDataAsFalse ) {
res = true;
resIsNoData = false;
bool isNoData = false;

View File

@ -40,7 +40,7 @@ Qgs3DAnimationExportDialog::Qgs3DAnimationExportDialog()
QValidator *validator = new QRegularExpressionValidator( rx, this );
mTemplateLineEdit->setValidator( validator );
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [this] {
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "Export3DAnimation/fileNameTemplate" ), mTemplateLineEdit->text() );
} );
@ -51,30 +51,30 @@ Qgs3DAnimationExportDialog::Qgs3DAnimationExportDialog()
mOutputDirFileWidget->setDefaultRoot( settings.value( QStringLiteral( "Export3DAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
mOutputDirFileWidget->setFilePath( settings.value( QStringLiteral( "Export3DAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [this] {
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "Export3DAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
} );
mFpsSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/fps" ), 30 ).toInt() );
connect( mFpsSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
connect( mFpsSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "Export3DAnimation/fps" ), mFpsSpinBox->value() );
} );
mWidthSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/width" ), 800 ).toInt() );
connect( mWidthSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
connect( mWidthSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "Export3DAnimation/width" ), mWidthSpinBox->value() );
} );
mHeightSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/height" ), 600 ).toInt() );
connect( mHeightSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
connect( mHeightSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "Export3DAnimation/height" ), mHeightSpinBox->value() );
} );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html#create-animation" ) );
} );

View File

@ -75,29 +75,29 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
whileBlocking( chkStopUpdates )->setChecked( mMap->stopUpdates() );
whileBlocking( chkStopOriginShifts )->setChecked( !m3DMapCanvas->scene()->hasSceneOriginShiftEnabled() );
whileBlocking( chkDebugOverlay )->setChecked( mMap->isDebugOverlayEnabled() );
connect( chkShowTileInfo, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowTerrainTilesInfo( enabled ); } );
connect( chkShowBoundingBoxes, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowTerrainBoundingBoxes( enabled ); } );
connect( chkShowCameraViewCenter, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowCameraViewCenter( enabled ); } );
connect( chkShowCameraRotationCenter, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowCameraRotationCenter( enabled ); } );
connect( chkShowLightSourceOrigins, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowLightSourceOrigins( enabled ); } );
connect( chkStopUpdates, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setStopUpdates( enabled ); } );
connect( chkStopOriginShifts, &QCheckBox::toggled, this, [this]( const bool enabled ) {
connect( chkShowTileInfo, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowTerrainTilesInfo( enabled ); } );
connect( chkShowBoundingBoxes, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowTerrainBoundingBoxes( enabled ); } );
connect( chkShowCameraViewCenter, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowCameraViewCenter( enabled ); } );
connect( chkShowCameraRotationCenter, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowCameraRotationCenter( enabled ); } );
connect( chkShowLightSourceOrigins, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowLightSourceOrigins( enabled ); } );
connect( chkStopUpdates, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setStopUpdates( enabled ); } );
connect( chkStopOriginShifts, &QCheckBox::toggled, this, [=]( const bool enabled ) {
m3DMapCanvas->scene()->setSceneOriginShiftEnabled( !enabled );
} );
connect( chkDebugOverlay, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setIsDebugOverlayEnabled( enabled ); } );
connect( chkDebugOverlay, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setIsDebugOverlayEnabled( enabled ); } );
// set up the shadow map block
whileBlocking( mDebugShadowMapGroupBox )->setChecked( mMap->debugShadowMapEnabled() );
whileBlocking( mDebugShadowMapCornerComboBox )->setCurrentIndex( mMap->debugShadowMapCorner() );
whileBlocking( mDebugShadowMapSizeSpinBox )->setValue( mMap->debugShadowMapSize() );
// Do not display the shadow debug map if the shadow effect is not enabled.
connect( mDebugShadowMapGroupBox, &QGroupBox::toggled, this, [this]( const bool enabled ) {
connect( mDebugShadowMapGroupBox, &QGroupBox::toggled, this, [=]( const bool enabled ) {
mMap->setDebugShadowMapSettings( enabled && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );
} );
connect( mDebugShadowMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( const int index ) {
connect( mDebugShadowMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( const int index ) {
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( index ), mDebugShadowMapSizeSpinBox->value() );
} );
connect( mDebugShadowMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mDebugShadowMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), value );
} );
@ -105,39 +105,39 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
whileBlocking( mDebugDepthMapGroupBox )->setChecked( mMap->debugDepthMapEnabled() );
whileBlocking( mDebugDepthMapCornerComboBox )->setCurrentIndex( mMap->debugDepthMapCorner() );
whileBlocking( mDebugDepthMapSizeSpinBox )->setValue( mMap->debugDepthMapSize() );
connect( mDebugDepthMapGroupBox, &QGroupBox::toggled, this, [this]( const bool enabled ) {
connect( mDebugDepthMapGroupBox, &QGroupBox::toggled, this, [=]( const bool enabled ) {
mMap->setDebugDepthMapSettings( enabled, static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() );
} );
connect( mDebugDepthMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( const int index ) {
connect( mDebugDepthMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( const int index ) {
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( index ), mDebugDepthMapSizeSpinBox->value() );
} );
connect( mDebugDepthMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mDebugDepthMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), value );
} );
// connect the camera info spin boxes with changing functions
connect( mNearPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mNearPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
m3DMapCanvas->cameraController()->camera()->setNearPlane( static_cast<float>( value ) );
} );
connect( mFarPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mFarPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
m3DMapCanvas->cameraController()->camera()->setFarPlane( static_cast<float>( value ) );
} );
connect( mCameraX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mCameraX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
newPosition.setX( static_cast<float>( value ) );
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
} );
connect( mCameraY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mCameraY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
newPosition.setY( static_cast<float>( value ) );
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
} );
connect( mCameraZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mCameraZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
newPosition.setZ( static_cast<float>( value ) );
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
} );
connect( mLookingX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mLookingX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
newLookingAt.setX( value );
m3DMapCanvas->cameraController()->setLookingAtPoint(
@ -147,7 +147,7 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
m3DMapCanvas->cameraController()->yaw()
);
} );
connect( mLookingY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mLookingY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
newLookingAt.setY( value );
m3DMapCanvas->cameraController()->setLookingAtPoint(
@ -157,7 +157,7 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
m3DMapCanvas->cameraController()->yaw()
);
} );
connect( mLookingZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
connect( mLookingZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
newLookingAt.setZ( value );
m3DMapCanvas->cameraController()->setLookingAtPoint(

View File

@ -230,7 +230,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mActionSync2DNavTo3D = new QAction( tr( "2D Map View Follows 3D Camera" ), this );
mActionSync2DNavTo3D->setCheckable( true );
connect( mActionSync2DNavTo3D, &QAction::triggered, this, [this]( bool enabled ) {
connect( mActionSync2DNavTo3D, &QAction::triggered, this, [=]( bool enabled ) {
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync2DTo3D, enabled );
mCanvas->mapSettings()->setViewSyncMode( syncMode );
@ -239,7 +239,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mActionSync3DNavTo2D = new QAction( tr( "3D Camera Follows 2D Map View" ), this );
mActionSync3DNavTo2D->setCheckable( true );
connect( mActionSync3DNavTo2D, &QAction::triggered, this, [this]( bool enabled ) {
connect( mActionSync3DNavTo2D, &QAction::triggered, this, [=]( bool enabled ) {
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync3DTo2D, enabled );
mCanvas->mapSettings()->setViewSyncMode( syncMode );
@ -248,14 +248,14 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mShowFrustumPolygon = new QAction( tr( "Show Visible Camera Area in 2D Map View" ), this );
mShowFrustumPolygon->setCheckable( true );
connect( mShowFrustumPolygon, &QAction::triggered, this, [this]( bool enabled ) {
connect( mShowFrustumPolygon, &QAction::triggered, this, [=]( bool enabled ) {
mCanvas->mapSettings()->setViewFrustumVisualizationEnabled( enabled );
} );
mCameraMenu->addAction( mShowFrustumPolygon );
mActionSetSceneExtent = mCameraMenu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "extents.svg" ) ), tr( "Set 3D Scene Extent on 2D Map View" ), this, &Qgs3DMapCanvasWidget::setSceneExtentOn2DCanvas );
mActionSetSceneExtent->setCheckable( true );
auto createShortcuts = [this]( const QString &objectName, void ( Qgs3DMapCanvasWidget::*slot )() ) {
auto createShortcuts = [=]( const QString &objectName, void ( Qgs3DMapCanvasWidget::*slot )() ) {
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
connect( sc, &QShortcut::activated, this, slot );
};
@ -277,7 +277,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mActionEnableShadows = new QAction( tr( "Show Shadows" ), this );
mActionEnableShadows->setCheckable( true );
connect( mActionEnableShadows, &QAction::toggled, this, [this]( bool enabled ) {
connect( mActionEnableShadows, &QAction::toggled, this, [=]( bool enabled ) {
QgsShadowSettings settings = mCanvas->mapSettings()->shadowSettings();
settings.setRenderShadows( enabled );
mCanvas->mapSettings()->setShadowSettings( settings );
@ -286,14 +286,14 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mActionEnableEyeDome = new QAction( tr( "Show Eye Dome Lighting" ), this );
mActionEnableEyeDome->setCheckable( true );
connect( mActionEnableEyeDome, &QAction::triggered, this, [this]( bool enabled ) {
connect( mActionEnableEyeDome, &QAction::triggered, this, [=]( bool enabled ) {
mCanvas->mapSettings()->setEyeDomeLightingEnabled( enabled );
} );
mEffectsMenu->addAction( mActionEnableEyeDome );
mActionEnableAmbientOcclusion = new QAction( tr( "Show Ambient Occlusion" ), this );
mActionEnableAmbientOcclusion->setCheckable( true );
connect( mActionEnableAmbientOcclusion, &QAction::triggered, this, [this]( bool enabled ) {
connect( mActionEnableAmbientOcclusion, &QAction::triggered, this, [=]( bool enabled ) {
QgsAmbientOcclusionSettings ambientOcclusionSettings = mCanvas->mapSettings()->ambientOcclusionSettings();
ambientOcclusionSettings.setEnabled( enabled );
mCanvas->mapSettings()->setAmbientOcclusionSettings( ambientOcclusionSettings );
@ -308,7 +308,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mCanvas = new Qgs3DMapCanvas;
mCanvas->setMinimumSize( QSize( 200, 200 ) );
connect( mCanvas, &Qgs3DMapCanvas::savedAsImage, this, []( const QString &fileName ) {
connect( mCanvas, &Qgs3DMapCanvas::savedAsImage, this, [=]( const QString &fileName ) {
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as Image" ), tr( "Successfully saved the 3D map to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fileName ).toString(), QDir::toNativeSeparators( fileName ) ) );
} );
@ -353,7 +353,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
mLabelNavSpeedHideTimeout = new QTimer( this );
mLabelNavSpeedHideTimeout->setInterval( 1000 );
connect( mLabelNavSpeedHideTimeout, &QTimer::timeout, this, [this] {
connect( mLabelNavSpeedHideTimeout, &QTimer::timeout, this, [=] {
mLabelNavigationSpeed->hide();
mLabelNavSpeedHideTimeout->stop();
} );
@ -404,10 +404,10 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
}
QAction *dockAction = mDockableWidgetHelper->createDockUndockAction( tr( "Dock 3D Map View" ), this );
toolBar->addAction( dockAction );
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
QgisApp::instance()->close3DMapView( canvasName() );
} );
connect( dockAction, &QAction::toggled, this, [toolBar]( const bool isSmallSize ) {
connect( dockAction, &QAction::toggled, this, [=]( const bool isSmallSize ) {
toolBar->setIconSize( QgisApp::instance()->iconSize( isSmallSize ) );
} );
@ -769,7 +769,7 @@ void Qgs3DMapCanvasWidget::configure()
Qgs3DMapConfigWidget *w = new Qgs3DMapConfigWidget( map, mMainCanvas, mCanvas, mConfigureDialog );
QDialogButtonBox *buttons = new QDialogButtonBox( QDialogButtonBox::Apply | QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, mConfigureDialog );
auto applyConfig = [this, map, w]() {
auto applyConfig = [=]() {
const QgsVector3D oldOrigin = map->origin();
const QgsCoordinateReferenceSystem oldCrs = map->crs();
const QgsCameraPose oldCameraPose = mCanvas->cameraController()->cameraPose();
@ -797,7 +797,7 @@ void Qgs3DMapCanvasWidget::configure()
};
connect( buttons, &QDialogButtonBox::rejected, mConfigureDialog, &QDialog::reject );
connect( buttons, &QDialogButtonBox::clicked, mConfigureDialog, [this, buttons, applyConfig]( QAbstractButton *button ) {
connect( buttons, &QDialogButtonBox::clicked, mConfigureDialog, [=]( QAbstractButton *button ) {
if ( button == buttons->button( QDialogButtonBox::Apply ) || button == buttons->button( QDialogButtonBox::Ok ) )
applyConfig();
if ( button == buttons->button( QDialogButtonBox::Ok ) )
@ -805,7 +805,7 @@ void Qgs3DMapCanvasWidget::configure()
} );
connect( buttons, &QDialogButtonBox::helpRequested, w, []() { QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html#scene-configuration" ) ); } );
connect( w, &Qgs3DMapConfigWidget::isValidChanged, this, [buttons]( bool valid ) {
connect( w, &Qgs3DMapConfigWidget::isValidChanged, this, [=]( bool valid ) {
buttons->button( QDialogButtonBox::Apply )->setEnabled( valid );
buttons->button( QDialogButtonBox::Ok )->setEnabled( valid );
} );
@ -838,7 +838,7 @@ void Qgs3DMapCanvasWidget::exportScene()
connect( buttons, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttons, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
connect( buttons, &QDialogButtonBox::helpRequested, &dlg, [] { QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html" ) ); } );
connect( buttons, &QDialogButtonBox::helpRequested, &dlg, [=] { QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html" ) ); } );
QVBoxLayout *layout = new QVBoxLayout( &dlg );
layout->addWidget( &exportWidget, 1 );
@ -902,7 +902,7 @@ void Qgs3DMapCanvasWidget::mapThemeMenuAboutToShow()
{
actionFollowMain->setChecked( true );
}
connect( actionFollowMain, &QAction::triggered, this, [this] {
connect( actionFollowMain, &QAction::triggered, this, [=] {
mCanvas->mapSettings()->setTerrainMapTheme( QString() );
} );
mMapThemeMenuPresetActions.append( actionFollowMain );

View File

@ -59,7 +59,7 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
// get rid of annoying outer focus rect on Mac
m3DOptionsListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );
m3DOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/3DMapConfig/Tab" ), 0 ).toInt() );
connect( m3DOptionsListWidget, &QListWidget::currentRowChanged, this, [this]( int index ) { m3DOptionsStackedWidget->setCurrentIndex( index ); } );
connect( m3DOptionsListWidget, &QListWidget::currentRowChanged, this, [=]( int index ) { m3DOptionsStackedWidget->setCurrentIndex( index ); } );
m3DOptionsStackedWidget->setCurrentIndex( m3DOptionsListWidget->currentRow() );
if ( !settings.contains( QStringLiteral( "Windows/3DMapConfig/OptionsSplitState" ) ) )
@ -76,7 +76,7 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
cboCameraProjectionType->addItem( tr( "Perspective Projection" ), Qt3DRender::QCameraLens::PerspectiveProjection );
cboCameraProjectionType->addItem( tr( "Orthogonal Projection" ), Qt3DRender::QCameraLens::OrthographicProjection );
connect( cboCameraProjectionType, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]() {
connect( cboCameraProjectionType, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]() {
spinCameraFieldOfView->setEnabled( cboCameraProjectionType->currentIndex() == cboCameraProjectionType->findData( Qt3DRender::QCameraLens::PerspectiveProjection ) );
} );

View File

@ -47,7 +47,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mZoomInButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeZoom( ZOOM_FACTOR );
@ -61,7 +61,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mZoomOutButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeZoom( 1 / ZOOM_FACTOR );
@ -75,7 +75,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mTiltUpButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( 1 );
}
);
@ -85,7 +85,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mTiltDownButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( -1 );
}
);
@ -98,7 +98,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mCompass,
&QwtDial::valueChanged,
m3DMapCanvas,
[this] {
[=] {
m3DMapCanvas->cameraController()->setCameraHeadingAngle( float( mCompass->value() ) );
}
);
@ -108,7 +108,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mMoveUpButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeMoveCenterPoint( MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
@ -122,7 +122,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mMoveRightButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeMoveCenterPoint( 0, MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );
@ -136,7 +136,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mMoveDownButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeMoveCenterPoint( -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
@ -150,7 +150,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
mMoveLeftButton,
&QToolButton::clicked,
m3DMapCanvas,
[this] {
[=] {
QgsCameraController *controller = m3DMapCanvas->cameraController();
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
controller->globeMoveCenterPoint( 0, -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );

View File

@ -38,14 +38,14 @@ QgsMap3DExportWidget::QgsMap3DExportWidget( Qgs3DMapScene *scene, Qgs3DMapExport
loadSettings();
connect( ui->sceneNameLineEdit, &QLineEdit::textChanged, this, [this]( const QString & ) { settingsChanged(); } );
connect( ui->selectFolderWidget, &QgsFileWidget::fileChanged, this, [this]( const QString & ) { settingsChanged(); } );
connect( ui->smoothEdgesCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
connect( ui->terrainResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
connect( ui->exportNormalsCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
connect( ui->exportTexturesCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
connect( ui->terrainTextureResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
connect( ui->scaleSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
connect( ui->sceneNameLineEdit, &QLineEdit::textChanged, this, [=]( const QString & ) { settingsChanged(); } );
connect( ui->selectFolderWidget, &QgsFileWidget::fileChanged, this, [=]( const QString & ) { settingsChanged(); } );
connect( ui->smoothEdgesCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
connect( ui->terrainResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
connect( ui->exportNormalsCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
connect( ui->exportTexturesCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
connect( ui->terrainTextureResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
connect( ui->scaleSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
// sets the export settings to whatever is on the scene
settingsChanged();

View File

@ -30,11 +30,11 @@ QgsMetalRoughMaterialWidget::QgsMetalRoughMaterialWidget( QWidget *parent, bool
setSettings( &defaultMaterial, nullptr );
connect( mButtonBaseColor, &QgsColorButton::colorChanged, this, &QgsMetalRoughMaterialWidget::changed );
connect( mSpinMetalness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
connect( mSpinMetalness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
updateWidgetState();
emit changed();
} );
connect( mSpinRoughness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
connect( mSpinRoughness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
updateWidgetState();
emit changed();
} );

View File

@ -34,7 +34,7 @@ QgsPhongMaterialWidget::QgsPhongMaterialWidget( QWidget *parent, bool hasOpacity
connect( btnDiffuse, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
updateWidgetState();
emit changed();
} );

View File

@ -33,7 +33,7 @@ QgsPhongTexturedMaterialWidget::QgsPhongTexturedMaterialWidget( QWidget *parent
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
updateWidgetState();
emit changed();
} );

View File

@ -587,8 +587,8 @@ Qgs3DRendererRulePropsWidget::Qgs3DRendererRulePropsWidget( QgsRuleBased3DRender
connect( editDescription, &QLineEdit::textChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
connect( groupSymbol, &QGroupBox::toggled, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
connect( mSymbolWidget, &QgsSymbol3DWidget::widgetChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
connect( mFilterRadio, &QRadioButton::toggled, this, [this]( bool toggled ) { filterFrame->setEnabled( toggled ); } );
connect( mElseRadio, &QRadioButton::toggled, this, [this]( bool toggled ) { if ( toggled ) editFilter->setText( QStringLiteral( "ELSE" ) ); } );
connect( mFilterRadio, &QRadioButton::toggled, this, [=]( bool toggled ) { filterFrame->setEnabled( toggled ); } );
connect( mElseRadio, &QRadioButton::toggled, this, [=]( bool toggled ) { if ( toggled ) editFilter->setText( QStringLiteral( "ELSE" ) ); } );
}
Qgs3DRendererRulePropsWidget::~Qgs3DRendererRulePropsWidget() = default;

View File

@ -93,7 +93,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QgsSettings settings;
QAction *actionRefresh = new QAction( tr( "Refresh" ), menu );
connect( actionRefresh, &QAction::triggered, this, [directoryItem] { directoryItem->refresh(); } );
connect( actionRefresh, &QAction::triggered, this, [=] { directoryItem->refresh(); } );
menu->addAction( actionRefresh );
menu->addSeparator();
@ -101,7 +101,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QMenu *newMenu = new QMenu( tr( "New" ), menu );
QAction *createFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFolder.svg" ) ), tr( "Directory…" ), menu );
connect( createFolder, &QAction::triggered, this, [directoryItem, context] {
connect( createFolder, &QAction::triggered, this, [=] {
bool ok = false;
const QString name = QInputDialog::getText( QgisApp::instance(), tr( "Create Directory" ), tr( "Directory name" ), QLineEdit::Normal, QString(), &ok );
@ -126,7 +126,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QAction *createGpkg = new QAction( tr( "GeoPackage…" ), newMenu );
createGpkg->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewGeoPackageLayer.svg" ) ) );
connect( createGpkg, &QAction::triggered, this, [directoryItem, context] {
connect( createGpkg, &QAction::triggered, this, [=] {
QDir dir( directoryItem->dirPath() );
QString newName = tr( "New GeoPackage.gpkg" );
int i = 1;
@ -175,7 +175,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QAction *createShp = new QAction( tr( "ShapeFile…" ), newMenu );
createShp->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewVectorLayer.svg" ) ) );
connect( createShp, &QAction::triggered, this, [directoryItem, item, context] {
connect( createShp, &QAction::triggered, this, [=] {
QString enc;
QDir dir( directoryItem->dirPath() );
QString error;
@ -195,7 +195,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION( 3, 6, 0 )
QAction *createFgdb = new QAction( tr( "ESRI FileGeodatabase…" ), newMenu );
createFgdb->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFileGeodatabase.svg" ) ) );
connect( createFgdb, &QAction::triggered, this, [directoryItem, context] {
connect( createFgdb, &QAction::triggered, this, [=] {
QDir dir( directoryItem->dirPath() );
QString newName = tr( "New File Geodatabase.gdb" );
int i = 1;
@ -254,7 +254,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QAction *addAsFavorite = new QAction( tr( "Add as a Favorite" ), menu );
addAsFavorite->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFavorites.svg" ) ) );
menu->addAction( addAsFavorite );
connect( addAsFavorite, &QAction::triggered, this, [this, directoryItem] {
connect( addAsFavorite, &QAction::triggered, this, [=] {
addFavorite( directoryItem );
} );
}
@ -263,13 +263,13 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
if ( QgsFavoriteItem *favoriteItem = qobject_cast<QgsFavoriteItem *>( item ) )
{
QAction *actionRename = new QAction( tr( "Rename Favorite…" ), menu );
connect( actionRename, &QAction::triggered, this, [this, favoriteItem] {
connect( actionRename, &QAction::triggered, this, [=] {
renameFavorite( favoriteItem );
} );
menu->addAction( actionRename );
QAction *removeFavoriteAction = new QAction( tr( "Remove Favorite" ), menu );
connect( removeFavoriteAction, &QAction::triggered, this, [this, favoriteItem] {
connect( removeFavoriteAction, &QAction::triggered, this, [=] {
removeFavorite( favoriteItem );
} );
menu->addAction( removeFavoriteAction );
@ -277,7 +277,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
}
}
QAction *hideAction = new QAction( tr( "Hide from Browser" ), menu );
connect( hideAction, &QAction::triggered, this, [this, directoryItem] {
connect( hideAction, &QAction::triggered, this, [=] {
hideDirectory( directoryItem );
} );
menu->addAction( hideAction );
@ -289,7 +289,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
for ( const QString &path : hiddenPathList )
{
QAction *action = new QAction( QDir::toNativeSeparators( path ), hiddenMenu );
connect( action, &QAction::triggered, this, [path] {
connect( action, &QAction::triggered, this, [=] {
QgsSettings s;
QStringList pathsList = s.value( QStringLiteral( "/browser/hiddenPaths" ) ).toStringList();
pathsList.removeAll( path );
@ -321,7 +321,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
hiddenMenu->addSeparator();
QAction *moreAction = new QAction( tr( "Show More…" ), hiddenMenu );
connect( moreAction, &QAction::triggered, this, [] {
connect( moreAction, &QAction::triggered, this, [=] {
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mOptionsPageDataSources" ) );
} );
hiddenMenu->addAction( moreAction );
@ -337,14 +337,14 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
const QPixmap icon = QgsColorButton::createMenuIcon( directoryItem->iconColor(), true );
actionSetIconColor->setIcon( icon );
}
connect( actionSetIconColor, &QAction::triggered, this, [this, directoryItem] {
connect( actionSetIconColor, &QAction::triggered, this, [=] {
changeDirectoryColor( directoryItem );
} );
menu->addAction( actionSetIconColor );
if ( directoryItem->iconColor().isValid() )
{
QAction *actionClearIconColor = new QAction( tr( "Clear Custom Color" ), menu );
connect( actionClearIconColor, &QAction::triggered, this, [this, directoryItem] {
connect( actionClearIconColor, &QAction::triggered, this, [=] {
clearDirectoryColor( directoryItem );
} );
menu->addAction( actionClearIconColor );
@ -353,7 +353,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QMenu *scanningMenu = new QMenu( tr( "Scanning" ), menu );
QAction *monitorAction = new QAction( tr( "Monitor for Changes" ), scanningMenu );
connect( monitorAction, &QAction::triggered, this, [this, directoryItem] {
connect( monitorAction, &QAction::triggered, this, [=] {
toggleMonitor( directoryItem );
} );
monitorAction->setCheckable( true );
@ -361,7 +361,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
scanningMenu->addAction( monitorAction );
QAction *fastScanAction = new QAction( tr( "Fast Scan this Directory" ), scanningMenu );
connect( fastScanAction, &QAction::triggered, this, [this, directoryItem] {
connect( fastScanAction, &QAction::triggered, this, [=] {
toggleFastScan( directoryItem );
} );
fastScanAction->setCheckable( true );
@ -373,7 +373,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
menu->addSeparator();
QAction *openFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mIconFolder.svg" ) ), tr( "Open Directory…" ), menu );
connect( openFolder, &QAction::triggered, this, [directoryItem] {
connect( openFolder, &QAction::triggered, this, [=] {
QDesktopServices::openUrl( QUrl::fromLocalFile( directoryItem->dirPath() ) );
} );
menu->addAction( openFolder );
@ -381,7 +381,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
if ( QgsGui::nativePlatformInterface()->capabilities() & QgsNative::NativeOpenTerminalAtPath )
{
QAction *openTerminal = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionTerminal.svg" ) ), tr( "Open in Terminal…" ), menu );
connect( openTerminal, &QAction::triggered, this, [directoryItem] {
connect( openTerminal, &QAction::triggered, this, [=] {
QgsGui::nativePlatformInterface()->openTerminalAtPath( directoryItem->dirPath() );
} );
menu->addAction( openTerminal );
@ -389,7 +389,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
}
QAction *propertiesAction = new QAction( tr( "Properties…" ), menu );
connect( propertiesAction, &QAction::triggered, this, [this, directoryItem, context] {
connect( propertiesAction, &QAction::triggered, this, [=] {
showProperties( directoryItem, context );
} );
menu->addAction( propertiesAction );
@ -513,7 +513,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
if ( !sourceSelectProviders.isEmpty() && sourceSelectProviders.first()->capabilities().testFlag( QgsSourceSelectProvider::Capability::ConfigureFromUri ) )
{
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
connect( openDataSourceManagerAction, &QAction::triggered, this, [layerItem] {
connect( openDataSourceManagerAction, &QAction::triggered, this, [=] {
QString pageName { layerItem->providerKey() };
// GPKG special handling
if ( qobject_cast<QgsGeoPackageVectorLayerItem *>( layerItem ) )
@ -537,7 +537,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
{
const QgsProviderSublayerDetails &sublayer { sublayers.first() };
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
connect( openDataSourceManagerAction, &QAction::triggered, this, [sublayer, layerItem] {
connect( openDataSourceManagerAction, &QAction::triggered, this, [=] {
QString pageName { sublayer.providerKey() };
// GPKG special handling
if ( sublayer.driverName() == QLatin1String( "GeoPackage" ) )
@ -587,7 +587,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
if ( fi.suffix().compare( ext, Qt::CaseInsensitive ) == 0 )
{
QAction *viewAction = new QAction( tr( "Open %1 Externally…" ).arg( name ), menu );
connect( viewAction, &QAction::triggered, this, [filename] {
connect( viewAction, &QAction::triggered, this, [=] {
QDesktopServices::openUrl( QUrl::fromLocalFile( filename ) );
} );
@ -646,7 +646,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
{
const QString renameText = tr( "Rename “%1”…" ).arg( fi.fileName() );
QAction *renameAction = new QAction( renameText, menu );
connect( renameAction, &QAction::triggered, this, [this, selectedFiles, context, selectedParents, menu] {
connect( renameAction, &QAction::triggered, this, [=] {
const QString oldPath = selectedFiles.value( 0 );
const QStringList existingNames = QFileInfo( oldPath ).dir().entryList();
@ -670,7 +670,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
const QString deleteText = selectedFiles.count() == 1 ? tr( "Delete “%1”…" ).arg( fi.fileName() )
: tr( "Delete Selected Files…" );
QAction *deleteAction = new QAction( deleteText, menu );
connect( deleteAction, &QAction::triggered, this, [selectedFiles, selectedParents, context] {
connect( deleteAction, &QAction::triggered, this, [=] {
// Check if the files correspond to paths in the project
QList<QgsMapLayer *> layersList;
for ( const QString &path : std::as_const( selectedFiles ) )
@ -810,12 +810,12 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
menu->addSeparator();
QAction *showInFilesAction = menu->addAction( tr( "Show in Files" ) );
connect( showInFilesAction, &QAction::triggered, this, [item] {
connect( showInFilesAction, &QAction::triggered, this, [=] {
QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( item->path() );
} );
QAction *filePropertiesAction = menu->addAction( tr( "File Properties…" ) );
connect( filePropertiesAction, &QAction::triggered, this, [item] {
connect( filePropertiesAction, &QAction::triggered, this, [=] {
QgsGui::nativePlatformInterface()->showFileProperties( item->path() );
} );
}
@ -939,7 +939,7 @@ void QgsProjectHomeItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
menu->insertSeparator( menu->actions().at( 0 ) );
QAction *setHome = new QAction( tr( "Set Project Home…" ), menu );
connect( setHome, &QAction::triggered, this, [] {
connect( setHome, &QAction::triggered, this, [=] {
QString oldHome = QgsProject::instance()->homePath();
QString newPath = QFileDialog::getExistingDirectory( QgisApp::instance(), tr( "Select Project Home Directory" ), oldHome );
if ( !newPath.isEmpty() )
@ -970,7 +970,7 @@ void QgsFavoritesItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
return;
QAction *addAction = new QAction( tr( "Add a Directory…" ), menu );
connect( addAction, &QAction::triggered, this, [] {
connect( addAction, &QAction::triggered, this, [=] {
QString directory = QFileDialog::getExistingDirectory( QgisApp::instance(), tr( "Add Directory to Favorites" ) );
if ( !directory.isEmpty() )
{
@ -1065,7 +1065,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
const QString deleteText = selectedDeletableItemPaths.count() == 1 ? tr( "Delete Layer “%1”…" ).arg( layerItem->name() )
: tr( "Delete Selected Layers…" );
QAction *deleteAction = new QAction( deleteText, menu );
connect( deleteAction, &QAction::triggered, this, [this, selectedDeletableItemPaths, context] {
connect( deleteAction, &QAction::triggered, this, [=] {
deleteLayers( selectedDeletableItemPaths, context );
} );
@ -1095,7 +1095,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
const QString addText = selectedItems.count() == 1 ? tr( "Add Layer to Project" )
: tr( "Add Selected Layers to Project" );
QAction *addAction = new QAction( addText, menu );
connect( addAction, &QAction::triggered, this, [this, selectedItems] {
connect( addAction, &QAction::triggered, this, [=] {
addLayersFromItems( selectedItems );
} );
menu->addAction( addAction );
@ -1117,7 +1117,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
}
QAction *propertiesAction = new QAction( tr( "Layer Properties…" ), menu );
connect( propertiesAction, &QAction::triggered, this, [this, layerItem, context] {
connect( propertiesAction, &QAction::triggered, this, [=] {
showPropertiesForItem( layerItem, context );
} );
menu->addAction( propertiesAction );
@ -2077,13 +2077,13 @@ bool QgsDatabaseItemGuiProvider::handleDrop( QgsDataItem *item, QgsDataItemGuiCo
mainTask->addSubTask( exportTask );
hasSubTasks = true;
// when export is successful:
connect( exportTask, &QgsVectorLayerExporterTask::exportComplete, item, [item, context]() {
connect( exportTask, &QgsVectorLayerExporterTask::exportComplete, item, [=]() {
notify( tr( "Import to database" ), tr( "Import was successful." ), context, Qgis::MessageLevel::Success );
item->refresh();
} );
// when an error occurs:
connect( exportTask, &QgsVectorLayerExporterTask::errorOccurred, item, []( Qgis::VectorExportResult error, const QString &errorMessage ) {
connect( exportTask, &QgsVectorLayerExporterTask::errorOccurred, item, [=]( Qgis::VectorExportResult error, const QString &errorMessage ) {
if ( error != Qgis::VectorExportResult::UserCanceled )
{
QgsMessageOutput *output = QgsMessageOutput::createMessageOutput();
@ -2297,7 +2297,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
{
QAction *rangeDomainAction = new QAction( QObject::tr( "New Range Domain…" ) );
createFieldDomainMenu->addAction( rangeDomainAction );
connect( rangeDomainAction, &QAction::triggered, this, [createDomain] {
connect( rangeDomainAction, &QAction::triggered, this, [=] {
createDomain( Qgis::FieldDomainType::Range );
} );
}
@ -2306,7 +2306,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
{
QAction *codedDomainAction = new QAction( QObject::tr( "New Coded Values Domain…" ) );
createFieldDomainMenu->addAction( codedDomainAction );
connect( codedDomainAction, &QAction::triggered, this, [createDomain] {
connect( codedDomainAction, &QAction::triggered, this, [=] {
createDomain( Qgis::FieldDomainType::Coded );
} );
}
@ -2315,7 +2315,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
{
QAction *globDomainAction = new QAction( QObject::tr( "New Glob Domain…" ) );
createFieldDomainMenu->addAction( globDomainAction );
connect( globDomainAction, &QAction::triggered, this, [createDomain] {
connect( globDomainAction, &QAction::triggered, this, [=] {
createDomain( Qgis::FieldDomainType::Glob );
} );
}
@ -2580,7 +2580,7 @@ void QgsRelationshipItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
QPointer<QgsDataItem> itemWeakPointer( item );
connect( editRelationshipAction, &QAction::triggered, this, [md, itemWeakPointer, relation, connectionUri, context] {
connect( editRelationshipAction, &QAction::triggered, this, [=] {
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn { static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connectionUri, {} ) ) };
QgsDbRelationDialog dialog( conn.release(), QgisApp::instance() );

View File

@ -67,7 +67,7 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
} );
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );

View File

@ -38,7 +38,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsDecorationGridDialog::buttonBox_accepted );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsDecorationGridDialog::buttonBox_rejected );
connect( mGridTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( int ) { updateSymbolButtons(); } );
connect( mGridTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int ) { updateSymbolButtons(); } );
connect( mPbtnUpdateFromExtents, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromExtents_clicked );
connect( mPbtnUpdateFromLayer, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromLayer_clicked );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationGridDialog::showHelp );
@ -47,7 +47,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
mLineSymbolButton->setSymbolType( Qgis::SymbolType::Line );
grpEnable->setChecked( mDeco.enabled() );
connect( grpEnable, &QGroupBox::toggled, this, [this] { updateSymbolButtons(); } );
connect( grpEnable, &QGroupBox::toggled, this, [=] { updateSymbolButtons(); } );
mOffsetXEdit->setShowClearButton( true );
mOffsetXEdit->setClearValue( 0 );

View File

@ -51,7 +51,7 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
} );
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
@ -69,7 +69,7 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
// enabled
grpEnable->setChecked( mDeco.enabled() );
connect( grpEnable, &QGroupBox::toggled, this, [this] { updateEnabledColorButtons(); } );
connect( grpEnable, &QGroupBox::toggled, this, [=] { updateEnabledColorButtons(); } );
wgtImagePath->setFilePath( mDeco.imagePath() );
connect( wgtImagePath, &QgsFileWidget::fileChanged, this, &QgsDecorationImageDialog::updateImagePath );
@ -83,8 +83,8 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select SVG Image Outline Color" ) );
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawImage(); } );
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawImage(); } );
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawImage(); } );
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawImage(); } );
drawImage();
}

View File

@ -52,7 +52,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
spinAngle->setEnabled( !mDeco.mAutomatic );
sliderRotation->setEnabled( !mDeco.mAutomatic );
connect( cboxAutomatic, &QAbstractButton::toggled, this, [this]( bool checked ) {
connect( cboxAutomatic, &QAbstractButton::toggled, this, [=]( bool checked ) {
spinAngle->setEnabled( !checked );
sliderRotation->setEnabled( !checked );
} );
@ -66,7 +66,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
} );
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
@ -87,7 +87,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
mSvgPathLineEdit->setText( mDeco.mSvgPath );
connect( mSvgPathLineEdit, &QLineEdit::textChanged, this, &QgsDecorationNorthArrowDialog::updateSvgPath );
connect( mSvgSelectorBtn, &QPushButton::clicked, this, [this] {
connect( mSvgSelectorBtn, &QPushButton::clicked, this, [=] {
QgsSvgSelectorDialog svgDlg( this );
svgDlg.setWindowTitle( tr( "Select SVG file" ) );
svgDlg.svgSelector()->setSvgPath( mSvgPathLineEdit->text().trimmed() );
@ -109,8 +109,8 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select North Arrow Outline Color" ) );
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawNorthArrow(); } );
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawNorthArrow(); } );
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawNorthArrow(); } );
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawNorthArrow(); } );
drawNorthArrow();
}

View File

@ -64,7 +64,7 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
} );
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );

View File

@ -74,7 +74,7 @@ QgsDecorationTitleDialog::QgsDecorationTitleDialog( QgsDecorationTitle &deco, QW
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
} );
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );

View File

@ -152,19 +152,19 @@ QList<QAction *> QgsNetworkLoggerRequestGroup::actions( QObject *parent )
{
QList<QAction *> res;
QAction *openUrlAction = new QAction( QObject::tr( "Open URL" ), parent );
QObject::connect( openUrlAction, &QAction::triggered, openUrlAction, [this] {
QObject::connect( openUrlAction, &QAction::triggered, openUrlAction, [=] {
QDesktopServices::openUrl( mUrl );
} );
res << openUrlAction;
QAction *copyUrlAction = new QAction( QObject::tr( "Copy URL" ), parent );
QObject::connect( copyUrlAction, &QAction::triggered, openUrlAction, [this] {
QObject::connect( copyUrlAction, &QAction::triggered, openUrlAction, [=] {
QApplication::clipboard()->setText( mUrl.url() );
} );
res << copyUrlAction;
QAction *copyAsCurlAction = new QAction( QObject::tr( "Copy As cURL" ), parent );
QObject::connect( copyAsCurlAction, &QAction::triggered, copyAsCurlAction, [this] {
QObject::connect( copyAsCurlAction, &QAction::triggered, copyAsCurlAction, [=] {
QString curlHeaders;
for ( const QPair<QString, QString> &header : std::as_const( mHeaders ) )
curlHeaders += QStringLiteral( "-H '%1: %2' " ).arg( header.first, header.second );
@ -211,7 +211,7 @@ QList<QAction *> QgsNetworkLoggerRequestGroup::actions( QObject *parent )
res << copyAsCurlAction;
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
QObject::connect( copyJsonAction, &QAction::triggered, openUrlAction, [this] {
QObject::connect( copyJsonAction, &QAction::triggered, openUrlAction, [=] {
const QVariant value = toVariant();
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
QApplication::clipboard()->setText( json );

View File

@ -60,7 +60,7 @@ QgsNetworkLoggerTreeView::QgsNetworkLoggerTreeView( QgsNetworkLogger *logger, QW
mAutoScroll = false;
} );
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [this] {
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [=] {
if ( mLogger->rowCount() > ( QgsNetworkLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
{
// never trim expanded nodes
@ -185,11 +185,11 @@ QgsNetworkLoggerPanelWidget::QgsNetworkLoggerPanelWidget( QgsNetworkLogger *logg
connect( mActionShowSuccessful, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowSuccessful );
connect( mActionShowCached, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowCached );
connect( mActionClear, &QAction::triggered, mLogger, &QgsNetworkLogger::clear );
connect( mActionRecord, &QAction::toggled, this, [this]( bool enabled ) {
connect( mActionRecord, &QAction::toggled, this, [=]( bool enabled ) {
QgsSettings().setValue( QStringLiteral( "logNetworkRequests" ), enabled, QgsSettings::App );
mLogger->enableLogging( enabled );
} );
connect( mActionSaveLog, &QAction::triggered, this, [this]() {
connect( mActionSaveLog, &QAction::triggered, this, [=]() {
if ( QMessageBox::warning( this, tr( "Save Network Log" ), tr( "Security warning: network logs may contain sensitive data including usernames or passwords. Treat this log as confidential and be careful who you share it with. Continue?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
return;
@ -228,7 +228,7 @@ QgsNetworkLoggerPanelWidget::QgsNetworkLoggerPanelWidget( QgsNetworkLogger *logg
mToolbar->addSeparator();
QCheckBox *disableCacheCheck = new QCheckBox( tr( "Disable cache" ) );
connect( disableCacheCheck, &QCheckBox::toggled, this, []( bool checked ) {
connect( disableCacheCheck, &QCheckBox::toggled, this, [=]( bool checked ) {
// note -- we deliberately do NOT store this as a permanent setting in QSettings
// as it is designed to be a temporary debugging tool only and we don't want
// users to accidentally leave this enabled and cause unnecessary server load...

View File

@ -41,7 +41,7 @@ QgsProfilerPanelWidget::QgsProfilerPanelWidget( QgsRuntimeProfiler *profiler, QW
mTreeView->setItemDelegateForColumn( 1, new CostDelegate( static_cast<int>( QgsRuntimeProfilerNode::CustomRole::Elapsed ), static_cast<int>( QgsRuntimeProfilerNode::CustomRole::ParentElapsed ), mTreeView ) );
connect( mProfiler, &QgsRuntimeProfiler::groupAdded, this, [this]( const QString &group ) {
connect( mProfiler, &QgsRuntimeProfiler::groupAdded, this, [=]( const QString &group ) {
mCategoryComboBox->addItem( QgsRuntimeProfiler::translateGroupName( group ).isEmpty() ? group : QgsRuntimeProfiler::translateGroupName( group ), group );
if ( mCategoryComboBox->count() == 1 )
{
@ -50,7 +50,7 @@ QgsProfilerPanelWidget::QgsProfilerPanelWidget( QgsRuntimeProfiler *profiler, QW
}
} );
connect( mCategoryComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
connect( mCategoryComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
mProxyModel->setGroup( mCategoryComboBox->currentData().toString() );
} );

View File

@ -149,7 +149,7 @@ QList<QAction *> QgsDevToolsModelValueNode::actions( QObject *parent )
QList<QAction *> res;
QAction *copyAction = new QAction( QObject::tr( "Copy" ), parent );
QObject::connect( copyAction, &QAction::triggered, copyAction, [this] {
QObject::connect( copyAction, &QAction::triggered, copyAction, [=] {
QApplication::clipboard()->setText( QStringLiteral( "%1: %2" ).arg( mKey, mValue ) );
} );

View File

@ -166,13 +166,13 @@ QList<QAction *> QgsDatabaseQueryLoggerQueryGroup::actions( QObject *parent )
QList<QAction *> res;
QAction *copyUrlAction = new QAction( QObject::tr( "Copy SQL" ), parent );
QObject::connect( copyUrlAction, &QAction::triggered, copyUrlAction, [this] {
QObject::connect( copyUrlAction, &QAction::triggered, copyUrlAction, [=] {
QApplication::clipboard()->setText( mSql );
} );
res << copyUrlAction;
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
QObject::connect( copyJsonAction, &QAction::triggered, copyJsonAction, [this] {
QObject::connect( copyJsonAction, &QAction::triggered, copyJsonAction, [=] {
const QVariant value = toVariant();
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
QApplication::clipboard()->setText( json );

View File

@ -75,7 +75,7 @@ QgsDatabaseQueryLoggerTreeView::QgsDatabaseQueryLoggerTreeView( QgsAppQueryLogge
mAutoScroll = false;
} );
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [this] {
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [=] {
if ( mLogger->rowCount() > ( QgsAppQueryLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
{
// never trim expanded nodes
@ -183,11 +183,11 @@ QgsDatabaseQueryLoggerPanelWidget::QgsDatabaseQueryLoggerPanelWidget( QgsAppQuer
connect( mFilterLineEdit, &QgsFilterLineEdit::textChanged, mTreeView, &QgsDatabaseQueryLoggerTreeView::setFilterString );
connect( mActionClear, &QAction::triggered, mLogger, &QgsAppQueryLogger::clear );
connect( mActionRecord, &QAction::toggled, this, []( bool enabled ) {
connect( mActionRecord, &QAction::toggled, this, [=]( bool enabled ) {
QgsSettings().setValue( QStringLiteral( "logDatabaseQueries" ), enabled, QgsSettings::App );
QgsApplication::databaseQueryLog()->setEnabled( enabled );
} );
connect( mActionSaveLog, &QAction::triggered, this, [this]() {
connect( mActionSaveLog, &QAction::triggered, this, [=]() {
if ( QMessageBox::warning( this, tr( "Save Database Query Log" ), tr( "Security warning: query logs may contain sensitive data including usernames or passwords. Treat this log as confidential and be careful who you share it with. Continue?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
return;

View File

@ -227,7 +227,7 @@ QgsDwgImporter::QgsDwgImporter( const QString &database, const QgsCoordinateRefe
// setup custom debug printer for libdxfrw
static std::once_flag initialized;
std::call_once( initialized, []() {
std::call_once( initialized, [=]() {
DRW::setCustomDebugPrinter( new QgsDrwDebugPrinter( 4 ) );
} );

View File

@ -145,12 +145,12 @@ QgsElevationProfileToolMeasure::QgsElevationProfileToolMeasure( QgsElevationProf
mDialog = new QgsProfileMeasureResultsDialog();
connect( this, &QgsElevationProfileToolMeasure::cleared, mDialog, &QDialog::hide );
connect( this, &QgsElevationProfileToolMeasure::measureChanged, mDialog, [this]( double totalDistance, double deltaCurve, double deltaElevation ) {
connect( this, &QgsElevationProfileToolMeasure::measureChanged, mDialog, [=]( double totalDistance, double deltaCurve, double deltaElevation ) {
mDialog->setCrs( mElevationCanvas->crs() );
mDialog->setMeasures( totalDistance, deltaCurve, deltaElevation );
mDialog->show();
} );
connect( mDialog, &QgsProfileMeasureResultsDialog::closed, this, [this] {
connect( mDialog, &QgsProfileMeasureResultsDialog::closed, this, [=] {
clear();
} );
}

View File

@ -168,7 +168,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mCanvas->setLockAxisScales( settingLockAxis->value() );
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [this] {
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [=] {
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
} );
@ -177,7 +177,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mLayerTreeView = new QgsAppElevationProfileLayerTreeView( mLayerTree.get() );
connect( mLayerTreeView, &QgsAppElevationProfileLayerTreeView::addLayers, this, &QgsElevationProfileWidget::addLayersInternal );
connect( mLayerTreeView, &QAbstractItemView::doubleClicked, this, [this]( const QModelIndex &index ) {
connect( mLayerTreeView, &QAbstractItemView::doubleClicked, this, [=]( const QModelIndex &index ) {
if ( QgsMapLayer *layer = mLayerTreeView->indexToLayer( index ) )
{
QgisApp::instance()->showLayerProperties( layer, QStringLiteral( "mOptsPage_Elevation" ) );
@ -198,7 +198,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
QAction *showLayerTree = new QAction( tr( "Show Layer Tree" ), this );
showLayerTree->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconLayerTree.svg" ) ) );
showLayerTree->setCheckable( true );
connect( showLayerTree, &QAction::toggled, this, [this]( bool checked ) {
connect( showLayerTree, &QAction::toggled, this, [=]( bool checked ) {
settingShowLayerTree->setValue( checked );
mLayerTreeView->setVisible( checked );
} );
@ -210,7 +210,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mCaptureCurveAction = new QAction( tr( "Capture Curve" ), this );
mCaptureCurveAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureLine.svg" ) ) );
mCaptureCurveAction->setCheckable( true );
connect( mCaptureCurveAction, &QAction::triggered, this, [this] {
connect( mCaptureCurveAction, &QAction::triggered, this, [=] {
if ( mCaptureCurveMapTool && mMainCanvas )
{
mMainCanvas->setMapTool( mCaptureCurveMapTool.get() );
@ -221,7 +221,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mCaptureCurveFromFeatureAction = new QAction( tr( "Capture Curve From Feature" ), this );
mCaptureCurveFromFeatureAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureCurveFromFeature.svg" ) ) );
mCaptureCurveFromFeatureAction->setCheckable( true );
connect( mCaptureCurveFromFeatureAction, &QAction::triggered, this, [this] {
connect( mCaptureCurveFromFeatureAction, &QAction::triggered, this, [=] {
if ( mCaptureCurveFromFeatureMapTool && mMainCanvas )
{
mMainCanvas->setMapTool( mCaptureCurveFromFeatureMapTool.get() );
@ -241,7 +241,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mNudgeRightAction->setEnabled( false );
toolBar->addAction( mNudgeRightAction );
auto createShortcuts = [this]( const QString &objectName, void ( QgsElevationProfileWidget::*slot )() ) {
auto createShortcuts = [=]( const QString &objectName, void ( QgsElevationProfileWidget::*slot )() ) {
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
connect( sc, &QShortcut::activated, this, slot );
};
@ -260,7 +260,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
identifyToolAction->setCheckable( true );
identifyToolAction->setChecked( true );
mIdentifyTool->setAction( identifyToolAction );
connect( identifyToolAction, &QAction::triggered, mPanTool, [this] { mCanvas->setTool( mIdentifyTool ); } );
connect( identifyToolAction, &QAction::triggered, mPanTool, [=] { mCanvas->setTool( mIdentifyTool ); } );
toolBar->addAction( identifyToolAction );
QAction *panToolAction = new QAction( tr( "Pan" ), this );
@ -268,21 +268,21 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
panToolAction->setCheckable( true );
panToolAction->setChecked( false );
mPanTool->setAction( panToolAction );
connect( panToolAction, &QAction::triggered, mPanTool, [this] { mCanvas->setTool( mPanTool ); } );
connect( panToolAction, &QAction::triggered, mPanTool, [=] { mCanvas->setTool( mPanTool ); } );
toolBar->addAction( panToolAction );
QAction *zoomXAxisToolAction = new QAction( tr( "Zoom X Axis" ), this );
zoomXAxisToolAction->setCheckable( true );
zoomXAxisToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomInXAxis.svg" ) ) );
mXAxisZoomTool->setAction( zoomXAxisToolAction );
connect( zoomXAxisToolAction, &QAction::triggered, mXAxisZoomTool, [this] { mCanvas->setTool( mXAxisZoomTool ); } );
connect( zoomXAxisToolAction, &QAction::triggered, mXAxisZoomTool, [=] { mCanvas->setTool( mXAxisZoomTool ); } );
toolBar->addAction( zoomXAxisToolAction );
QAction *zoomToolAction = new QAction( tr( "Zoom" ), this );
zoomToolAction->setCheckable( true );
zoomToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );
mZoomTool->setAction( zoomToolAction );
connect( zoomToolAction, &QAction::triggered, mZoomTool, [this] { mCanvas->setTool( mZoomTool ); } );
connect( zoomToolAction, &QAction::triggered, mZoomTool, [=] { mCanvas->setTool( mZoomTool ); } );
toolBar->addAction( zoomToolAction );
QAction *resetViewAction = new QAction( tr( "Zoom Full" ), this );
@ -303,7 +303,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
measureToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMeasure.svg" ) ) );
measureToolAction->setCheckable( true );
mMeasureTool->setAction( measureToolAction );
connect( measureToolAction, &QAction::triggered, this, [this] {
connect( measureToolAction, &QAction::triggered, this, [=] {
mCanvas->setTool( mMeasureTool.get() );
} );
toolBar->addAction( measureToolAction );
@ -383,7 +383,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
action->setData( QVariant::fromValue( unit ) );
action->setCheckable( true );
action->setActionGroup( unitGroup );
connect( action, &QAction::toggled, this, [this, unit]( bool active ) {
connect( action, &QAction::toggled, this, [=]( bool active ) {
if ( active )
{
mCanvas->setDistanceUnit( unit );
@ -391,7 +391,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
} );
mDistanceUnitMenu->addAction( action );
}
connect( mDistanceUnitMenu, &QMenu::aboutToShow, this, [this] {
connect( mDistanceUnitMenu, &QMenu::aboutToShow, this, [=] {
for ( QAction *action : mDistanceUnitMenu->actions() )
{
if ( action->data().value<Qgis::DistanceUnit>() == mCanvas->distanceUnit() && !action->isChecked() )
@ -405,7 +405,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
mSettingsAction = new QgsElevationProfileWidgetSettingsAction( mOptionsMenu );
mSettingsAction->toleranceSpinBox()->setValue( settingTolerance->value() );
connect( mSettingsAction->toleranceSpinBox(), qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( double value ) {
connect( mSettingsAction->toleranceSpinBox(), qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( double value ) {
settingTolerance->setValue( value );
createOrUpdateRubberBands();
scheduleUpdate();
@ -483,7 +483,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
toggleButton->setToolTip( tr( "Dock Elevation Profile View" ) );
toolBar->addWidget( toggleButton );
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
close();
} );
@ -527,8 +527,8 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
mCaptureCurveMapTool = std::make_unique<QgsMapToolProfileCurve>( canvas, QgisApp::instance()->cadDockWidget() );
mCaptureCurveMapTool->setAction( mCaptureCurveAction );
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::curveCaptured, this, [this]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureStarted, this, [this] {
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::curveCaptured, this, [=]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureStarted, this, [=] {
// if capturing a new curve, we just hide the existing rubber band -- if the user cancels the new curve digitizing then we'll
// re-show the old curve rubber band
if ( mRubberBand )
@ -538,7 +538,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
if ( mMapPointRubberBand )
mMapPointRubberBand->hide();
} );
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureCanceled, this, [this] {
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureCanceled, this, [=] {
if ( mRubberBand )
mRubberBand->show();
if ( mToleranceRubberBand )
@ -549,7 +549,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
mCaptureCurveFromFeatureMapTool = std::make_unique<QgsMapToolProfileCurveFromFeature>( canvas );
mCaptureCurveFromFeatureMapTool->setAction( mCaptureCurveFromFeatureAction );
connect( mCaptureCurveFromFeatureMapTool.get(), &QgsMapToolProfileCurveFromFeature::curveCaptured, this, [this]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
connect( mCaptureCurveFromFeatureMapTool.get(), &QgsMapToolProfileCurveFromFeature::curveCaptured, this, [=]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
mMapPointRubberBand.reset( new QgsRubberBand( canvas, Qgis::GeometryType::Point ) );
mMapPointRubberBand->setZValue( 1000 );
@ -561,7 +561,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
mMapPointRubberBand->hide();
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
connect( mMainCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
connect( mMainCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
} );
}
@ -655,7 +655,7 @@ void QgsElevationProfileWidget::onTotalPendingJobsCountChanged( int count )
mJobProgressBarTimer.setSingleShot( true );
mJobProgressBarTimer.setInterval( 500 );
disconnect( mJobProgressBarTimerConnection );
mJobProgressBarTimerConnection = connect( &mJobProgressBarTimer, &QTimer::timeout, this, [this]() {
mJobProgressBarTimerConnection = connect( &mJobProgressBarTimer, &QTimer::timeout, this, [=]() {
mProgressPendingJobs->setVisible( true );
} );
mJobProgressBarTimer.start();

View File

@ -23,7 +23,7 @@
QgsMapToolProfileCurve::QgsMapToolProfileCurve( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget )
: QgsMapToolCapture( canvas, cadDockWidget, CaptureMode::CaptureLine )
{
connect( canvas, &QgsMapCanvas::mapToolSet, this, [this]( QgsMapTool *tool, QgsMapTool * ) {
connect( canvas, &QgsMapCanvas::mapToolSet, this, [=]( QgsMapTool *tool, QgsMapTool * ) {
if ( tool != this )
mPreviousTool = tool;
} );

View File

@ -57,7 +57,7 @@ QgsGCPListWidget::QgsGCPListWidget( QWidget *parent )
connect( this, &QAbstractItemView::clicked, this, &QgsGCPListWidget::itemClicked );
connect( this, &QWidget::customContextMenuRequested, this, &QgsGCPListWidget::showContextMenu );
connect( mGCPListModel, &QgsGCPListModel::pointEnabled, this, [this]( QgsGeorefDataPoint *point, int row ) {
connect( mGCPListModel, &QgsGCPListModel::pointEnabled, this, [=]( QgsGeorefDataPoint *point, int row ) {
emit pointEnabled( point, row );
adjustTableContent();
return;
@ -181,7 +181,7 @@ void QgsGCPListWidget::showContextMenu( QPoint p )
setCurrentIndex( index );
QAction *jumpToPointAction = new QAction( tr( "Recenter" ), this );
connect( jumpToPointAction, &QAction::triggered, this, [this] {
connect( jumpToPointAction, &QAction::triggered, this, [=] {
const QModelIndex sourceIndex = static_cast<const QSortFilterProxyModel *>( model() )->mapToSource( currentIndex() );
mPrevRow = sourceIndex.row();
mPrevColumn = sourceIndex.column();

View File

@ -874,10 +874,10 @@ void QgsGeoreferencerMainWindow::showCoordDialog( const QgsPointXY &sourceCoordi
{
mNewlyAddedPoint = new QgsGeorefDataPoint( mCanvas, QgisApp::instance()->mapCanvas(), sourceCoordinates, QgsPointXY(), QgsCoordinateReferenceSystem(), true );
mMapCoordsDialog = new QgsMapCoordsDialog( QgisApp::instance()->mapCanvas(), mNewlyAddedPoint, lastProjection, this );
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded, this, [this]( const QgsPointXY &sourceLayerCoordinate, const QgsPointXY &destinationCoordinate, const QgsCoordinateReferenceSystem &destinationCrs ) {
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded, this, [=]( const QgsPointXY &sourceLayerCoordinate, const QgsPointXY &destinationCoordinate, const QgsCoordinateReferenceSystem &destinationCrs ) {
addPoint( sourceLayerCoordinate, destinationCoordinate, destinationCrs );
} );
connect( mMapCoordsDialog, &QObject::destroyed, this, [this] {
connect( mMapCoordsDialog, &QObject::destroyed, this, [=] {
delete mNewlyAddedPoint;
mNewlyAddedPoint = nullptr;
} );
@ -1102,9 +1102,9 @@ void QgsGeoreferencerMainWindow::createActions()
connect( mActionReset, &QAction::triggered, this, &QgsGeoreferencerMainWindow::reset );
mActionOpenRaster->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddRasterLayer.svg" ) ) );
connect( mActionOpenRaster, &QAction::triggered, this, [this] { openLayer( Qgis::LayerType::Raster ); } );
connect( mActionOpenRaster, &QAction::triggered, this, [=] { openLayer( Qgis::LayerType::Raster ); } );
connect( mActionOpenVector, &QAction::triggered, this, [this] { openLayer( Qgis::LayerType::Vector ); } );
connect( mActionOpenVector, &QAction::triggered, this, [=] { openLayer( Qgis::LayerType::Vector ); } );
mActionStartGeoref->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionStart.svg" ) ) );
connect( mActionStartGeoref, &QAction::triggered, this, &QgsGeoreferencerMainWindow::georeference );
@ -1211,7 +1211,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mCanvas );
addDockWidget( Qt::LeftDockWidgetArea, mAdvancedDigitizingDockWidget );
mAdvancedDigitizingDockWidget->hide();
connect( mActionAdvancedDigitizingDock, &QAction::triggered, mAdvancedDigitizingDockWidget, [this]( bool checked ) { mAdvancedDigitizingDockWidget->setVisible( checked ); } );
connect( mActionAdvancedDigitizingDock, &QAction::triggered, mAdvancedDigitizingDockWidget, [=]( bool checked ) { mAdvancedDigitizingDockWidget->setVisible( checked ); } );
QgsSnappingConfig snappingConfig;
snappingConfig.setMode( Qgis::SnappingMode::AllLayers );
@ -1247,7 +1247,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
mSnappingTypeButton->setMenu( typeMenu );
mSnappingTypeButton->setObjectName( QStringLiteral( "SnappingTypeButton" ) );
connect( mSnappingTypeButton, &QToolButton::triggered, this, [this]( QAction *action ) {
connect( mSnappingTypeButton, &QToolButton::triggered, this, [=]( QAction *action ) {
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
unsigned int type = static_cast<int>( snappingConfig.typeFlag() );
const Qgis::SnappingTypes actionFlag = static_cast<Qgis::SnappingTypes>( action->data().toInt() );
@ -1256,7 +1256,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
mSnappingUtils->setConfig( snappingConfig );
} );
connect( mSnappingTypeButton, &QToolButton::clicked, this, [this]( bool checked ) {
connect( mSnappingTypeButton, &QToolButton::clicked, this, [=]( bool checked ) {
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
snappingConfig.setEnabled( checked );
mSnappingUtils->setConfig( snappingConfig );
@ -1285,7 +1285,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
mToolDeletePoint->setAction( mActionDeletePoint );
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::hoverPoint, this, &QgsGeoreferencerMainWindow::hoverPoint );
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::deletePoint, this, &QgsGeoreferencerMainWindow::deletePoint );
connect( mToolDeletePoint, &QgsMapTool::deactivated, this, [this] {
connect( mToolDeletePoint, &QgsMapTool::deactivated, this, [=] {
if ( mHoveredPoint )
{
mHoveredPoint->setHovered( false );
@ -1299,7 +1299,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
connect( mToolMovePoint, &QgsMapTool::deactivated, this, [this] {
connect( mToolMovePoint, &QgsMapTool::deactivated, this, [=] {
mMovingPoint = nullptr;
if ( mHoveredPoint )
{
@ -1315,7 +1315,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
connect( mToolMovePointQgis, &QgsMapTool::deactivated, this, [this] {
connect( mToolMovePointQgis, &QgsMapTool::deactivated, this, [=] {
mMovingPointQgis = nullptr;
if ( mHoveredPoint )
{

View File

@ -76,7 +76,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
outputFile->setDialogTitle( tr( "Destination File" ) );
const QString lastDestinationFolder = settingLastDestinationFolder->value();
outputFile->setDefaultRoot( lastDestinationFolder.isEmpty() ? QDir::homePath() : lastDestinationFolder );
connect( outputFile, &QgsFileWidget::fileChanged, this, [outputFile] {
connect( outputFile, &QgsFileWidget::fileChanged, this, [=] {
settingLastDestinationFolder->setValue( QFileInfo( outputFile->filePath() ).absolutePath() );
} );
@ -85,7 +85,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
mPdfMap->setDialogTitle( tr( "Save Map File As" ) );
const QString lastPdfFolder = settingLastPdfFolder->value();
mPdfMap->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
connect( mPdfMap, &QgsFileWidget::fileChanged, this, [this] {
connect( mPdfMap, &QgsFileWidget::fileChanged, this, [=] {
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
} );
@ -93,7 +93,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
mPdfReport->setFilter( tr( "PDF files" ) + " (*.pdf *.PDF)" );
mPdfReport->setDialogTitle( tr( "Save Report File As" ) );
mPdfReport->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
connect( mPdfReport, &QgsFileWidget::fileChanged, this, [this] {
connect( mPdfReport, &QgsFileWidget::fileChanged, this, [=] {
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
} );

View File

@ -241,7 +241,7 @@ void QgsAppGpsConnection::showGpsConnectFailureWarning( const QString &message )
QgisApp::instance()->statusBarIface()->clearMessage();
mConnectionMessageItem = QgisApp::instance()->messageBar()->createMessage( QString(), message );
QPushButton *configureButton = new QPushButton( tr( "Configure Device…" ) );
connect( configureButton, &QPushButton::clicked, configureButton, [] {
connect( configureButton, &QPushButton::clicked, configureButton, [=] {
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
} );
mConnectionMessageItem->layout()->addWidget( configureButton );

View File

@ -125,10 +125,10 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mUpdateGpsDetailsAction );
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
} );
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
setTransformContext( QgsProject::instance()->transformContext() );
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, transformContext() );
} );
@ -136,7 +136,7 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
setEllipsoid( QgsProject::instance()->ellipsoid() );
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
setEllipsoid( QgsProject::instance()->ellipsoid() );
} );
@ -146,13 +146,13 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsAppGpsDigitizing::gpsSettingsChanged );
gpsSettingsChanged();
connect( QgisApp::instance(), &QgisApp::activeLayerChanged, this, []( QgsMapLayer *layer ) {
connect( QgisApp::instance(), &QgisApp::activeLayerChanged, this, [=]( QgsMapLayer *layer ) {
if ( QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
{
QgsProject::instance()->gpsSettings()->setDestinationLayer( qobject_cast<QgsVectorLayer *>( layer ) );
}
} );
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::destinationFollowsActiveLayerChanged, this, []( bool enabled ) {
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::destinationFollowsActiveLayerChanged, this, [=]( bool enabled ) {
if ( enabled )
{
QgsProject::instance()->gpsSettings()->setDestinationLayer( qobject_cast<QgsVectorLayer *>( QgisApp::instance()->activeLayer() ) );
@ -164,7 +164,7 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
}
setAutomaticallyAddTrackVertices( QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [this]( bool enabled ) {
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [=]( bool enabled ) {
setAutomaticallyAddTrackVertices( enabled );
} );

View File

@ -60,11 +60,11 @@ QgsAppGpsLogging::QgsAppGpsLogging( QgsAppGpsConnection *connection, QObject *pa
: QObject( parent )
, mConnection( connection )
{
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
if ( mGpkgLogger )
mGpkgLogger->setTransformContext( QgsProject::instance()->transformContext() );
} );
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
if ( mGpkgLogger )
mGpkgLogger->setEllipsoid( QgsProject::instance()->ellipsoid() );
} );
@ -72,7 +72,7 @@ QgsAppGpsLogging::QgsAppGpsLogging( QgsAppGpsConnection *connection, QObject *pa
connect( mConnection, &QgsAppGpsConnection::connected, this, &QgsAppGpsLogging::gpsConnected );
connect( mConnection, &QgsAppGpsConnection::disconnected, this, &QgsAppGpsLogging::gpsDisconnected );
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [this] {
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [=] {
if ( mGpkgLogger )
mGpkgLogger->updateGpsSettings();
} );

View File

@ -101,7 +101,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mShowLocationMarkerAction = new QAction( tr( "Show Location Marker" ), this );
mShowLocationMarkerAction->setCheckable( true );
mShowLocationMarkerAction->setChecked( showLocationMarker );
connect( mShowLocationMarkerAction, &QAction::toggled, this, [this]( bool checked ) {
connect( mShowLocationMarkerAction, &QAction::toggled, this, [=]( bool checked ) {
emit locationMarkerToggled( checked );
QgsGpsMarker::settingShowLocationMarker->setValue( checked );
} );
@ -111,7 +111,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mShowBearingLineAction = new QAction( tr( "Show Bearing Line" ), this );
mShowBearingLineAction->setCheckable( true );
mShowBearingLineAction->setChecked( showBearingLine );
connect( mShowBearingLineAction, &QAction::toggled, this, [this]( bool checked ) {
connect( mShowBearingLineAction, &QAction::toggled, this, [=]( bool checked ) {
emit bearingLineToggled( checked );
QgsGpsCanvasBridge::settingShowBearingLine->setValue( checked );
} );
@ -122,7 +122,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mRotateMapAction = new QAction( tr( "Rotate Map to Match GPS Direction" ), this );
mRotateMapAction->setCheckable( true );
mRotateMapAction->setChecked( rotateMap );
connect( mRotateMapAction, &QAction::toggled, this, [this]( bool checked ) {
connect( mRotateMapAction, &QAction::toggled, this, [=]( bool checked ) {
QgsGpsCanvasBridge::settingRotateMap->setValue( checked );
emit rotateMapToggled( checked );
} );
@ -148,7 +148,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
break;
}
connect( mRadioAlwaysRecenter, &QRadioButton::toggled, this, [this]( bool checked ) {
connect( mRadioAlwaysRecenter, &QRadioButton::toggled, this, [=]( bool checked ) {
if ( checked )
{
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Always );
@ -156,7 +156,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
}
} );
connect( mRadioRecenterWhenOutside, &QRadioButton::toggled, this, [this]( bool checked ) {
connect( mRadioRecenterWhenOutside, &QRadioButton::toggled, this, [=]( bool checked ) {
if ( checked )
{
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::WhenOutsideVisibleExtent );
@ -164,7 +164,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
}
} );
connect( mRadioNeverRecenter, &QRadioButton::toggled, this, [this]( bool checked ) {
connect( mRadioNeverRecenter, &QRadioButton::toggled, this, [=]( bool checked ) {
if ( checked )
{
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Never );
@ -180,7 +180,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mAutoAddTrackVerticesAction = new QAction( tr( "Automatically Add Track Vertices" ), this );
mAutoAddTrackVerticesAction->setCheckable( true );
mAutoAddTrackVerticesAction->setChecked( QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
connect( mAutoAddTrackVerticesAction, &QAction::toggled, this, []( bool checked ) {
connect( mAutoAddTrackVerticesAction, &QAction::toggled, this, [=]( bool checked ) {
if ( checked != QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() )
{
QgsProject::instance()->gpsSettings()->setAutomaticallyAddTrackVertices( checked );
@ -194,7 +194,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mAutoSaveAddedFeatureAction = new QAction( tr( "Automatically Save Added Feature" ), this );
mAutoSaveAddedFeatureAction->setCheckable( true );
mAutoSaveAddedFeatureAction->setChecked( QgsProject::instance()->gpsSettings()->automaticallyCommitFeatures() );
connect( mAutoSaveAddedFeatureAction, &QAction::toggled, this, []( bool checked ) {
connect( mAutoSaveAddedFeatureAction, &QAction::toggled, this, [=]( bool checked ) {
if ( checked != QgsProject::instance()->gpsSettings()->automaticallyCommitFeatures() )
{
QgsProject::instance()->gpsSettings()->setAutomaticallyCommitFeatures( checked );
@ -217,7 +217,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mActionGpkgLog = new QAction( tr( "Log to GeoPackage/Spatialite…" ), this );
mActionGpkgLog->setCheckable( true );
connect( mActionGpkgLog, &QAction::toggled, this, [this]( bool checked ) {
connect( mActionGpkgLog, &QAction::toggled, this, [=]( bool checked ) {
if ( checked )
{
const QString lastGpkgLog = QgsAppGpsLogging::settingLastGpkgLog->value();
@ -246,7 +246,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
mActionNmeaLog = new QAction( tr( "Log NMEA Sentences…" ), this );
mActionNmeaLog->setCheckable( true );
connect( mActionNmeaLog, &QAction::toggled, this, [this]( bool checked ) {
connect( mActionNmeaLog, &QAction::toggled, this, [=]( bool checked ) {
if ( checked )
{
const QString lastLogFolder = QgsAppGpsLogging::settingLastLogFolder->value();
@ -277,7 +277,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
QAction *settingsAction = new QAction( tr( "GPS Settings…" ), this );
settingsAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) ) );
connect( settingsAction, &QAction::triggered, this, [] {
connect( settingsAction, &QAction::triggered, this, [=] {
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
} );
@ -344,7 +344,7 @@ void QgsAppGpsSettingsMenu::timeStampMenuAboutToShow()
foundPreviousField = true;
fieldAction->setChecked( currentTimeStampField == fieldName );
}
connect( fieldAction, &QAction::triggered, this, [fieldName]() {
connect( fieldAction, &QAction::triggered, this, [=]() {
if ( QgsProject::instance()->gpsSettings()->destinationTimeStampField() != fieldName )
{
QgsProject::instance()->gpsSettings()->setDestinationTimeStampField( QgsProject::instance()->gpsSettings()->destinationLayer(), fieldName );

View File

@ -59,16 +59,16 @@ QgsGpsCanvasBridge::QgsGpsCanvasBridge( QgsAppGpsConnection *connection, QgsMapC
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsGpsCanvasBridge::gpsSettingsChanged );
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
} );
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
} );
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
mDistanceCalculator.setSourceCrs( mWgs84CRS, QgsProject::instance()->transformContext() );
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
} );
@ -76,7 +76,7 @@ QgsGpsCanvasBridge::QgsGpsCanvasBridge( QgsAppGpsConnection *connection, QgsMapC
connect( mCanvas, &QgsMapCanvas::tapAndHoldGestureOccurred, this, &QgsGpsCanvasBridge::tapAndHold );
mBearingNumericFormat.reset( QgsLocalDefaultSettings::bearingFormat() );
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [this] {
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [=] {
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
updateGpsDistanceStatusMessage( false );
} );

View File

@ -188,7 +188,7 @@ QgsGpsInformationWidget::QgsGpsInformationWidget( QgsAppGpsConnection *connectio
connect( mConnection, &QgsAppGpsConnection::stateChanged, this, &QgsGpsInformationWidget::displayGPSInformation );
connect( mConnection, &QgsAppGpsConnection::fixStatusChanged, this, &QgsGpsInformationWidget::setStatusIndicator );
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [this]( Qgis::DeviceConnectionStatus status ) {
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [=]( Qgis::DeviceConnectionStatus status ) {
switch ( status )
{
case Qgis::DeviceConnectionStatus::Disconnected:

View File

@ -56,7 +56,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
mConnectAction->setCheckable( true );
addAction( mConnectAction );
connect( mConnectAction, &QAction::toggled, this, [this]( bool connect ) {
connect( mConnectAction, &QAction::toggled, this, [=]( bool connect ) {
if ( connect )
mConnection->connectGps();
else
@ -68,7 +68,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
mRecenterAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionRecenter.svg" ) ) );
mRecenterAction->setEnabled( false );
connect( mRecenterAction, &QAction::triggered, this, [this] {
connect( mRecenterAction, &QAction::triggered, this, [=] {
if ( mConnection->lastValidLocation().isEmpty() )
return;
@ -143,7 +143,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
mCreateFeatureAction->setEnabled( false );
mAddTrackVertexAction->setEnabled( false );
mResetFeatureAction->setEnabled( false );
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [this]( Qgis::DeviceConnectionStatus status ) {
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [=]( Qgis::DeviceConnectionStatus status ) {
switch ( status )
{
case Qgis::DeviceConnectionStatus::Disconnected:
@ -185,7 +185,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::destinationLayerChanged, this, &QgsGpsToolBar::destinationLayerChanged );
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [this]( bool enabled ) { setAddVertexButtonEnabled( !enabled ); } );
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [=]( bool enabled ) { setAddVertexButtonEnabled( !enabled ); } );
setAddVertexButtonEnabled( !QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
adjustSize();
@ -408,7 +408,7 @@ void QgsGpsToolBar::destinationMenuAboutToShow()
followAction->setCheckable( true );
followAction->setChecked( QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() );
connect( followAction, &QAction::toggled, this, []( bool checked ) {
connect( followAction, &QAction::toggled, this, [=]( bool checked ) {
if ( checked && !QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
{
QgsProject::instance()->gpsSettings()->setDestinationFollowsActiveLayer( true );
@ -431,7 +431,7 @@ void QgsGpsToolBar::destinationMenuAboutToShow()
if ( actionLayerId == currentLayerId && !QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
layerAction->setChecked( true );
connect( layerAction, &QAction::toggled, this, [actionLayerId]( bool checked ) {
connect( layerAction, &QAction::toggled, this, [=]( bool checked ) {
if ( checked )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( QgsProject::instance()->mapLayer( actionLayerId ) );
@ -475,7 +475,7 @@ void QgsGpsToolBar::createLocationWidget()
showComponentAction->setChecked( visibleComponents & component );
locationMenu->addAction( showComponentAction );
connect( showComponentAction, &QAction::toggled, this, [this, component]( bool checked ) {
connect( showComponentAction, &QAction::toggled, this, [=]( bool checked ) {
const Qgis::GpsInformationComponents currentVisibleComponents = settingShowInToolbar->value();
if ( checked )
{

View File

@ -67,13 +67,13 @@ QgsLayout3DMapWidget::QgsLayout3DMapWidget( QgsLayoutItem3DMap *map3D )
mMenu3DCanvases = new QMenu( this );
mCopySettingsButton->setMenu( mMenu3DCanvases );
_prepare3DViewsMenu( mMenu3DCanvases, this, [this]( Qgs3DMapCanvasWidget *widget ) {
_prepare3DViewsMenu( mMenu3DCanvases, this, [=]( Qgs3DMapCanvasWidget *widget ) {
copy3DMapSettings( widget );
} );
mMenu3DCanvasesPose = new QMenu( this );
mPoseFromViewButton->setMenu( mMenu3DCanvasesPose );
_prepare3DViewsMenu( mMenu3DCanvasesPose, this, [this]( Qgs3DMapCanvasWidget *widget ) { copyCameraPose( widget ); } );
_prepare3DViewsMenu( mMenu3DCanvasesPose, this, [=]( Qgs3DMapCanvasWidget *widget ) { copyCameraPose( widget ); } );
QList<QgsDoubleSpinBox *> lst;
lst << mCenterXSpinBox << mCenterYSpinBox << mCenterZSpinBox << mDistanceToCenterSpinBox << mPitchAngleSpinBox << mHeadingAngleSpinBox;

View File

@ -328,7 +328,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
QgsGui::enableAutoGeometryRestore( this );
mScreenHelper = new QgsScreenHelper( this );
connect( mScreenHelper, &QgsScreenHelper::screenDpiChanged, this, [this]( double ) {
connect( mScreenHelper, &QgsScreenHelper::screenDpiChanged, this, [=]( double ) {
updateStatusZoom();
} );
@ -418,7 +418,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mActionPageSetup->setVisible( false );
#endif
connect( mActionOptions, &QAction::triggered, this, [this] {
connect( mActionOptions, &QAction::triggered, this, [=] {
QgisApp::instance()->showOptionsDialog( this, QStringLiteral( "mOptionsPageComposer" ) );
} );
@ -448,12 +448,12 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mDynamicTextMenu = new QMenu( tr( "Add Dynamic Text" ), this );
connect( mDynamicTextMenu, &QMenu::aboutToShow, this, [this] {
connect( mDynamicTextMenu, &QMenu::aboutToShow, this, [=] {
mDynamicTextMenu->clear();
if ( mLayout )
{
// we need to rebuild this on each show, as the content varies depending on other available items...
QgsLayoutLabelWidget::buildInsertDynamicTextMenu( mLayout, mDynamicTextMenu, [this]( const QString &expression ) {
QgsLayoutLabelWidget::buildInsertDynamicTextMenu( mLayout, mDynamicTextMenu, [=]( const QString &expression ) {
activateNewItemCreationTool( QgsGui::layoutItemGuiRegistry()->metadataIdForItemType( QgsLayoutItemRegistry::LayoutLabel ), false );
QVariantMap properties;
properties.insert( QStringLiteral( "expression" ), expression );
@ -574,28 +574,28 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mPanTool = new QgsLayoutViewToolPan( mView );
mPanTool->setAction( mActionPan );
mToolsActionGroup->addAction( mActionPan );
connect( mActionPan, &QAction::triggered, mPanTool, [this] { mView->setTool( mPanTool ); } );
connect( mActionPan, &QAction::triggered, mPanTool, [=] { mView->setTool( mPanTool ); } );
mZoomTool = new QgsLayoutViewToolZoom( mView );
mZoomTool->setAction( mActionZoomTool );
mToolsActionGroup->addAction( mActionZoomTool );
connect( mActionZoomTool, &QAction::triggered, mZoomTool, [this] { mView->setTool( mZoomTool ); } );
connect( mActionZoomTool, &QAction::triggered, mZoomTool, [=] { mView->setTool( mZoomTool ); } );
mSelectTool = new QgsLayoutViewToolSelect( mView );
mSelectTool->setAction( mActionSelectMoveItem );
mToolsActionGroup->addAction( mActionSelectMoveItem );
connect( mActionSelectMoveItem, &QAction::triggered, mSelectTool, [this] { mView->setTool( mSelectTool ); } );
connect( mActionSelectMoveItem, &QAction::triggered, mSelectTool, [=] { mView->setTool( mSelectTool ); } );
// after creating an item with the add item tool, switch immediately to select tool
connect( mAddItemTool, &QgsLayoutViewToolAddItem::createdItem, this, [this] { mView->setTool( mSelectTool ); } );
connect( mAddNodeItemTool, &QgsLayoutViewToolAddNodeItem::createdItem, this, [this] { mView->setTool( mSelectTool ); } );
connect( mAddItemTool, &QgsLayoutViewToolAddItem::createdItem, this, [=] { mView->setTool( mSelectTool ); } );
connect( mAddNodeItemTool, &QgsLayoutViewToolAddNodeItem::createdItem, this, [=] { mView->setTool( mSelectTool ); } );
mNodesTool = new QgsLayoutViewToolEditNodes( mView );
mNodesTool->setAction( mActionEditNodesItem );
mToolsActionGroup->addAction( mActionEditNodesItem );
connect( mActionEditNodesItem, &QAction::triggered, mNodesTool, [this] { mView->setTool( mNodesTool ); } );
connect( mActionEditNodesItem, &QAction::triggered, mNodesTool, [=] { mView->setTool( mNodesTool ); } );
mMoveContentTool = new QgsLayoutViewToolMoveItemContent( mView );
mMoveContentTool->setAction( mActionMoveItemContent );
mToolsActionGroup->addAction( mActionMoveItemContent );
connect( mActionMoveItemContent, &QAction::triggered, mMoveContentTool, [this] { mView->setTool( mMoveContentTool ); } );
connect( mActionMoveItemContent, &QAction::triggered, mMoveContentTool, [=] { mView->setTool( mMoveContentTool ); } );
//Ctrl+= should also trigger zoom in
QShortcut *ctrlEquals = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+=" ) ), this );
@ -620,26 +620,26 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mActionPreviewModeOff->setChecked( true );
connect( mActionPreviewModeOff, &QAction::triggered, this, [this] {
connect( mActionPreviewModeOff, &QAction::triggered, this, [=] {
mView->setPreviewModeEnabled( false );
} );
connect( mActionPreviewModeMono, &QAction::triggered, this, [this] {
connect( mActionPreviewModeMono, &QAction::triggered, this, [=] {
mView->setPreviewMode( QgsPreviewEffect::PreviewMono );
mView->setPreviewModeEnabled( true );
} );
connect( mActionPreviewModeGrayscale, &QAction::triggered, this, [this] {
connect( mActionPreviewModeGrayscale, &QAction::triggered, this, [=] {
mView->setPreviewMode( QgsPreviewEffect::PreviewGrayscale );
mView->setPreviewModeEnabled( true );
} );
connect( mActionPreviewProtanope, &QAction::triggered, this, [this] {
connect( mActionPreviewProtanope, &QAction::triggered, this, [=] {
mView->setPreviewMode( QgsPreviewEffect::PreviewProtanope );
mView->setPreviewModeEnabled( true );
} );
connect( mActionPreviewDeuteranope, &QAction::triggered, this, [this] {
connect( mActionPreviewDeuteranope, &QAction::triggered, this, [=] {
mView->setPreviewMode( QgsPreviewEffect::PreviewDeuteranope );
mView->setPreviewModeEnabled( true );
} );
connect( mActionPreviewTritanope, &QAction::triggered, this, [this] {
connect( mActionPreviewTritanope, &QAction::triggered, this, [=] {
mView->setPreviewMode( QgsPreviewEffect::PreviewTritanope );
mView->setPreviewModeEnabled( true );
} );
@ -673,61 +673,61 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mActionLowerItems, &QAction::triggered, this, &QgsLayoutDesignerDialog::lowerSelectedItems );
connect( mActionMoveItemsToTop, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToTop );
connect( mActionMoveItemsToBottom, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToBottom );
connect( mActionAlignLeft, &QAction::triggered, this, [this] {
connect( mActionAlignLeft, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignLeft );
} );
connect( mActionAlignHCenter, &QAction::triggered, this, [this] {
connect( mActionAlignHCenter, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignHCenter );
} );
connect( mActionAlignRight, &QAction::triggered, this, [this] {
connect( mActionAlignRight, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignRight );
} );
connect( mActionAlignTop, &QAction::triggered, this, [this] {
connect( mActionAlignTop, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignTop );
} );
connect( mActionAlignVCenter, &QAction::triggered, this, [this] {
connect( mActionAlignVCenter, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignVCenter );
} );
connect( mActionAlignBottom, &QAction::triggered, this, [this] {
connect( mActionAlignBottom, &QAction::triggered, this, [=] {
mView->alignSelectedItems( QgsLayoutAligner::AlignBottom );
} );
connect( mActionDistributeLeft, &QAction::triggered, this, [this] {
connect( mActionDistributeLeft, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeLeft );
} );
connect( mActionDistributeHCenter, &QAction::triggered, this, [this] {
connect( mActionDistributeHCenter, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHCenter );
} );
connect( mActionDistributeHSpace, &QAction::triggered, this, [this] {
connect( mActionDistributeHSpace, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHSpace );
} );
connect( mActionDistributeRight, &QAction::triggered, this, [this] {
connect( mActionDistributeRight, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeRight );
} );
connect( mActionDistributeTop, &QAction::triggered, this, [this] {
connect( mActionDistributeTop, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeTop );
} );
connect( mActionDistributeVCenter, &QAction::triggered, this, [this] {
connect( mActionDistributeVCenter, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVCenter );
} );
connect( mActionDistributeVSpace, &QAction::triggered, this, [this] {
connect( mActionDistributeVSpace, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVSpace );
} );
connect( mActionDistributeBottom, &QAction::triggered, this, [this] {
connect( mActionDistributeBottom, &QAction::triggered, this, [=] {
mView->distributeSelectedItems( QgsLayoutAligner::DistributeBottom );
} );
connect( mActionResizeNarrowest, &QAction::triggered, this, [this] {
connect( mActionResizeNarrowest, &QAction::triggered, this, [=] {
mView->resizeSelectedItems( QgsLayoutAligner::ResizeNarrowest );
} );
connect( mActionResizeWidest, &QAction::triggered, this, [this] {
connect( mActionResizeWidest, &QAction::triggered, this, [=] {
mView->resizeSelectedItems( QgsLayoutAligner::ResizeWidest );
} );
connect( mActionResizeShortest, &QAction::triggered, this, [this] {
connect( mActionResizeShortest, &QAction::triggered, this, [=] {
mView->resizeSelectedItems( QgsLayoutAligner::ResizeShortest );
} );
connect( mActionResizeTallest, &QAction::triggered, this, [this] {
connect( mActionResizeTallest, &QAction::triggered, this, [=] {
mView->resizeSelectedItems( QgsLayoutAligner::ResizeTallest );
} );
connect( mActionResizeToSquare, &QAction::triggered, this, [this] {
connect( mActionResizeToSquare, &QAction::triggered, this, [=] {
mView->resizeSelectedItems( QgsLayoutAligner::ResizeToSquare );
} );
@ -749,16 +749,16 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mActionHidePanels->setChecked( !docksTitle.isEmpty() );
connect( mActionHidePanels, &QAction::toggled, this, &QgsLayoutDesignerDialog::setPanelVisibility );
connect( mActionDeleteSelection, &QAction::triggered, this, [this] {
connect( mActionDeleteSelection, &QAction::triggered, this, [=] {
if ( mView->tool() == mNodesTool )
mNodesTool->deleteSelectedNode();
else
mView->deleteSelectedItems();
} );
connect( mActionGroupItems, &QAction::triggered, this, [this] {
connect( mActionGroupItems, &QAction::triggered, this, [=] {
mView->groupSelectedItems();
} );
connect( mActionUngroupItems, &QAction::triggered, this, [this] {
connect( mActionUngroupItems, &QAction::triggered, this, [=] {
mView->ungroupSelectedItems();
} );
@ -768,7 +768,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mActionCut->setShortcuts( QKeySequence::Cut );
mActionCut->setStatusTip( tr( "Cut" ) );
mActionCut->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCut.svg" ) ) );
connect( mActionCut, &QAction::triggered, this, [this] {
connect( mActionCut, &QAction::triggered, this, [=] {
mView->copySelectedItems( QgsLayoutView::ClipboardCut );
} );
@ -776,7 +776,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mActionCopy->setShortcuts( QKeySequence::Copy );
mActionCopy->setStatusTip( tr( "Copy" ) );
mActionCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCopy.svg" ) ) );
connect( mActionCopy, &QAction::triggered, this, [this] {
connect( mActionCopy, &QAction::triggered, this, [=] {
mView->copySelectedItems( QgsLayoutView::ClipboardCopy );
} );
@ -854,7 +854,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mHorizontalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
connect( mVerticalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
connect( mView, &QgsLayoutView::itemFocused, this, [this]( QgsLayoutItem *item ) {
connect( mView, &QgsLayoutView::itemFocused, this, [=]( QgsLayoutItem *item ) {
showItemOptions( item, false );
} );
@ -880,7 +880,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mGeneralPropertiesStack = new QgsPanelWidgetStack();
mGeneralDock->setWidget( mGeneralPropertiesStack );
mPanelsMenu->addAction( mGeneralDock->toggleViewAction() );
connect( mActionLayoutProperties, &QAction::triggered, this, [this] {
connect( mActionLayoutProperties, &QAction::triggered, this, [=] {
mGeneralDock->setUserVisible( true );
} );
@ -897,7 +897,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mGuideStack = new QgsPanelWidgetStack();
mGuideDock->setWidget( mGuideStack );
mPanelsMenu->addAction( mGuideDock->toggleViewAction() );
connect( mActionManageGuides, &QAction::triggered, this, [this] {
connect( mActionManageGuides, &QAction::triggered, this, [=] {
mGuideDock->setUserVisible( true );
} );
@ -1132,7 +1132,7 @@ void QgsLayoutDesignerDialog::setMasterLayout( QgsMasterLayoutInterface *layout
QObject *obj = dynamic_cast<QObject *>( mMasterLayout );
if ( obj )
connect( obj, &QObject::destroyed, this, [this] {
connect( obj, &QObject::destroyed, this, [=] {
this->close();
} );
@ -1241,7 +1241,7 @@ void QgsLayoutDesignerDialog::setCurrentLayout( QgsLayout *layout )
mLayoutToolbar->addAction( mRedoAction );
connect( mLayout->undoStack(), &QgsLayoutUndoStack::undoRedoOccurredForItems, this, &QgsLayoutDesignerDialog::undoRedoOccurredForItems );
connect( mActionClearGuides, &QAction::triggered, &mLayout->guides(), [this] {
connect( mActionClearGuides, &QAction::triggered, &mLayout->guides(), [=] {
mLayout->guides().clear();
} );
@ -1370,7 +1370,7 @@ void QgsLayoutDesignerDialog::open()
// zoomFull() does not work properly until window has fully shown.
// It's not enough to just call show on it, because the view widget won't be fully
// resized to its final size until a little later...!
QTimer::singleShot( 100, this, [this] {
QTimer::singleShot( 100, this, [=] {
mView->zoomFull();
mView->setPaintingEnabled( true );
} );
@ -2061,7 +2061,7 @@ void QgsLayoutDesignerDialog::showManager()
// NOTE: Avoid crash where composer that spawned modal manager from toolbar ends up
// being deleted by user, but event loop tries to return to layout on manager close
// (does not seem to be an issue for menu action)
QTimer::singleShot( 0, this, [] {
QTimer::singleShot( 0, this, [=] {
QgisApp::instance()->showLayoutManager();
} );
}
@ -3977,7 +3977,7 @@ void QgsLayoutDesignerDialog::createAtlasWidget()
mPanelsMenu->addAction( mAtlasDock->toggleViewAction() );
connect( atlas, &QgsLayoutAtlas::messagePushed, mStatusBar, [this]( const QString &message ) {
connect( atlas, &QgsLayoutAtlas::messagePushed, mStatusBar, [=]( const QString &message ) {
mStatusBar->showMessage( message );
} );
connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutDesignerDialog::toggleAtlasControls );

View File

@ -59,7 +59,7 @@ QgsLayoutManagerDialog::QgsLayoutManagerDialog( QWidget *parent, Qt::WindowFlags
mTemplateFileWidget->setDefaultRoot( settings.value( QStringLiteral( "lastComposerTemplateDir" ), QString(), QgsSettings::App ).toString() );
mTemplateFileWidget->setFilePath( settings.value( QStringLiteral( "ComposerManager/templatePath" ), QString(), QgsSettings::App ).toString() );
connect( mTemplateFileWidget, &QgsFileWidget::fileChanged, this, [this] {
connect( mTemplateFileWidget, &QgsFileWidget::fileChanged, this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "ComposerManager/templatePath" ), mTemplateFileWidget->filePath(), QgsSettings::App );
QFileInfo tmplFileInfo( mTemplateFileWidget->filePath() );

View File

@ -116,7 +116,7 @@ void QgsReportOrganizerWidget::removeSection()
return;
std::function<void( QgsAbstractReportSection * section )> cleanup;
cleanup = [this, &cleanup]( QgsAbstractReportSection *section ) {
cleanup = [=, &cleanup]( QgsAbstractReportSection *section ) {
if ( mDesigner->currentLayout() == section->header() || mDesigner->currentLayout() == section->footer() )
mDesigner->setCurrentLayout( nullptr );
if ( section->type() == QLatin1String( "SectionFieldGroup" ) )

View File

@ -108,7 +108,7 @@ QWidget *QgsLocatorFiltersModel::configButton( const QModelIndex &index, QWidget
layout->addWidget( bt );
w->setLayout( layout );
connect( bt, &QToolButton::clicked, this, [filter, bt]() { filter->openConfigWidget( bt ); } );
connect( bt, &QToolButton::clicked, this, [=]() { filter->openConfigWidget( bt ); } );
bt->setMaximumSize( mIconSize, mIconSize );
bt->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
bt->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/settings.svg" ) ) );

View File

@ -64,7 +64,7 @@ void QgsNominatimLocatorFilter::triggerResult( const QgsLocatorResult &result )
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( tr( "The Nominatim geocoder data is made available by OpenStreetMap Foundation and contributors." ) );
QPushButton *learnMoreButton = new QPushButton( tr( "Learn more" ) );
connect( learnMoreButton, &QPushButton::clicked, learnMoreButton, [] {
connect( learnMoreButton, &QPushButton::clicked, learnMoreButton, [=] {
QDesktopServices::openUrl( QStringLiteral( "https://nominatim.org/" ) );
} );
messageWidget->layout()->addWidget( learnMoreButton );

View File

@ -82,7 +82,7 @@ QgsAvoidIntersectionsOperation::Result QgsAvoidIntersectionsOperation::apply( Qg
QgsMessageBarItem *messageBarItem = QgisApp::instance()->messageBar()->createMessage( tr( "Avoid overlaps" ), tr( "Only the largest of multiple created geometries was preserved." ) );
QPushButton *restoreButton = new QPushButton( tr( "Restore others" ) );
QPointer<QgsVectorLayer> layerPtr( layer );
connect( restoreButton, &QPushButton::clicked, restoreButton, [layerPtr, removedFeatures] {
connect( restoreButton, &QPushButton::clicked, restoreButton, [=] {
if ( !layerPtr )
return;
layerPtr->beginEditCommand( tr( "Restored geometry parts removed by avoid overlaps" ) );

View File

@ -74,7 +74,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupToolBars()
actionGroup->addAction( it.value() );
}
QgisApp::instance()->mActionStreamDigitize->setShortcut( tr( "R", "Keyboard shortcut: toggle stream digitizing" ) );
connect( digitizeMenu, &QMenu::triggered, this, [this]( QAction *action ) {
connect( digitizeMenu, &QMenu::triggered, this, [=]( QAction *action ) {
Qgis::CaptureTechnique technique = mTechniqueActions.key( action, Qgis::CaptureTechnique::StraightSegments );
if ( mDigitizeModeToolButton->defaultAction() != action )
{
@ -109,7 +109,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupToolBars()
shapeButton->setMenu( new QMenu() );
QgisApp::instance()->mShapeDigitizeToolBar->addWidget( shapeButton );
QObject::connect( shapeButton, &QToolButton::triggered, this, [this]( QAction *action ) { setShapeTool( action->data().toString() ); } );
QObject::connect( shapeButton, &QToolButton::triggered, this, [=]( QAction *action ) { setShapeTool( action->data().toString() ); } );
mShapeCategoryButtons.insert( metadata->category(), shapeButton );
}
@ -245,7 +245,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupTool( QgsMapToolCapture *tool )
}
mInitializedTools.insert( tool );
connect( tool, &QObject::destroyed, this, [this, tool] {
connect( tool, &QObject::destroyed, this, [=] {
mInitializedTools.remove( tool );
} );
}
@ -361,7 +361,7 @@ QgsStreamDigitizingSettingsAction::QgsStreamDigitizingSettingsAction( QWidget *p
QLabel *label = new QLabel( tr( "Streaming Tolerance" ) );
gLayout->addWidget( label, 1, 0 );
gLayout->addWidget( mStreamToleranceSpinBox, 1, 1 );
connect( mStreamToleranceSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, []( int value ) {
connect( mStreamToleranceSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, [=]( int value ) {
QgsSettingsRegistryCore::settingsDigitizingStreamTolerance->setValue( value );
} );

View File

@ -110,7 +110,7 @@ QgsMeshCalculatorDialog::QgsMeshCalculatorDialog( QgsMeshLayer *meshLayer, QgsMa
repopulateTimeCombos();
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "working_with_mesh/mesh_properties.html#mesh-calculator" ) );
} );

View File

@ -87,7 +87,7 @@ QgsMeshElevationPropertiesWidget::QgsMeshElevationPropertiesWidget( QgsMeshLayer
connect( mElevationLimitSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, &QgsMeshElevationPropertiesWidget::onChanged );
connect( mLineStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
connect( mFillStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
connect( mStyleComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
connect( mStyleComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
switch ( static_cast<Qgis::ProfileSurfaceSymbology>( mStyleComboBox->currentData().toInt() ) )
{
case Qgis::ProfileSurfaceSymbology::Line:

View File

@ -57,11 +57,11 @@ QgsMeshTransformCoordinatesDockWidget::QgsMeshTransformCoordinatesDockWidget( QW
connect( mButtonApply, &QPushButton::clicked, this, &QgsMeshTransformCoordinatesDockWidget::apply );
connect( mButtonImport, &QToolButton::toggled, this, &QgsMeshTransformCoordinatesDockWidget::onImportVertexClicked );
connect( mCheckBoxZ, &QCheckBox::toggled, this, [this]( const bool checked ) {
connect( mCheckBoxZ, &QCheckBox::toggled, this, [=]( const bool checked ) {
if ( checked )
mCheckBoxZFromProjectTerrain->setChecked( false );
} );
connect( mCheckBoxZFromProjectTerrain, &QCheckBox::toggled, this, [this]( const bool checked ) {
connect( mCheckBoxZFromProjectTerrain, &QCheckBox::toggled, this, [=]( const bool checked ) {
if ( checked )
mCheckBoxZ->setChecked( false );
} );

View File

@ -69,7 +69,7 @@ QgsNewMeshLayerDialog::QgsNewMeshLayerDialog( QWidget *parent, Qt::WindowFlags f
connect( mMeshFromFileWidget, &QgsFileWidget::fileChanged, this, &QgsNewMeshLayerDialog::updateDialog );
connect( mMeshProjectComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsNewMeshLayerDialog::updateDialog );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#creating-a-new-mesh-layer" ) );
} );

View File

@ -46,7 +46,7 @@ QgsAdvancedSettingsWidget::QgsAdvancedSettingsWidget( QWidget *parent )
{
createSettingsTreeWidget( true, true, true );
connect( mAdvancedSettingsEnableButton, &QPushButton::clicked, this, [this] {
connect( mAdvancedSettingsEnableButton, &QPushButton::clicked, this, [=] {
settingsUseNewTreeWidget->setValue( mUseNewSettingsTree->isChecked() );
mAdvancedSettingsWarning->hide();
if ( settingsUseNewTreeWidget->value() )

View File

@ -114,7 +114,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
mColorSchemeComboBox->setCurrentIndex( mColorSchemeComboBox->findData( QStringLiteral( "custom" ) ) );
}
connect( mColorSchemeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
connect( mColorSchemeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
const QString theme = mColorSchemeComboBox->currentData().toString();
if ( theme != QLatin1String( "custom" ) )
{
@ -132,7 +132,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
for ( auto it = mColorButtonMap.constBegin(); it != mColorButtonMap.constEnd(); ++it )
{
connect( it.value(), &QgsColorButton::colorChanged, this, [this] {
connect( it.value(), &QgsColorButton::colorChanged, this, [=] {
if ( mBlockCustomColorChange )
return;
@ -147,13 +147,13 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
mSizeSpin->setValue( font.pointSize() );
mOverrideFontGroupBox->setChecked( !settings.value( QStringLiteral( "codeEditor/fontfamily" ), QString(), QgsSettings::Gui ).toString().isEmpty() );
connect( mFontComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
connect( mFontComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
updatePreview();
} );
connect( mSizeSpin, qOverload<int>( &QSpinBox::valueChanged ), this, [this] {
connect( mSizeSpin, qOverload<int>( &QSpinBox::valueChanged ), this, [=] {
updatePreview();
} );
connect( mOverrideFontGroupBox, &QGroupBox::toggled, this, [this] {
connect( mOverrideFontGroupBox, &QGroupBox::toggled, this, [=] {
updatePreview();
} );
@ -179,7 +179,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
mListLanguage->addItem( tr( "Bash" ) );
mListLanguage->addItem( tr( "Batch" ) );
connect( mListLanguage, &QListWidget::currentRowChanged, this, [this] {
connect( mListLanguage, &QListWidget::currentRowChanged, this, [=] {
mPreviewStackedWidget->setCurrentIndex( mListLanguage->currentRow() );
} );

View File

@ -79,7 +79,7 @@ QgsCustomProjectionOptionsWidget::QgsCustomProjectionOptionsWidget( QWidget *par
leNameList->hideColumn( QgisCrsIdColumn );
connect( leName, &QLineEdit::textChanged, this, &QgsCustomProjectionOptionsWidget::updateListFromCurrentItem );
connect( mCrsDefinitionWidget, &QgsCrsDefinitionWidget::crsChanged, this, [this] {
connect( mCrsDefinitionWidget, &QgsCrsDefinitionWidget::crsChanged, this, [=] {
if ( !mBlockUpdates )
updateListFromCurrentItem();
} );

View File

@ -47,13 +47,13 @@ QgsFontOptionsWidget::QgsFontOptionsWidget( QWidget *parent )
row++;
}
connect( mButtonAddReplacement, &QToolButton::clicked, this, [this] {
connect( mButtonAddReplacement, &QToolButton::clicked, this, [=] {
mTableReplacements->setRowCount( mTableReplacements->rowCount() + 1 );
mTableReplacements->setFocus();
mTableReplacements->setCurrentCell( mTableReplacements->rowCount() - 1, 0 );
} );
connect( mButtonRemoveReplacement, &QToolButton::clicked, this, [this] {
connect( mButtonRemoveReplacement, &QToolButton::clicked, this, [=] {
const QModelIndexList selection = mTableReplacements->selectionModel()->selectedRows();
QList<int> selectedRows;
for ( const QModelIndex &index : selection )
@ -86,7 +86,7 @@ QgsFontOptionsWidget::QgsFontOptionsWidget( QWidget *parent )
row++;
}
connect( mButtonRemoveUserFont, &QToolButton::clicked, this, [this] {
connect( mButtonRemoveUserFont, &QToolButton::clicked, this, [=] {
const QModelIndexList selection = mTableUserFonts->selectionModel()->selectedRows();
QList<int> selectedRows;
for ( const QModelIndex &index : selection )

View File

@ -145,7 +145,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
// some drivers apply for both raster and vector -- we treat these as siblings
// and must ensure that checking/unchecking one also checks/unchecks the other
// (we can't selectively just disable the raster/vector part of a GDAL driver)
auto syncItem = []( QTreeWidgetItem *changedItem, QTreeWidget *otherTree ) {
auto syncItem = [=]( QTreeWidgetItem *changedItem, QTreeWidget *otherTree ) {
const QString driver = changedItem->data( 0, Qt::UserRole ).toString();
for ( int i = 0; i < otherTree->topLevelItemCount(); ++i )
{
@ -160,10 +160,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
}
}
};
connect( lstRasterDrivers, &QTreeWidget::itemChanged, this, [this, syncItem]( QTreeWidgetItem *item, int ) {
connect( lstRasterDrivers, &QTreeWidget::itemChanged, this, [=]( QTreeWidgetItem *item, int ) {
syncItem( item, lstVectorDrivers );
} );
connect( lstVectorDrivers, &QTreeWidget::itemChanged, this, [this, syncItem]( QTreeWidgetItem *item, int ) {
connect( lstVectorDrivers, &QTreeWidget::itemChanged, this, [=]( QTreeWidgetItem *item, int ) {
syncItem( item, lstRasterDrivers );
} );
@ -172,8 +172,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
connect( mCustomVariablesChkBx, &QCheckBox::toggled, this, &QgsOptions::mCustomVariablesChkBx_toggled );
connect( mCurrentVariablesQGISChxBx, &QCheckBox::toggled, this, &QgsOptions::mCurrentVariablesQGISChxBx_toggled );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOptions::showHelp );
connect( cboGlobalLocale, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) { updateSampleLocaleText(); } );
connect( cbShowGroupSeparator, &QCheckBox::toggled, this, [this]( bool ) { updateSampleLocaleText(); } );
connect( cboGlobalLocale, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) { updateSampleLocaleText(); } );
connect( cbShowGroupSeparator, &QCheckBox::toggled, this, [=]( bool ) { updateSampleLocaleText(); } );
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
@ -182,7 +182,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
// disconnect default connection setup by initOptionsBase for accepting dialog, and insert logic
// to validate widgets before allowing dialog to be closed
disconnect( mOptButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
connect( mOptButtonBox, &QDialogButtonBox::accepted, this, [this] {
connect( mOptButtonBox, &QDialogButtonBox::accepted, this, [=] {
for ( QgsOptionsPageWidget *widget : std::as_const( mAdditionalOptionWidgets ) )
{
if ( !widget->isValid() )
@ -494,7 +494,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mAutoClearAccessCache->setChecked( mSettings->value( QStringLiteral( "clear_auth_cache_on_errors" ), true, QgsSettings::Section::Auth ).toBool() );
connect( mClearAccessCache, &QAbstractButton::clicked, this, &QgsOptions::clearAccessCache );
connect( mAutoClearAccessCache, &QCheckBox::clicked, this, [this]( bool checked ) {
connect( mAutoClearAccessCache, &QCheckBox::clicked, this, [=]( bool checked ) {
mSettings->setValue( QStringLiteral( "clear_auth_cache_on_errors" ), checked, QgsSettings::Section::Auth );
} );
@ -886,7 +886,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
connect( mButtonImportColors, &QAbstractButton::clicked, mTreeCustomColors, &QgsColorSchemeList::showImportColorsDialog );
connect( mButtonExportColors, &QAbstractButton::clicked, mTreeCustomColors, &QgsColorSchemeList::showExportColorsDialog );
connect( mActionImportPalette, &QAction::triggered, this, [this] {
connect( mActionImportPalette, &QAction::triggered, this, [=] {
if ( QgsCompoundColorWidget::importUserPaletteFromFile( this ) )
{
//refresh combobox
@ -894,7 +894,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mColorSchemesComboBox->setCurrentIndex( mColorSchemesComboBox->count() - 1 );
}
} );
connect( mActionRemovePalette, &QAction::triggered, this, [this] {
connect( mActionRemovePalette, &QAction::triggered, this, [=] {
//get current scheme
QList<QgsColorScheme *> schemeList = QgsApplication::colorSchemeRegistry()->schemes();
int prevIndex = mColorSchemesComboBox->currentIndex();
@ -917,7 +917,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mColorSchemesComboBox->setCurrentIndex( prevIndex );
}
} );
connect( mActionNewPalette, &QAction::triggered, this, [this] {
connect( mActionNewPalette, &QAction::triggered, this, [=] {
if ( QgsCompoundColorWidget::createNewUserPalette( this ) )
{
//refresh combobox
@ -926,7 +926,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
}
} );
connect( mActionShowInButtons, &QAction::toggled, this, [this]( bool state ) {
connect( mActionShowInButtons, &QAction::toggled, this, [=]( bool state ) {
QgsUserColorScheme *scheme = dynamic_cast<QgsUserColorScheme *>( mTreeCustomColors->scheme() );
if ( scheme )
{
@ -952,7 +952,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mColorSchemesComboBox->setCurrentIndex( mColorSchemesComboBox->findText( customSchemes.at( 0 )->schemeName() ) );
updateActionsForCurrentColorScheme( customSchemes.at( 0 ) );
}
connect( mColorSchemesComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( int index ) {
connect( mColorSchemesComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int index ) {
//save changes to scheme
if ( mTreeCustomColors->isDirty() )
{
@ -1221,7 +1221,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
// Setup OpenCL Acceleration widget
connect( mGPUEnableCheckBox, &QCheckBox::toggled, this, [this]( bool checked ) {
connect( mGPUEnableCheckBox, &QCheckBox::toggled, this, [=]( bool checked ) {
if ( checked )
{
// Since this may crash and lock users out of the settings, let's disable opencl setting before entering
@ -1239,7 +1239,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mOpenClDevicesCombo->addItem( QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Name, dev ), QgsOpenClUtils::deviceId( dev ) );
}
// Info updater
std::function<void( int )> infoUpdater = [this]( int ) {
std::function<void( int )> infoUpdater = [=]( int ) {
mGPUInfoTextBrowser->setText( QgsOpenClUtils::deviceDescription( mOpenClDevicesCombo->currentData().toString() ) );
};
connect( mOpenClDevicesCombo, qOverload<int>( &QComboBox::currentIndexChanged ), infoUpdater );

View File

@ -59,7 +59,7 @@ QgsProjectElevationSettingsWidget::QgsProjectElevationSettingsWidget( QWidget *p
mStackedWidget->setSizeMode( QgsStackedWidget::SizeMode::CurrentPageOnly );
mStackedWidget->setCurrentWidget( mPageFlat );
connect( mComboTerrainType, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
connect( mComboTerrainType, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
const QString terrainType = mComboTerrainType->currentData().toString();
if ( terrainType == QLatin1String( "flat" ) )
{

View File

@ -849,7 +849,7 @@ void QgisApp::annotationItemTypeAdded( int id )
}
connect( tool->mapTool(), &QgsMapTool::deactivated, tool->mapTool(), &QObject::deleteLater );
connect( tool->handler(), &QgsCreateAnnotationItemMapToolHandler::itemCreated, this, [this, tool] {
connect( tool->handler(), &QgsCreateAnnotationItemMapToolHandler::itemCreated, this, [=] {
QgsAnnotationItem *item = tool->handler()->takeCreatedItem();
QgsAnnotationLayer *targetLayer = qobject_cast<QgsAnnotationLayer *>( activeLayer() );
if ( !targetLayer )
@ -1217,7 +1217,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
showBookmarksDock->setWhatsThis( tr( "Show Bookmarks Panel" ) );
mBookMarksDockWidget->setToggleVisibilityAction( mActionShowBookmarkManager );
connect( mActionShowBookmarks, &QAction::triggered, this, [this] { showBookmarks(); } );
connect( mActionShowBookmarks, &QAction::triggered, this, [=] { showBookmarks(); } );
endProfile();
@ -1346,7 +1346,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
mMapStyleWidget = new QgsLayerStylingWidget( mMapCanvas, mInfoBar, mMapLayerPanelFactories );
mMapStylingDock->setWidget( mMapStyleWidget );
connect( mMapStyleWidget, &QgsLayerStylingWidget::styleChanged, this, &QgisApp::updateLabelToolButtons );
connect( mMapStyleWidget, &QgsLayerStylingWidget::layerStyleChanged, this, [this]( const QString &styleName ) {
connect( mMapStyleWidget, &QgsLayerStylingWidget::layerStyleChanged, this, [=]( const QString &styleName ) {
if ( !QgsMapLayerStyleManager::isDefault( styleName ) && !styleName.isEmpty() )
{
mMapStylingDock->setWindowTitle( tr( "Layer Styling (%1)" ).arg( styleName ) );
@ -1383,7 +1383,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
startProfile( tr( "Snapping dialog" ) );
mSnappingDialog = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, this );
connect( mSnappingDialog, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [this] { QgsProject::instance()->setSnappingConfig( mSnappingDialog->config() ); } );
connect( mSnappingDialog, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [=] { QgsProject::instance()->setSnappingConfig( mSnappingDialog->config() ); } );
QString mainSnappingWidgetMode = QgsSettings().value( QStringLiteral( "/qgis/mainSnappingWidgetMode" ), "dialog" ).toString();
if ( mainSnappingWidgetMode == QLatin1String( "dock" ) )
{
@ -1448,11 +1448,11 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget );
mBrowserWidget->hide();
// Only connect the first widget: the model is shared, there is no need to refresh multiple times.
connect( this, &QgisApp::connectionsChanged, mBrowserWidget, [this] {
connect( this, &QgisApp::connectionsChanged, mBrowserWidget, [=] {
if ( !mBlockBrowser1Refresh && !mBlockBrowser2Refresh )
mBrowserWidget->refresh();
} );
connect( mBrowserWidget, &QgsBrowserDockWidget::connectionsChanged, this, [this] {
connect( mBrowserWidget, &QgsBrowserDockWidget::connectionsChanged, this, [=] {
mBlockBrowser1Refresh++;
emit connectionsChanged();
mBlockBrowser1Refresh--;
@ -1464,7 +1464,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
mBrowserWidget2->setObjectName( QStringLiteral( "Browser2" ) );
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget2 );
mBrowserWidget2->hide();
connect( mBrowserWidget2, &QgsBrowserDockWidget::connectionsChanged, this, [this] {
connect( mBrowserWidget2, &QgsBrowserDockWidget::connectionsChanged, this, [=] {
mBlockBrowser2Refresh++;
emit connectionsChanged();
mBlockBrowser2Refresh--;
@ -1510,7 +1510,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::nmeaLogFileChanged, mGpsLogging, &QgsAppGpsLogging::setNmeaLogFile );
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::gpkgLogDestinationChanged, mGpsLogging, &QgsAppGpsLogging::setGpkgLogFile );
connect( mGpsLogging, &QgsAppGpsLogging::gpkgLoggingFailed, mGpsSettingsMenu, &QgsAppGpsSettingsMenu::onGpkgLoggingFailed );
connect( mGpsDigitizing, &QgsAppGpsDigitizing::trackIsEmptyChanged, mGpsToolBar, [this]( bool isEmpty ) { mGpsToolBar->setResetTrackButtonEnabled( !isEmpty ); } );
connect( mGpsDigitizing, &QgsAppGpsDigitizing::trackIsEmptyChanged, mGpsToolBar, [=]( bool isEmpty ) { mGpsToolBar->setResetTrackButtonEnabled( !isEmpty ); } );
mpGpsWidget = new QgsGpsInformationWidget( mGpsConnection, mMapCanvas, mGpsDigitizing );
QgsPanelWidgetStack *gpsStack = new QgsPanelWidgetStack();
@ -1581,7 +1581,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
// QgsMessageLog::logMessage( tr( "QGIS starting…" ), QString(), Qgis::MessageLevel::Info );
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, [this] { setTitleBarText_( *this ); } );
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, [=] { setTitleBarText_( *this ); } );
// set QGIS specific srs validation
connect( this, &QgisApp::customCrsValidation, this, &QgisApp::validateCrs );
@ -1594,7 +1594,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
new QgsCredentialDialog( this );
mLocatorWidget->setMapCanvas( mMapCanvas );
connect( mLocatorWidget, &QgsLocatorWidget::configTriggered, this, [this] { showOptionsDialog( this, QStringLiteral( "mOptionsLocatorSettings" ) ); } );
connect( mLocatorWidget, &QgsLocatorWidget::configTriggered, this, [=] { showOptionsDialog( this, QStringLiteral( "mOptionsLocatorSettings" ) ); } );
qApp->processEvents();
@ -1863,7 +1863,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
QgsGui::shortcutsManager()->registerAllChildren( mSnappingWidget );
// register additional action
auto registerShortcuts = [this]( const QString &sequence, const QString &objectName, const QString &whatsThis ) {
auto registerShortcuts = [=]( const QString &sequence, const QString &objectName, const QString &whatsThis ) {
QShortcut *sc = new QShortcut( QKeySequence( sequence ), this );
sc->setContext( Qt::ApplicationShortcut );
sc->setObjectName( objectName );
@ -1929,13 +1929,13 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
mStartupProfilerWidgetFactory.reset( std::make_unique<QgsProfilerWidgetFactory>( profiler ) );
auto toggleRevert = [this] {
auto toggleRevert = [=] {
mActionRevertProject->setEnabled( QgsProject::instance()->isDirty() && !QgsProject::instance()->fileName().isEmpty() );
};
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, mActionRevertProject, toggleRevert );
connect( QgsProject::instance(), &QgsProject::fileNameChanged, mActionRevertProject, toggleRevert );
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [this] {
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [=] {
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
} );
connect( mMapCanvas, &QgsMapCanvas::panDistanceBearingChanged, this, &QgisApp::showPanMessage );
@ -1970,7 +1970,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
mAppCanvasFiltering = new QgsAppCanvasFiltering( this );
mAppCanvasFiltering->setupElevationControllerAction( mActionElevationController, mMapCanvas );
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloaded, this, [this]( const QStringList &families, const QString &licenseDetails ) {
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloaded, this, [=]( const QStringList &families, const QString &licenseDetails ) {
const QString shortMessage = tr( "Installed font %1" ).arg( families.join( QLatin1String( ", " ) ) );
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
if ( !licenseDetails.isEmpty() )
@ -1992,7 +1992,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
canvas->refreshAllLayers();
} );
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloadErrorOccurred, this, [this]( const QUrl &, const QString &identifier, const QString &error ) {
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloadErrorOccurred, this, [=]( const QUrl &, const QString &identifier, const QString &error ) {
const QString shortMessage = identifier.isEmpty() ? tr( "Font installation failed" )
: tr( "%1 font installation failed" ).arg( identifier );
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
@ -2426,10 +2426,10 @@ QList<QgsMapLayer *> QgisApp::handleDropUriList( const QgsMimeDataUtils::UriList
QgsScopedProxyProgressTask task( tr( "Loading layers" ) );
auto showLayerLoadWarnings = [this]( const QString &title, const QString &shortMessage, const QString &longMessage, Qgis::MessageLevel level ) {
auto showLayerLoadWarnings = [=]( const QString &title, const QString &shortMessage, const QString &longMessage, Qgis::MessageLevel level ) {
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( title, shortMessage );
QPushButton *detailsButton = new QPushButton( tr( "Details" ) );
connect( detailsButton, &QPushButton::clicked, this, [title, longMessage] {
connect( detailsButton, &QPushButton::clicked, this, [=] {
if ( QgsMessageViewer *dialog = dynamic_cast<QgsMessageViewer *>( QgsMessageOutput::createMessageOutput() ) )
{
dialog->setTitle( title );
@ -2712,7 +2712,7 @@ void QgisApp::dataSourceManager( const QString &pageName, const QString &layerUr
}
} );
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addRasterLayers, this, []( const QStringList &layersList ) {
connect( mDataSourceManagerDialog, &QgsDataSourceManagerDialog::addRasterLayers, this, [=]( const QStringList &layersList ) {
bool ok = false;
QList<QgsMapLayer *> addedLayers = QgsAppLayerHandling::addGdalRasterLayers( layersList, ok );
if ( ok )
@ -2890,15 +2890,15 @@ void QgisApp::createActions()
// Project Menu Items
connect( mActionNewProject, &QAction::triggered, this, [this] { fileNew(); } );
connect( mActionNewProject, &QAction::triggered, this, [=] { fileNew(); } );
connect( mActionNewBlankProject, &QAction::triggered, this, &QgisApp::fileNewBlank );
connect( mActionOpenProject, &QAction::triggered, this, &QgisApp::fileOpen );
connect( mActionRevertProject, &QAction::triggered, this, &QgisApp::fileRevert );
connect( mActionSaveProject, &QAction::triggered, this, &QgisApp::fileSave );
connect( mActionCloseProject, &QAction::triggered, this, &QgisApp::fileClose );
connect( mActionSaveProjectAs, &QAction::triggered, this, &QgisApp::fileSaveAs );
connect( mActionSaveMapAsImage, &QAction::triggered, this, [this] { saveMapAsImage(); } );
connect( mActionSaveMapAsPdf, &QAction::triggered, this, [this] { saveMapAsPdf(); } );
connect( mActionSaveMapAsImage, &QAction::triggered, this, [=] { saveMapAsImage(); } );
connect( mActionSaveMapAsPdf, &QAction::triggered, this, [=] { saveMapAsPdf(); } );
connect( mActionNewMapCanvas, &QAction::triggered, this, &QgisApp::newMapCanvas );
connect( mActionNew3DMapCanvas, &QAction::triggered, this, &QgisApp::new3DMapCanvas );
connect( mActionNew3DMapCanvasGlobe, &QAction::triggered, this, &QgisApp::new3DMapCanvasGlobe );
@ -2913,13 +2913,13 @@ void QgisApp::createActions()
connect( mActionUndo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::undo );
connect( mActionRedo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::redo );
connect( mActionCutFeatures, &QAction::triggered, this, [this] { cutSelectionToClipboard(); } );
connect( mActionCopyFeatures, &QAction::triggered, this, [this] { copySelectionToClipboard(); } );
connect( mActionPasteFeatures, &QAction::triggered, this, [this] { pasteFromClipboard(); } );
connect( mActionCutFeatures, &QAction::triggered, this, [=] { cutSelectionToClipboard(); } );
connect( mActionCopyFeatures, &QAction::triggered, this, [=] { copySelectionToClipboard(); } );
connect( mActionPasteFeatures, &QAction::triggered, this, [=] { pasteFromClipboard(); } );
connect( mActionPasteAsNewVector, &QAction::triggered, this, &QgisApp::pasteAsNewVector );
connect( mActionPasteAsNewMemoryVector, &QAction::triggered, this, [this] { pasteAsNewMemoryVector(); } );
connect( mActionCopyStyle, &QAction::triggered, this, [this] { copyStyle(); } );
connect( mActionPasteStyle, &QAction::triggered, this, [this] { applyStyleToGroup(); } );
connect( mActionPasteAsNewMemoryVector, &QAction::triggered, this, [=] { pasteAsNewMemoryVector(); } );
connect( mActionCopyStyle, &QAction::triggered, this, [=] { copyStyle(); } );
connect( mActionPasteStyle, &QAction::triggered, this, [=] { applyStyleToGroup(); } );
connect( mActionCopyLayer, &QAction::triggered, this, &QgisApp::copyLayer );
connect( mActionPasteLayer, &QAction::triggered, this, &QgisApp::pasteLayer );
connect( mActionAddFeature, &QAction::triggered, this, &QgisApp::addFeature );
@ -2931,7 +2931,7 @@ void QgisApp::createActions()
connect( mActionReshapeFeatures, &QAction::triggered, this, &QgisApp::reshapeFeatures );
connect( mActionSplitFeatures, &QAction::triggered, this, &QgisApp::splitFeatures );
connect( mActionSplitParts, &QAction::triggered, this, &QgisApp::splitParts );
connect( mActionDeleteSelected, &QAction::triggered, this, [this] { deleteSelected( nullptr, nullptr, true ); } );
connect( mActionDeleteSelected, &QAction::triggered, this, [=] { deleteSelected( nullptr, nullptr, true ); } );
connect( mActionAddRing, &QAction::triggered, this, &QgisApp::addRing );
connect( mActionFillRing, &QAction::triggered, this, &QgisApp::fillRing );
connect( mActionAddPart, &QAction::triggered, this, &QgisApp::addPart );
@ -2948,7 +2948,7 @@ void QgisApp::createActions()
connect( mActionSnappingOptions, &QAction::triggered, this, &QgisApp::snappingOptions );
connect( mActionOffsetCurve, &QAction::triggered, this, &QgisApp::offsetCurve );
connect( mActionReverseLine, &QAction::triggered, this, &QgisApp::reverseLine );
connect( mActionTrimExtendFeature, &QAction::triggered, this, [this] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::TrimExtendFeature ) ); } );
connect( mActionTrimExtendFeature, &QAction::triggered, this, [=] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::TrimExtendFeature ) ); } );
// View Menu Items
connect( mActionPan, &QAction::triggered, this, &QgisApp::pan );
@ -2962,7 +2962,7 @@ void QgisApp::createActions()
connect( mActionDeselectAll, &QAction::triggered, this, &QgisApp::deselectAll );
connect( mActionDeselectActiveLayer, &QAction::triggered, this, &QgisApp::deselectActiveLayer );
connect( mActionSelectAll, &QAction::triggered, this, &QgisApp::selectAll );
connect( mActionReselect, &QAction::triggered, this, [this] {
connect( mActionReselect, &QAction::triggered, this, [=] {
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
if ( !vlayer )
{
@ -2984,7 +2984,7 @@ void QgisApp::createActions()
connect( mActionMeasure, &QAction::triggered, this, &QgisApp::measure );
connect( mActionMeasureArea, &QAction::triggered, this, &QgisApp::measureArea );
connect( mActionMeasureAngle, &QAction::triggered, this, &QgisApp::measureAngle );
connect( mActionMeasureBearing, &QAction::triggered, this, [this] { setMapTool( mMapTools->mapTool( QgsAppMapTools::MeasureBearing ) ); } );
connect( mActionMeasureBearing, &QAction::triggered, this, [=] { setMapTool( mMapTools->mapTool( QgsAppMapTools::MeasureBearing ) ); } );
connect( mActionZoomFullExtent, &QAction::triggered, this, &QgisApp::zoomFull );
connect( mActionZoomToLayer, &QAction::triggered, this, &QgisApp::zoomToLayerExtent );
connect( mActionZoomToLayers, &QAction::triggered, this, &QgisApp::zoomToLayerExtent );
@ -2993,7 +2993,7 @@ void QgisApp::createActions()
connect( mActionZoomNext, &QAction::triggered, this, &QgisApp::zoomToNext );
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
connect( mActionNewBookmark, &QAction::triggered, this, [this] { newBookmark( true ); } );
connect( mActionNewBookmark, &QAction::triggered, this, [=] { newBookmark( true ); } );
connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } );
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
@ -3004,7 +3004,7 @@ void QgisApp::createActions()
// Layer Menu Items
connect( mActionDataSourceManager, &QAction::triggered, this, [this]() { dataSourceManager(); } );
connect( mActionDataSourceManager, &QAction::triggered, this, [=]() { dataSourceManager(); } );
connect( mActionNewVectorLayer, &QAction::triggered, this, &QgisApp::newVectorLayer );
#ifdef HAVE_SPATIALITE
connect( mActionNewSpatiaLiteLayer, &QAction::triggered, this, &QgisApp::newSpatialiteLayer );
@ -3018,56 +3018,56 @@ void QgisApp::createActions()
connect( mActionShowMeshCalculator, &QAction::triggered, this, &QgisApp::showMeshCalculator );
connect( mActionEmbedLayers, &QAction::triggered, this, &QgisApp::embedLayers );
connect( mActionAddLayerDefinition, &QAction::triggered, this, &QgisApp::addLayerDefinition );
connect( mActionAddOgrLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "ogr" ) ); } );
connect( mActionAddRasterLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "gdal" ) ); } );
connect( mActionAddMeshLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "mdal" ) ); } );
connect( mActionAddPgLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "postgres" ) ); } );
connect( mActionAddOgrLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "ogr" ) ); } );
connect( mActionAddRasterLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "gdal" ) ); } );
connect( mActionAddMeshLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "mdal" ) ); } );
connect( mActionAddPgLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "postgres" ) ); } );
#ifdef HAVE_SPATIALITE
connect( mActionAddSpatiaLiteLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "spatialite" ) ); } );
connect( mActionAddSpatiaLiteLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "spatialite" ) ); } );
#endif
connect( mActionAddMssqlLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "mssql" ) ); } );
connect( mActionAddOracleLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "oracle" ) ); } );
connect( mActionAddHanaLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "hana" ) ); } );
connect( mActionAddWmsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "wms" ) ); } );
connect( mActionAddXyzLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
connect( mActionAddGpsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "gpx" ) ); } );
connect( mActionAddWcsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
connect( mActionAddStacLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "stac" ) ); } );
connect( mActionAddMssqlLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "mssql" ) ); } );
connect( mActionAddOracleLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "oracle" ) ); } );
connect( mActionAddHanaLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "hana" ) ); } );
connect( mActionAddWmsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "wms" ) ); } );
connect( mActionAddXyzLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
connect( mActionAddGpsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "gpx" ) ); } );
connect( mActionAddWcsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
connect( mActionAddStacLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "stac" ) ); } );
#ifdef HAVE_SPATIALITE
connect( mActionAddWfsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
connect( mActionAddWfsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
#endif
connect( mActionAddAfsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
connect( mActionAddDelimitedText, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "delimitedtext" ) ); } );
connect( mActionAddVirtualLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "virtual" ) ); } );
connect( mActionOpenTable, &QAction::triggered, this, [this] {
connect( mActionAddAfsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
connect( mActionAddDelimitedText, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "delimitedtext" ) ); } );
connect( mActionAddVirtualLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "virtual" ) ); } );
connect( mActionOpenTable, &QAction::triggered, this, [=] {
QgsSettings settings;
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
attributeTable( initialMode );
} );
connect( mActionOpenTableSelected, &QAction::triggered, this, [this] {
connect( mActionOpenTableSelected, &QAction::triggered, this, [=] {
attributeTable( QgsAttributeTableFilterModel::ShowSelected );
} );
connect( mActionOpenTableVisible, &QAction::triggered, this, [this] {
connect( mActionOpenTableVisible, &QAction::triggered, this, [=] {
attributeTable( QgsAttributeTableFilterModel::ShowVisible );
} );
connect( mActionOpenTableEdited, &QAction::triggered, this, [this] {
connect( mActionOpenTableEdited, &QAction::triggered, this, [=] {
attributeTable( QgsAttributeTableFilterModel::ShowEdited );
} );
connect( mActionOpenFieldCalc, &QAction::triggered, this, &QgisApp::fieldCalculator );
connect( mActionToggleEditing, &QAction::triggered, this, [this] { toggleEditing(); } );
connect( mActionToggleEditing, &QAction::triggered, this, [=] { toggleEditing(); } );
connect( mActionSaveLayerEdits, &QAction::triggered, this, &QgisApp::saveActiveLayerEdits );
connect( mActionSaveEdits, &QAction::triggered, this, [this] { saveEdits(); } );
connect( mActionSaveAllEdits, &QAction::triggered, this, [this] { saveAllEdits(); } );
connect( mActionSaveEdits, &QAction::triggered, this, [=] { saveEdits(); } );
connect( mActionSaveAllEdits, &QAction::triggered, this, [=] { saveAllEdits(); } );
connect( mActionRollbackEdits, &QAction::triggered, this, &QgisApp::rollbackEdits );
connect( mActionRollbackAllEdits, &QAction::triggered, this, [this] { rollbackAllEdits(); } );
connect( mActionCancelEdits, &QAction::triggered, this, [this] { cancelEdits(); } );
connect( mActionCancelAllEdits, &QAction::triggered, this, [this] { cancelAllEdits(); } );
connect( mActionLayerSaveAs, &QAction::triggered, this, [this] { saveAsFile(); } );
connect( mActionRollbackAllEdits, &QAction::triggered, this, [=] { rollbackAllEdits(); } );
connect( mActionCancelEdits, &QAction::triggered, this, [=] { cancelEdits(); } );
connect( mActionCancelAllEdits, &QAction::triggered, this, [=] { cancelAllEdits(); } );
connect( mActionLayerSaveAs, &QAction::triggered, this, [=] { saveAsFile(); } );
connect( mActionSaveLayerDefinition, &QAction::triggered, this, &QgisApp::saveAsLayerDefinition );
connect( mActionRemoveLayer, &QAction::triggered, this, &QgisApp::removeLayer );
connect( mActionDuplicateLayer, &QAction::triggered, this, [this] { duplicateLayers(); } );
connect( mActionDuplicateLayer, &QAction::triggered, this, [=] { duplicateLayers(); } );
connect( mActionSetLayerScaleVisibility, &QAction::triggered, this, &QgisApp::setLayerScaleVisibility );
connect( mActionSetLayerCRS, &QAction::triggered, this, &QgisApp::setLayerCrs );
connect( mActionSetProjectCRSFromLayer, &QAction::triggered, this, &QgisApp::setProjectCrsFromLayer );
@ -3094,7 +3094,7 @@ void QgisApp::createActions()
connect( mActionToggleFullScreen, &QAction::triggered, this, &QgisApp::toggleFullScreen );
connect( mActionTogglePanelsVisibility, &QAction::triggered, this, &QgisApp::togglePanelsVisibility );
connect( mActionToggleMapOnly, &QAction::triggered, this, &QgisApp::toggleMapOnly );
connect( mActionProjectProperties, &QAction::triggered, this, [this] { projectProperties( QString() ); } );
connect( mActionProjectProperties, &QAction::triggered, this, [=] { projectProperties( QString() ); } );
connect( mActionOptions, &QAction::triggered, this, &QgisApp::options );
connect( mActionCustomProjection, &QAction::triggered, this, &QgisApp::customProjection );
connect( mActionConfigureShortcuts, &QAction::triggered, this, &QgisApp::configureShortcuts );
@ -3175,13 +3175,13 @@ void QgisApp::createActions()
connect( mActionSponsors, &QAction::triggered, this, &QgisApp::sponsors );
connect( mActionShowPinnedLabels, &QAction::toggled, this, &QgisApp::showPinnedLabels );
connect( mActionShowUnplacedLabels, &QAction::toggled, this, [this]( bool active ) {
connect( mActionShowUnplacedLabels, &QAction::toggled, this, [=]( bool active ) {
QgsLabelingEngineSettings engineSettings = QgsProject::instance()->labelingEngineSettings();
engineSettings.setFlag( Qgis::LabelingFlag::DrawUnplacedLabels, active );
QgsProject::instance()->setLabelingEngineSettings( engineSettings );
refreshMapCanvas( true );
} );
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, this, [=] {
whileBlocking( mActionShowUnplacedLabels )->setChecked( QgsProject::instance()->labelingEngineSettings().testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) );
} );
connect( mActionPinLabels, &QAction::triggered, this, &QgisApp::pinLabels );
@ -3193,8 +3193,8 @@ void QgisApp::createActions()
connect( mActionDiagramProperties, &QAction::triggered, this, &QgisApp::diagramProperties );
connect( mActionCreateAnnotationLayer, &QAction::triggered, this, &QgisApp::createAnnotationLayer );
connect( mActionModifyAnnotation, &QAction::triggered, this, [this] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::AnnotationEdit ) ); } );
connect( mMainAnnotationLayerProperties, &QAction::triggered, this, [this] {
connect( mActionModifyAnnotation, &QAction::triggered, this, [=] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::AnnotationEdit ) ); } );
connect( mMainAnnotationLayerProperties, &QAction::triggered, this, [=] {
showLayerProperties( QgsProject::instance()->mainAnnotationLayer() );
} );
@ -3207,15 +3207,15 @@ void QgisApp::createActions()
{
QShortcut *copyShortcut = new QShortcut( QKeySequence::Copy, widget );
copyShortcut->setContext( Qt::WidgetWithChildrenShortcut );
connect( copyShortcut, &QShortcut::activated, this, [this] { copySelectionToClipboard(); } );
connect( copyShortcut, &QShortcut::activated, this, [=] { copySelectionToClipboard(); } );
QShortcut *cutShortcut = new QShortcut( QKeySequence::Cut, widget );
cutShortcut->setContext( Qt::WidgetWithChildrenShortcut );
connect( cutShortcut, &QShortcut::activated, this, [this] { cutSelectionToClipboard(); } );
connect( cutShortcut, &QShortcut::activated, this, [=] { cutSelectionToClipboard(); } );
QShortcut *pasteShortcut = new QShortcut( QKeySequence::Paste, widget );
pasteShortcut->setContext( Qt::WidgetWithChildrenShortcut );
connect( pasteShortcut, &QShortcut::activated, this, [this] { pasteFromClipboard(); } );
connect( pasteShortcut, &QShortcut::activated, this, [=] { pasteFromClipboard(); } );
QShortcut *selectAllShortcut = new QShortcut( QKeySequence::SelectAll, widget );
selectAllShortcut->setContext( Qt::WidgetWithChildrenShortcut );
@ -3547,13 +3547,13 @@ void QgisApp::createToolBars()
mSnappingWidget = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, mSnappingToolBar );
mSnappingWidget->setObjectName( QStringLiteral( "mSnappingWidget" ) );
connect( mSnappingWidget, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [this] { QgsProject::instance()->setSnappingConfig( mSnappingWidget->config() ); } );
connect( mSnappingWidget, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [=] { QgsProject::instance()->setSnappingConfig( mSnappingWidget->config() ); } );
mSnappingToolBar->addWidget( mSnappingWidget );
mTracer = new QgsMapCanvasTracer( mMapCanvas, messageBar() );
mTracer->setActionEnableTracing( mSnappingWidget->enableTracingAction() );
mTracer->setActionEnableSnapping( mSnappingWidget->enableSnappingAction() );
connect( mSnappingWidget->tracingOffsetSpinBox(), static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double v ) { mTracer->setOffset( v ); } );
connect( mSnappingWidget->tracingOffsetSpinBox(), static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double v ) { mTracer->setOffset( v ); } );
mDigitizingTechniqueManager->setupToolBars();
@ -4006,7 +4006,7 @@ void QgisApp::createStatusBar()
mMagnifierWidget->setFont( statusBarFont );
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateMagnification );
connect( mMapCanvas, &QgsMapCanvas::scaleLockChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateScaleLock );
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::magnificationChanged, mMapCanvas, [this]( double factor ) { mMapCanvas->setMagnificationFactor( factor ); } );
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::magnificationChanged, mMapCanvas, [=]( double factor ) { mMapCanvas->setMagnificationFactor( factor ); } );
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::scaleLockChanged, mMapCanvas, &QgsMapCanvas::setScaleLocked );
mMagnifierWidget->updateMagnification( QSettings().value( QStringLiteral( "/qgis/magnifier_factor_default" ), 1.0 ).toDouble() );
mStatusBar->addPermanentWidget( mMagnifierWidget, 0 );
@ -4079,7 +4079,7 @@ void QgisApp::createStatusBar()
mLocatorWidget = new QgsLocatorWidget( mStatusBar );
mStatusBar->addPermanentWidget( mLocatorWidget, 0, QgsStatusBar::AnchorLeft );
QShortcut *locatorShortCut = new QShortcut( QKeySequence( tr( "Ctrl+K" ) ), this );
connect( locatorShortCut, &QShortcut::activated, mLocatorWidget, [this] { mLocatorWidget->search( QString() ); } );
connect( locatorShortCut, &QShortcut::activated, mLocatorWidget, [=] { mLocatorWidget->search( QString() ); } );
locatorShortCut->setObjectName( QStringLiteral( "Locator" ) );
locatorShortCut->setWhatsThis( tr( "Trigger Locator" ) );
@ -4358,7 +4358,7 @@ void QgisApp::setupConnections()
connect( mMapCanvas, &QgsMapCanvas::zoomLastStatusChanged, mActionZoomLast, &QAction::setEnabled );
connect( mMapCanvas, &QgsMapCanvas::zoomNextStatusChanged, mActionZoomNext, &QAction::setEnabled );
connect( mRenderSuppressionCBox, &QAbstractButton::toggled, this, [this]( bool flag ) {
connect( mRenderSuppressionCBox, &QAbstractButton::toggled, this, [=]( bool flag ) {
const auto canvases = mapCanvases();
for ( QgsMapCanvas *canvas : canvases )
canvas->setRenderFlag( flag );
@ -4377,18 +4377,18 @@ void QgisApp::setupConnections()
// mOnTheFlyProjectionStatusButton with the correct icon, see https://github.com/qgis/QGIS/issues/53768
connect( QgsProject::instance(), &QgsProject::cleared, this, &QgisApp::updateCrsStatusBar );
connect( QgsProject::instance()->viewSettings(), &QgsProjectViewSettings::mapScalesChanged, this, [this] { mScaleWidget->updateScales(); } );
connect( QgsProject::instance()->viewSettings(), &QgsProjectViewSettings::mapScalesChanged, this, [=] { mScaleWidget->updateScales(); } );
connect( QgsProject::instance(), &QgsProject::missingDatumTransforms, this, [this]( const QStringList &transforms ) {
connect( QgsProject::instance(), &QgsProject::missingDatumTransforms, this, [=]( const QStringList &transforms ) {
QString message = tr( "Transforms are not installed: %1 " ).arg( transforms.join( QLatin1String( " ," ) ) );
messageBar()->pushWarning( tr( "Missing datum transforms" ), message );
} );
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, mMapCanvas, [this] {
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, mMapCanvas, [=] {
mMapCanvas->setLabelingEngineSettings( QgsProject::instance()->labelingEngineSettings() );
} );
connect( QgsProject::instance(), &QgsProject::backgroundColorChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::backgroundColorChanged, this, [=] {
const QColor backgroundColor = QgsProject::instance()->backgroundColor();
const auto constMapCanvases = mapCanvases();
for ( QgsMapCanvas *canvas : constMapCanvases )
@ -4402,7 +4402,7 @@ void QgisApp::setupConnections()
}
} );
connect( QgsProject::instance(), &QgsProject::selectionColorChanged, this, [this] {
connect( QgsProject::instance(), &QgsProject::selectionColorChanged, this, [=] {
const QColor selectionColor = QgsProject::instance()->selectionColor();
const auto constMapCanvases = mapCanvases();
for ( QgsMapCanvas *canvas : constMapCanvases )
@ -4423,13 +4423,13 @@ void QgisApp::setupConnections()
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::removedChildren, this, &QgisApp::markDirty );
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::removedChildren, this, &QgisApp::updateNewLayerInsertionPoint );
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::visibilityChanged, this, &QgisApp::markDirty );
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::customPropertyChanged, this, [this]( QgsLayerTreeNode *, const QString &key ) {
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::customPropertyChanged, this, [=]( QgsLayerTreeNode *, const QString &key ) {
// only mark dirty for non-view only changes
if ( !QgsLayerTreeView::viewOnlyCustomProperties().contains( key ) )
QgisApp::markDirty();
} );
connect( mLayerTreeView, &QgsLayerTreeView::datasetsDropped, this, [this]( QDropEvent *event ) {
connect( mLayerTreeView, &QgsLayerTreeView::datasetsDropped, this, [=]( QDropEvent *event ) {
mLayerTreeDrop = true;
dropEvent( event );
} );
@ -4476,7 +4476,7 @@ void QgisApp::setupConnections()
connect( QgsProject::instance(), &QgsProject::transactionGroupsChanged, this, &QgisApp::onTransactionGroupsChanged );
// Handle dirty raster attribute tables
connect( QgsProject::instance(), qOverload<const QList<QgsMapLayer *> &>( &QgsProject::layersWillBeRemoved ), this, [this]( const QList<QgsMapLayer *> &layers ) {
connect( QgsProject::instance(), qOverload<const QList<QgsMapLayer *> &>( &QgsProject::layersWillBeRemoved ), this, [=]( const QList<QgsMapLayer *> &layers ) {
checkUnsavedRasterAttributeTableEdits( layers, false );
} );
@ -4925,12 +4925,12 @@ void QgisApp::initLayerTreeView()
mFilterLegendToggleShowPrivateLayersAction = new QAction( tr( "Show Private Layers" ), this );
mFilterLegendToggleShowPrivateLayersAction->setCheckable( true );
connect( mFilterLegendToggleShowPrivateLayersAction, &QAction::toggled, this, [this]( bool showPrivateLayers ) { layerTreeView()->setShowPrivateLayers( showPrivateLayers ); } );
connect( mFilterLegendToggleShowPrivateLayersAction, &QAction::toggled, this, [=]( bool showPrivateLayers ) { layerTreeView()->setShowPrivateLayers( showPrivateLayers ); } );
filterLegendMenu->addAction( mFilterLegendToggleShowPrivateLayersAction );
mFilterLegendToggleHideValidLayersAction = new QAction( tr( "Show Broken Layers Only" ), this );
mFilterLegendToggleHideValidLayersAction->setCheckable( true );
connect( mFilterLegendToggleHideValidLayersAction, &QAction::toggled, this, [this]( bool hideValidLayers ) { layerTreeView()->setHideValidLayers( hideValidLayers ); } );
connect( mFilterLegendToggleHideValidLayersAction, &QAction::toggled, this, [=]( bool hideValidLayers ) { layerTreeView()->setHideValidLayers( hideValidLayers ); } );
filterLegendMenu->addAction( mFilterLegendToggleHideValidLayersAction );
mLegendExpressionFilterButton = new QgsLegendFilterButton( this );
@ -5234,7 +5234,7 @@ void QgisApp::updateRecentProjectPaths()
{
mRecentProjectsMenu->addSeparator();
QAction *clearRecentProjectsAction = mRecentProjectsMenu->addAction( tr( "Clear List" ) );
connect( clearRecentProjectsAction, &QAction::triggered, mWelcomePage, [this]() { mWelcomePage->clearRecentProjects(); } );
connect( clearRecentProjectsAction, &QAction::triggered, mWelcomePage, [=]() { mWelcomePage->clearRecentProjects(); } );
}
std::vector<QgsNative::RecentProjectProperties> recentProjects;
@ -6513,7 +6513,7 @@ bool QgisApp::addProject( const QString &projectFile )
{
// we have to delay the thumbnail creation until after the canvas has refreshed for the first time
QMetaObject::Connection *connection = new QMetaObject::Connection();
*connection = connect( mMapCanvas, &QgsMapCanvas::mapCanvasRefreshed, this, [this, connection, customHandlerIcon]() {
*connection = connect( mMapCanvas, &QgsMapCanvas::mapCanvasRefreshed, this, [=]() {
QObject::disconnect( *connection );
delete connection;
saveRecentProjectPath( true, customHandlerIcon );
@ -8104,7 +8104,7 @@ QString QgisApp::saveAsRasterFile( QgsRasterLayer *rasterLayer, const bool defau
} );
// when an error occurs:
connect( writerTask, qOverload<int, const QString &>( &QgsRasterFileWriterTask::errorOccurred ), this, [this]( int errorInt, const QString &errorMessage ) {
connect( writerTask, qOverload<int, const QString &>( &QgsRasterFileWriterTask::errorOccurred ), this, [=]( int errorInt, const QString &errorMessage ) {
const Qgis::RasterFileWriterResult error = static_cast<Qgis::RasterFileWriterResult>( errorInt );
if ( error != Qgis::RasterFileWriterResult::Canceled )
{
@ -8876,7 +8876,7 @@ bool QgisApp::uniqueLayoutTitle( QWidget *parent, QString &title, bool acceptEmp
dlg.setConflictingNameWarning( tr( "Title already exists!" ) );
dlg.buttonBox()->addButton( QDialogButtonBox::Help );
connect( dlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [helpPage] {
connect( dlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( helpPage );
} );
@ -9007,7 +9007,7 @@ void QgisApp::deleteLayoutDesigners()
void QgisApp::setupLayoutManagerConnections()
{
QgsLayoutManager *manager = QgsProject::instance()->layoutManager();
connect( manager, &QgsLayoutManager::layoutAdded, this, [this]( const QString &name ) {
connect( manager, &QgsLayoutManager::layoutAdded, this, [=]( const QString &name ) {
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
if ( !l )
return;
@ -9035,7 +9035,7 @@ void QgisApp::setupLayoutManagerConnections()
setupAtlasMapLayerAction( pl, pl->atlas()->enabled() && pl->atlas()->coverageLayer() );
} );
connect( manager, &QgsLayoutManager::layoutAboutToBeRemoved, this, [this]( const QString &name ) {
connect( manager, &QgsLayoutManager::layoutAboutToBeRemoved, this, [=]( const QString &name ) {
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
if ( l )
{
@ -9989,7 +9989,7 @@ void QgisApp::selectByForm()
dlg->setMessageBar( messageBar() );
dlg->setMapCanvas( mapCanvas() );
dlg->setAttribute( Qt::WA_DeleteOnClose );
connect( dlg, &QgsSelectByFormDialog::showFilteredFeaturesAttributeTable, dlg, [vlayer]( const QString &filter ) {
connect( dlg, &QgsSelectByFormDialog::showFilteredFeaturesAttributeTable, dlg, [=]( const QString &filter ) {
if ( !vlayer->dataProvider() )
{
return;
@ -10221,7 +10221,7 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )
QgsFixAttributeDialog *dialog = new QgsFixAttributeDialog( pasteVectorLayer, invalidFeatures, this, context );
connect( dialog, &QgsFixAttributeDialog::finished, this, [this, pastedFeatures, validFeatures, dialog, pasteVectorLayer, invalidGeometriesCount, nTotalFeatures]( int feedback ) {
connect( dialog, &QgsFixAttributeDialog::finished, this, [=]( int feedback ) {
QgsFeatureList features = pastedFeatures;
switch ( feedback )
{
@ -10503,7 +10503,7 @@ void QgisApp::canvasRefreshStarted()
mRenderProgressBarTimer.setSingleShot( true );
mRenderProgressBarTimer.setInterval( 500 );
disconnect( mRenderProgressBarTimerConnection );
mRenderProgressBarTimerConnection = connect( &mRenderProgressBarTimer, &QTimer::timeout, this, [this]() {
mRenderProgressBarTimerConnection = connect( &mRenderProgressBarTimer, &QTimer::timeout, this, [=]() {
showProgress( -1, 0 );
} );
mRenderProgressBarTimer.start();
@ -13160,7 +13160,7 @@ void QgisApp::initLayouts()
} );
auto map3dMetadata = std::make_unique<QgsLayoutItemGuiMetadata>(
QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ),
[]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * {
[=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * {
return new QgsLayout3DMapWidget( qobject_cast<QgsLayoutItem3DMap *>( item ) );
},
createRubberBand
@ -13173,7 +13173,7 @@ void QgisApp::initLayouts()
mLayoutImageDropHandler = new QgsLayoutImageDropHandler( this );
registerCustomLayoutDropHandler( mLayoutImageDropHandler );
QgsLayoutElevationProfileWidget::sBuildCopyMenuFunction = [this]( QgsLayoutElevationProfileWidget *layoutWidget, QMenu *menu ) {
QgsLayoutElevationProfileWidget::sBuildCopyMenuFunction = [=]( QgsLayoutElevationProfileWidget *layoutWidget, QMenu *menu ) {
menu->clear();
const QList<QgsElevationProfileWidget *> elevationProfileWidgets = findChildren<QgsElevationProfileWidget *>();
@ -13188,7 +13188,7 @@ void QgisApp::initLayouts()
for ( QgsElevationProfileWidget *widget : elevationProfileWidgets )
{
QAction *action = new QAction( tr( "Copy From %1" ).arg( widget->canvasName() ), menu );
connect( action, &QAction::triggered, widget, [layoutWidget, widget] {
connect( action, &QAction::triggered, widget, [=] {
layoutWidget->copySettingsFromProfileCanvas( widget->profileCanvas() );
} );
menu->addAction( action );
@ -15887,7 +15887,7 @@ void QgisApp::renameView()
renameDlg.setOverwriteEnabled( false );
renameDlg.setConflictingNameWarning( tr( "A view with this name already exists" ) );
renameDlg.buttonBox()->addButton( QDialogButtonBox::Help );
connect( renameDlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [] {
connect( renameDlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "map_views/map_view.html" ) );
} );
@ -16566,9 +16566,9 @@ void QgisApp::showLayerProperties( QgsMapLayer *mapLayer, const QString &page )
QgsVectorLayerProperties *vectorLayerPropertiesDialog = new QgsVectorLayerProperties( mMapCanvas, visibleMessageBar(), vlayer, this );
connect(
vectorLayerPropertiesDialog, static_cast<void ( QgsVectorLayerProperties::* )( QgsMapLayer * )>( &QgsVectorLayerProperties::toggleEditing ),
this, [this]( QgsMapLayer *layer ) { toggleEditing( layer ); }
this, [=]( QgsMapLayer *layer ) { toggleEditing( layer ); }
);
connect( vectorLayerPropertiesDialog, &QgsVectorLayerProperties::exportAuxiliaryLayer, this, [this]( QgsAuxiliaryLayer *layer ) {
connect( vectorLayerPropertiesDialog, &QgsVectorLayerProperties::exportAuxiliaryLayer, this, [=]( QgsAuxiliaryLayer *layer ) {
if ( layer )
{
std::unique_ptr<QgsVectorLayer> clone;

View File

@ -913,7 +913,7 @@ bool QgisAppInterface::openFeatureForm( QgsVectorLayer *vlayer, QgsFeature &f, b
void QgisAppInterface::preloadForm( const QString &uifile )
{
QTimer::singleShot( 0, this, [this, uifile] {
QTimer::singleShot( 0, this, [=] {
cacheloadForm( uifile );
} );
}

View File

@ -71,7 +71,7 @@ QgsAnimationExportDialog::QgsAnimationExportDialog( QWidget *parent, QgsMapCanva
QValidator *validator = new QRegularExpressionValidator( rx, this );
mTemplateLineEdit->setValidator( validator );
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [this] {
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "ExportAnimation/fileNameTemplate" ), mTemplateLineEdit->text() );
} );
@ -82,7 +82,7 @@ QgsAnimationExportDialog::QgsAnimationExportDialog( QWidget *parent, QgsMapCanva
mOutputDirFileWidget->setDefaultRoot( settings.value( QStringLiteral( "ExportAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
mOutputDirFileWidget->setFilePath( settings.value( QStringLiteral( "ExportAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [this] {
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [=] {
QgsSettings settings;
settings.setValue( QStringLiteral( "ExportAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
} );
@ -114,18 +114,18 @@ QgsAnimationExportDialog::QgsAnimationExportDialog( QWidget *parent, QgsMapCanva
mFrameDurationSpinBox->setValue( QgsProject::instance()->timeSettings()->timeStep() );
mTimeStepsComboBox->setCurrentIndex( mTimeStepsComboBox->findData( static_cast<int>( QgsProject::instance()->timeSettings()->timeStepUnit() ) ) );
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsAnimationExportDialog::updateExtent );
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsAnimationExportDialog::lockChanged );
connect( mSetToProjectTimeButton, &QPushButton::clicked, this, &QgsAnimationExportDialog::setToProjectTime );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "map_views/map_view.html#maptimecontrol" ) );
} );
connect( buttonBox, &QDialogButtonBox::accepted, this, [this] {
connect( buttonBox, &QDialogButtonBox::accepted, this, [=] {
emit startExport();
accept();
} );

View File

@ -239,7 +239,7 @@ bool QgsQptDataItem::handleDoubleClick()
QList<QAction *> QgsQptDataItem::actions( QWidget *parent )
{
QAction *newLayout = new QAction( tr( "New Layout from Template" ), parent );
connect( newLayout, &QAction::triggered, this, [this] {
connect( newLayout, &QAction::triggered, this, [=] {
QgisApp::instance()->openTemplate( path() );
} );
return QList<QAction *>() << newLayout;
@ -283,11 +283,11 @@ bool QgsPyDataItem::handleDoubleClick()
QList<QAction *> QgsPyDataItem::actions( QWidget *parent )
{
QAction *runScript = new QAction( tr( "&Run Script" ), parent );
connect( runScript, &QAction::triggered, this, [this] {
connect( runScript, &QAction::triggered, this, [=] {
QgisApp::instance()->runScript( path() );
} );
QAction *editScript = new QAction( tr( "Open in External &Editor" ), this );
connect( editScript, &QAction::triggered, this, [this] {
connect( editScript, &QAction::triggered, this, [=] {
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
} );
return QList<QAction *>() << runScript << editScript;
@ -634,7 +634,7 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
mManager = manager;
mIconName = QStringLiteral( "/mIconFolder.svg" );
connect( mManager, &QgsBookmarkManager::bookmarkAdded, this, [this]( const QString &id ) {
connect( mManager, &QgsBookmarkManager::bookmarkAdded, this, [=]( const QString &id ) {
const QgsBookmark newDetails = mManager->bookmarkById( id );
if ( newDetails.group().isEmpty() )
addChildItem( new QgsBookmarkItem( this, newDetails.name(), newDetails, mManager ), true );
@ -652,7 +652,7 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
}
}
} );
connect( mManager, &QgsBookmarkManager::bookmarkChanged, this, [this]( const QString &id ) {
connect( mManager, &QgsBookmarkManager::bookmarkChanged, this, [=]( const QString &id ) {
const QgsBookmark newDetails = mManager->bookmarkById( id );
// have to do a deep dive to find the old item...!
@ -730,7 +730,7 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
}
}
} );
connect( mManager, &QgsBookmarkManager::bookmarkAboutToBeRemoved, this, [this]( const QString &id ) {
connect( mManager, &QgsBookmarkManager::bookmarkAboutToBeRemoved, this, [=]( const QString &id ) {
const QgsBookmark b = mManager->bookmarkById( id );
if ( !b.group().isEmpty() )
{
@ -970,23 +970,23 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
if ( qobject_cast<QgsBookmarksItem *>( item ) )
{
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
connect( addBookmark, &QAction::triggered, this, [] {
connect( addBookmark, &QAction::triggered, this, [=] {
QgisApp::instance()->newBookmark();
} );
menu->addAction( addBookmark );
QAction *showBookmarksPanel = new QAction( tr( "Show Spatial Bookmarks Manager" ), menu );
connect( showBookmarksPanel, &QAction::triggered, this, [] {
connect( showBookmarksPanel, &QAction::triggered, this, [=] {
QgisApp::instance()->showBookmarkManager( true );
} );
menu->addAction( showBookmarksPanel );
menu->addSeparator();
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
connect( importBookmarks, &QAction::triggered, this, [this, context] {
connect( importBookmarks, &QAction::triggered, this, [=] {
importBookmarksToManager( QgsApplication::bookmarkManager(), context.messageBar() );
} );
menu->addAction( importBookmarks );
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
connect( exportBookmarks, &QAction::triggered, this, [this, context] {
connect( exportBookmarks, &QAction::triggered, this, [=] {
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << QgsApplication::bookmarkManager() << QgsProject::instance()->bookmarkManager(), context.messageBar() );
} );
menu->addAction( exportBookmarks );
@ -995,19 +995,19 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
{
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
const bool inProject = managerItem->manager() != QgsApplication::bookmarkManager();
connect( addBookmark, &QAction::triggered, this, [inProject] {
connect( addBookmark, &QAction::triggered, this, [=] {
QgisApp::instance()->newBookmark( inProject );
} );
menu->addAction( addBookmark );
menu->addSeparator();
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
connect( importBookmarks, &QAction::triggered, this, [this, managerItem, context] {
connect( importBookmarks, &QAction::triggered, this, [=] {
importBookmarksToManager( managerItem->manager(), context.messageBar() );
} );
menu->addAction( importBookmarks );
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
connect( exportBookmarks, &QAction::triggered, this, [this, managerItem, context] {
connect( exportBookmarks, &QAction::triggered, this, [=] {
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << managerItem->manager(), context.messageBar() );
} );
menu->addAction( exportBookmarks );
@ -1089,7 +1089,7 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
// Export bookmarks
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
connect( exportBookmarks, &QAction::triggered, this, [this, groupItem, context] {
connect( exportBookmarks, &QAction::triggered, this, [=] {
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << groupItem->manager(), context.messageBar(), groupItem->group() );
} );
menu->addAction( exportBookmarks );
@ -1097,7 +1097,7 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
// Add spatial bookmark
QAction *addBookmarkToGroup = new QAction( tr( "New Spatial Bookmark…" ), menu );
const bool inProject = manager != QgsApplication::bookmarkManager();
connect( addBookmarkToGroup, &QAction::triggered, this, [inProject, groupItem] {
connect( addBookmarkToGroup, &QAction::triggered, this, [=] {
QgisApp::instance()->newBookmark( inProject, groupItem->group() );
} );
menu->addAction( addBookmarkToGroup );
@ -1299,7 +1299,7 @@ bool QgsHtmlDataItem::handleDoubleClick()
QList<QAction *> QgsHtmlDataItem::actions( QWidget *parent )
{
QAction *openAction = new QAction( tr( "&Open File…" ), parent );
connect( openAction, &QAction::triggered, this, [this] {
connect( openAction, &QAction::triggered, this, [=] {
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
} );
return QList<QAction *>() << openAction;

View File

@ -28,27 +28,27 @@
QgsAppMissingGridHandler::QgsAppMissingGridHandler( QObject *parent )
: QObject( parent )
{
QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::GridDetails &grid ) {
QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::GridDetails &grid ) {
emit missingRequiredGrid( sourceCrs, destinationCrs, grid );
} );
QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &preferredOperation, const QgsDatumTransform::TransformDetails &availableOperation ) {
QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &preferredOperation, const QgsDatumTransform::TransformDetails &availableOperation ) {
emit missingPreferredGrid( sourceCrs, destinationCrs, preferredOperation, availableOperation );
} );
QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &error ) {
QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &error ) {
emit coordinateOperationCreationError( sourceCrs, destinationCrs, error );
} );
QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &desired ) {
QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &desired ) {
emit missingGridUsedByContextHandler( sourceCrs, destinationCrs, desired );
} );
QgsCoordinateTransform::setFallbackOperationOccurredHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &desired ) {
QgsCoordinateTransform::setFallbackOperationOccurredHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &desired ) {
emit fallbackOperationOccurred( sourceCrs, destinationCrs, desired );
} );
QgsCoordinateTransform::setDynamicCrsToDynamicCrsWarningHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs ) {
QgsCoordinateTransform::setDynamicCrsToDynamicCrsWarningHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs ) {
emit dynamicToDynamicWarning( sourceCrs, destinationCrs );
} );
@ -59,7 +59,7 @@ QgsAppMissingGridHandler::QgsAppMissingGridHandler( QObject *parent )
connect( this, &QgsAppMissingGridHandler::fallbackOperationOccurred, this, &QgsAppMissingGridHandler::onFallbackOperationOccurred, Qt::QueuedConnection );
connect( this, &QgsAppMissingGridHandler::dynamicToDynamicWarning, this, &QgsAppMissingGridHandler::onDynamicToDynamicWarning, Qt::QueuedConnection );
connect( QgsProject::instance(), &QgsProject::cleared, this, [this] {
connect( QgsProject::instance(), &QgsProject::cleared, this, [=] {
mAlreadyWarnedPairsForProject.clear();
mAlreadyWarnedBallparkPairsForProject.clear();
} );

View File

@ -52,7 +52,7 @@ QgsQueryHistoryDialog::QgsQueryHistoryDialog( QWidget *parent )
mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
connect( clearButton, &QPushButton::clicked, this, &QgsQueryHistoryDialog::clearHistory );
connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [this]() { close(); } );
connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [=]() { close(); } );
vl->addWidget( mButtonBox );

View File

@ -444,7 +444,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
{
QgsSettings settings;
const QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
const auto lambdaOpenAttributeTable = [initialMode] { QgisApp::instance()->attributeTable( initialMode ); };
const auto lambdaOpenAttributeTable = [=] { QgisApp::instance()->attributeTable( initialMode ); };
QAction *attributeTableAction = menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "Open &Attribute Table" ), QgisApp::instance(), lambdaOpenAttributeTable );
attributeTableAction->setEnabled( vlayer->isValid() );
}
@ -495,7 +495,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}
else
{
connect( a, &QAction::triggered, this, [layer] {
connect( a, &QAction::triggered, this, [=] {
QgisApp::instance()->changeDataSource( layer );
} );
}
@ -517,7 +517,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
{
if ( target == Qgis::MapLayerActionTarget::SingleFeature )
{
actionMenu->addAction( action->text(), action, [action, vlayer, context]() {
actionMenu->addAction( action->text(), action, [=]() {
Q_NOWARN_DEPRECATED_PUSH
action->triggerForFeature( vlayer, vlayer->selectedFeatures().at( 0 ) );
Q_NOWARN_DEPRECATED_POP
@ -526,7 +526,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}
else if ( target == Qgis::MapLayerActionTarget::MultipleFeatures )
{
actionMenu->addAction( action->text(), action, [action, vlayer, context]() {
actionMenu->addAction( action->text(), action, [=]() {
Q_NOWARN_DEPRECATED_PUSH
action->triggerForFeatures( vlayer, vlayer->selectedFeatures() );
Q_NOWARN_DEPRECATED_POP
@ -600,7 +600,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
continue;
QAction *action = menuSetCRS->addAction( tr( "Set to %1" ).arg( crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ) );
connect( action, &QAction::triggered, this, [this, crs] {
connect( action, &QAction::triggered, this, [=] {
setLayerCrs( crs );
} );
@ -632,7 +632,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( vlayer->isTemporary() && mView->selectedLayerNodes().count() == 1 )
{
QAction *actionMakePermanent = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionFileSave.svg" ) ), tr( "Make Permanent…" ), menu );
connect( actionMakePermanent, &QAction::triggered, QgisApp::instance(), [vlayer] { QgisApp::instance()->makeMemoryLayerPermanent( vlayer ); } );
connect( actionMakePermanent, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->makeMemoryLayerPermanent( vlayer ); } );
menu->addAction( actionMakePermanent );
}
// save as vector file
@ -641,11 +641,11 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( mView->selectedLayerNodes().count() == 1 )
{
QAction *actionSaveAs = new QAction( tr( "Save Features &As…" ), menuExportVector );
connect( actionSaveAs, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveAsFile(); } );
connect( actionSaveAs, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveAsFile(); } );
actionSaveAs->setEnabled( vlayer->isValid() );
menuExportVector->addAction( actionSaveAs );
QAction *actionSaveSelectedFeaturesAs = new QAction( tr( "Save &Selected Features As…" ), menuExportVector );
connect( actionSaveSelectedFeaturesAs, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveAsFile( nullptr, true ); } );
connect( actionSaveSelectedFeaturesAs, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveAsFile( nullptr, true ); } );
actionSaveSelectedFeaturesAs->setEnabled( vlayer->isValid() && vlayer->selectedFeatureCount() > 0 );
menuExportVector->addAction( actionSaveSelectedFeaturesAs );
}
@ -655,7 +655,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( vlayer->isSpatial() )
{
QAction *actionSaveStyle = new QAction( tr( "Save as &QGIS Layer Style File…" ), menuExportVector );
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveStyleFile(); } );
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveStyleFile(); } );
menuExportVector->addAction( actionSaveStyle );
}
menu->addMenu( menuExportVector );
@ -673,14 +673,14 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
if ( mView->selectedLayerNodes().count() == 1 )
{
QAction *actionSaveAs = new QAction( tr( "Save &As…" ), menuExportRaster );
connect( actionSaveAs, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveAsFile(); } );
connect( actionSaveAs, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveAsFile(); } );
menuExportRaster->addAction( actionSaveAs );
}
QAction *actionSaveAsDefinitionLayer = new QAction( tr( "Save as Layer &Definition File…" ), menuExportRaster );
QAction *actionSaveStyle = new QAction( tr( "Save as &QGIS Layer Style File…" ), menuExportRaster );
connect( actionSaveAsDefinitionLayer, &QAction::triggered, QgisApp::instance(), &QgisApp::saveAsLayerDefinition );
menuExportRaster->addAction( actionSaveAsDefinitionLayer );
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveStyleFile(); } );
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveStyleFile(); } );
menuExportRaster->addAction( actionSaveStyle );
menu->addMenu( menuExportRaster );
}
@ -728,7 +728,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
const QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
QAction *copyAction = new QAction( icon, name, copyStyleMenu );
copyAction->setToolTip( tooltip );
connect( copyAction, &QAction::triggered, this, [app, layer, category]() { app->copyStyle( layer, category ); } );
connect( copyAction, &QAction::triggered, this, [=]() { app->copyStyle( layer, category ); } );
copyStyleMenu->addAction( copyAction );
if ( category == QgsMapLayer::AllStyleCategories )
copyStyleMenu->addSeparator()->setObjectName( QLatin1String( "CopyStyleSeparator" ) );
@ -736,7 +736,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}
else
{
menuStyleManager->addAction( tr( "Copy Style" ), app, [app] { app->copyStyle(); } );
menuStyleManager->addAction( tr( "Copy Style" ), app, [=] { app->copyStyle(); } );
}
if ( layer && app->clipboard()->hasFormat( QGSCLIPBOARD_STYLE_MIME ) )
@ -767,7 +767,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
const QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
QAction *pasteAction = new QAction( icon, name, pasteStyleMenu );
pasteAction->setToolTip( tooltip );
connect( pasteAction, &QAction::triggered, this, [app, layer, category]() { app->pasteStyle( layer, category ); } );
connect( pasteAction, &QAction::triggered, this, [=]() { app->pasteStyle( layer, category ); } );
pasteStyleMenu->addAction( pasteAction );
if ( category == QgsMapLayer::AllStyleCategories )
pasteStyleMenu->addSeparator()->setObjectName( QLatin1String( "PasteStyleSeparator" ) );
@ -779,7 +779,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}
else
{
menuStyleManager->addAction( tr( "Paste Style" ), app, [app] { app->pasteStyle(); } );
menuStyleManager->addAction( tr( "Paste Style" ), app, [=] { app->pasteStyle(); } );
}
}

View File

@ -282,17 +282,17 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
connect( mMainView, &QgsDualView::formModeChanged, this, &QgsAttributeTableDialog::viewModeChanged );
// info from table to application
connect( this, &QgsAttributeTableDialog::saveEdits, this, [] { QgisApp::instance()->saveEdits(); } );
connect( this, &QgsAttributeTableDialog::saveEdits, this, [=] { QgisApp::instance()->saveEdits(); } );
QgsDockableWidgetHelper::OpeningMode openingMode = QgsDockableWidgetHelper::OpeningMode::RespectSetting;
if ( initiallyDocked )
openingMode = *initiallyDocked ? QgsDockableWidgetHelper::OpeningMode::ForceDocked : QgsDockableWidgetHelper::OpeningMode::ForceDialog;
mDockableWidgetHelper = new QgsDockableWidgetHelper( windowTitle(), this, QgisApp::instance(), QStringLiteral( "attribute-table" ), QStringList(), openingMode, true, Qt::BottomDockWidgetArea );
toggleShortcuts( !mDockableWidgetHelper->isDocked() );
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
close();
} );
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::dockModeToggled, this, [this]( bool docked ) {
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::dockModeToggled, this, [=]( bool docked ) {
if ( docked )
{
toggleShortcuts( mDockableWidgetHelper->dockWidget()->isFloating() );

View File

@ -175,7 +175,7 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
connect( mAddButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::addDatumTransform );
connect( mRemoveButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::removeDatumTransform );
connect( mEditButton, &QToolButton::clicked, this, [this] {
connect( mEditButton, &QToolButton::clicked, this, [=] {
const QModelIndexList selectedIndexes = mTableView->selectionModel()->selectedIndexes();
if ( selectedIndexes.count() > 0 )
{
@ -185,7 +185,7 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDatumTransformTableWidget::selectionChanged );
connect( mTableView, &QTableView::doubleClicked, this, [this]( const QModelIndex &index ) {
connect( mTableView, &QTableView::doubleClicked, this, [=]( const QModelIndex &index ) {
editDatumTransform( index );
} );
mEditButton->setEnabled( false );

View File

@ -42,7 +42,7 @@ QgsDevToolsPanelWidget::QgsDevToolsPanelWidget( const QList<QgsDevToolWidgetFact
for ( QgsDevToolWidgetFactory *factory : factories )
addToolFactory( factory );
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, [this]( int row ) {
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, [=]( int row ) {
setCurrentTool( row );
settingLastActiveTab->setValue( mOptionsListWidget->currentItem()->data( Qt::UserRole ).toString() );
} );

View File

@ -28,7 +28,7 @@ QgsDiscoverRelationsDialog::QgsDiscoverRelationsDialog( const QList<QgsRelation>
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
mButtonBox->addButton( QDialogButtonBox::Help );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#defining-1-n-relation" ) );
} );
connect( mRelationsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDiscoverRelationsDialog::onSelectionChanged );

View File

@ -771,7 +771,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
connect( mDeselectDataDefinedBlocks, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deselectDataDefinedBlocks );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDxfExportDialog::showHelp );
connect( mFileName, &QgsFileWidget::fileChanged, this, [this]( const QString &filePath ) {
connect( mFileName, &QgsFileWidget::fileChanged, this, [=]( const QString &filePath ) {
QgsSettings settings;
QFileInfo tmplFileInfo( filePath );
settings.setValue( QStringLiteral( "qgis/lastDxfDir" ), tmplFileInfo.absolutePath() );

View File

@ -65,10 +65,10 @@ void QgsFixAttributeDialog::init( QgsVectorLayer *layer, const QgsAttributeEdito
{
buttonBox->addButton( cancelAllBtn, QDialogButtonBox::ActionRole );
buttonBox->addButton( cancelAllInvalidBtn, QDialogButtonBox::ActionRole );
connect( cancelAllBtn, &QAbstractButton::clicked, this, [this]() {
connect( cancelAllBtn, &QAbstractButton::clicked, this, [=]() {
done( DiscardAll );
} );
connect( cancelAllInvalidBtn, &QAbstractButton::clicked, this, [this]() {
connect( cancelAllInvalidBtn, &QAbstractButton::clicked, this, [=]() {
done( PasteValid );
} );
buttonBox->button( QDialogButtonBox::Cancel )->setText( tr( "Skip" ) );
@ -78,7 +78,7 @@ void QgsFixAttributeDialog::init( QgsVectorLayer *layer, const QgsAttributeEdito
storeAllInvalidBtn->setText( tr( "Paste Anyway" ) );
}
buttonBox->addButton( storeAllInvalidBtn, QDialogButtonBox::ActionRole );
connect( storeAllInvalidBtn, &QAbstractButton::clicked, this, [this]() {
connect( storeAllInvalidBtn, &QAbstractButton::clicked, this, [=]() {
done( PasteAll );
} );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsFixAttributeDialog::reject );

View File

@ -1721,11 +1721,11 @@ void QgsIdentifyResultsDialog::contextMenuEvent( QContextMenuEvent *event )
mActionPopup->addAction( tr( "Clear Results" ), this, &QgsIdentifyResultsDialog::clear );
mActionPopup->addAction( tr( "Clear Highlights" ), this, &QgsIdentifyResultsDialog::clearHighlights );
mActionPopup->addAction( tr( "Highlight All" ), this, &QgsIdentifyResultsDialog::highlightAll );
mActionPopup->addAction( tr( "Highlight Layer" ), this, [this] { highlightLayer(); } );
mActionPopup->addAction( tr( "Highlight Layer" ), this, [=] { highlightLayer(); } );
if ( layer && QgsProject::instance()->layerIsEmbedded( layer->id() ).isEmpty() )
{
mActionPopup->addAction( tr( "Activate Layer" ), this, [this] { activateLayer(); } );
mActionPopup->addAction( tr( "Layer Properties…" ), this, [this] { layerProperties(); } );
mActionPopup->addAction( tr( "Activate Layer" ), this, [=] { activateLayer(); } );
mActionPopup->addAction( tr( "Layer Properties…" ), this, [=] { layerProperties(); } );
}
mActionPopup->addSeparator();
mActionPopup->addAction( tr( "Expand All" ), this, &QgsIdentifyResultsDialog::expandAll );

View File

@ -50,7 +50,7 @@ QgsLayerNotesDialog::QgsLayerNotesDialog( QWidget *parent )
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Save | QDialogButtonBox::Help | QDialogButtonBox::Cancel );
connect( buttonBox->button( QDialogButtonBox::Save ), &QPushButton::clicked, this, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [] {
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [=] {
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#layer-notes" ) );
} );
layout->addWidget( buttonBox );

View File

@ -101,8 +101,8 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::mapCrsChanged );
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::updateExtentRect );
connect( mActionZoomFullExtent, &QAction::triggered, mMapCanvas, &QgsMapCanvas::zoomToProjectExtent );
connect( mActionZoomToLayers, &QAction::triggered, mMapCanvas, [this] { QgisApp::instance()->layerTreeView()->defaultActions()->zoomToLayers( mMapCanvas ); } );
connect( mActionZoomToSelected, &QAction::triggered, mMapCanvas, [this] { mMapCanvas->zoomToSelected(); } );
connect( mActionZoomToLayers, &QAction::triggered, mMapCanvas, [=] { QgisApp::instance()->layerTreeView()->defaultActions()->zoomToLayers( mMapCanvas ); } );
connect( mActionZoomToSelected, &QAction::triggered, mMapCanvas, [=] { mMapCanvas->zoomToSelected(); } );
mapCrsChanged();
QgsMapSettingsAction *settingsAction = new QgsMapSettingsAction( settingsMenu );
@ -127,11 +127,11 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
connect( mActionRename, &QAction::triggered, this, &QgsMapCanvasDockWidget::renameTriggered );
mActionShowAnnotations->setChecked( mMapCanvas->annotationsVisible() );
connect( mActionShowAnnotations, &QAction::toggled, this, [this]( bool checked ) { mMapCanvas->setAnnotationsVisible( checked ); } );
connect( mActionShowAnnotations, &QAction::toggled, this, [=]( bool checked ) { mMapCanvas->setAnnotationsVisible( checked ); } );
mActionShowCursor->setChecked( true );
connect( mActionShowCursor, &QAction::toggled, this, [this]( bool checked ) { mXyMarker->setVisible( checked ); } );
connect( mActionShowCursor, &QAction::toggled, this, [=]( bool checked ) { mXyMarker->setVisible( checked ); } );
mActionShowExtent->setChecked( false );
connect( mActionShowExtent, &QAction::toggled, this, [this]( bool checked ) { mExtentRubberBand->setVisible( checked ); updateExtentRect(); } );
connect( mActionShowExtent, &QAction::toggled, this, [=]( bool checked ) { mExtentRubberBand->setVisible( checked ); updateExtentRect(); } );
mActionShowLabels->setChecked( true );
connect( mActionShowLabels, &QAction::toggled, this, &QgsMapCanvasDockWidget::showLabels );
@ -143,7 +143,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
mSyncScaleCheckBox = settingsAction->syncScaleCheckBox();
mScaleFactorWidget = settingsAction->scaleFactorSpinBox();
connect( mSyncSelectionCheck, &QCheckBox::toggled, this, [this]( bool checked ) {
connect( mSyncSelectionCheck, &QCheckBox::toggled, this, [=]( bool checked ) {
autoZoomToSelection( checked );
if ( checked )
{
@ -154,7 +154,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mSyncExtentCheck, &QCheckBox::toggled, this, [this]( bool checked ) {
connect( mSyncExtentCheck, &QCheckBox::toggled, this, [=]( bool checked ) {
if ( checked )
{
syncViewCenter( mMainCanvas );
@ -164,7 +164,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mScaleCombo, &QgsScaleComboBox::scaleChanged, this, [this]( double scale ) {
connect( mScaleCombo, &QgsScaleComboBox::scaleChanged, this, [=]( double scale ) {
if ( !mBlockScaleUpdate )
{
mBlockScaleUpdate = true;
@ -172,7 +172,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
mBlockScaleUpdate = false;
}
} );
connect( mMapCanvas, &QgsMapCanvas::scaleChanged, this, [this]( double scale ) {
connect( mMapCanvas, &QgsMapCanvas::scaleChanged, this, [=]( double scale ) {
if ( !mBlockScaleUpdate )
{
mBlockScaleUpdate = true;
@ -181,7 +181,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mRotationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double value ) {
connect( mRotationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double value ) {
if ( !mBlockRotationUpdate )
{
mBlockRotationUpdate = true;
@ -191,7 +191,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mMapCanvas, &QgsMapCanvas::rotationChanged, this, [this]( double rotation ) {
connect( mMapCanvas, &QgsMapCanvas::rotationChanged, this, [=]( double rotation ) {
if ( !mBlockRotationUpdate )
{
mBlockRotationUpdate = true;
@ -200,7 +200,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mMagnificationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double value ) {
connect( mMagnificationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double value ) {
if ( !mBlockMagnificationUpdate )
{
mBlockMagnificationUpdate = true;
@ -210,7 +210,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
}
} );
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, this, [this]( double factor ) {
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, this, [=]( double factor ) {
if ( !mBlockMagnificationUpdate )
{
mBlockMagnificationUpdate = true;
@ -220,13 +220,13 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
} );
connect( mScaleFactorWidget, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMapCanvasDockWidget::mapScaleChanged );
connect( mSyncScaleCheckBox, &QCheckBox::toggled, this, [this]( bool checked ) {
connect( mSyncScaleCheckBox, &QCheckBox::toggled, this, [=]( bool checked ) {
if ( checked )
mapScaleChanged();
} );
mResizeTimer.setSingleShot( true );
connect( &mResizeTimer, &QTimer::timeout, this, [this] {
connect( &mResizeTimer, &QTimer::timeout, this, [=] {
mBlockExtentSync = false;
if ( mSyncScaleCheckBox->isChecked() )
@ -247,7 +247,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
toggleButton->setToolTip( tr( "Dock 2D Map View" ) );
mToolbar->addWidget( toggleButton );
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
close();
} );
}
@ -454,7 +454,7 @@ void QgsMapCanvasDockWidget::menuAboutToShow()
{
actionFollowMain->setChecked( true );
}
connect( actionFollowMain, &QAction::triggered, this, [this] {
connect( actionFollowMain, &QAction::triggered, this, [=] {
mMapCanvas->setTheme( QString() );
mMapCanvas->refresh();
} );

View File

@ -88,9 +88,9 @@ QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, co
}
mDrawDecorations->setText( tr( "Draw active decorations: %1" ).arg( !activeDecorations.isEmpty() ? activeDecorations : tr( "none" ) ) );
connect( mResolutionSpinBox, &QSpinBox::editingFinished, this, [this] { updateDpi( mResolutionSpinBox->value() ); } );
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
connect( mResolutionSpinBox, &QSpinBox::editingFinished, this, [=] { updateDpi( mResolutionSpinBox->value() ); } );
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsMapSaveDialog::updateExtent );
connect( mScaleWidget, &QgsScaleWidget::scaleChanged, this, &QgsMapSaveDialog::updateScale );
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsMapSaveDialog::lockChanged );
@ -424,7 +424,7 @@ void QgsMapSaveDialog::copyToClipboard()
mapRendererTask->addDecorations( mDecorations );
}
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, this, [this, img, p] {
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, this, [=] {
QApplication::clipboard()->setImage( *img, QClipboard::Clipboard );
QApplication::restoreOverrideCursor();
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as image" ), tr( "Successfully copied map to clipboard" ) );
@ -433,7 +433,7 @@ void QgsMapSaveDialog::copyToClipboard()
delete img;
setEnabled( true );
} );
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, this, [this, p, img]( int ) {
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, this, [=]( int ) {
QApplication::restoreOverrideCursor();
QgisApp::instance()->messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not copy the map to clipboard" ) );
@ -481,10 +481,10 @@ void QgsMapSaveDialog::onAccepted()
mapRendererTask->setSaveWorldFile( saveWorldFile() );
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [fileNameAndFilter] {
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [=] {
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as image" ), tr( "Successfully saved map to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fileNameAndFilter.first ).toString(), QDir::toNativeSeparators( fileNameAndFilter.first ) ) );
} );
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, []( int error ) {
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, [=]( int error ) {
switch ( error )
{
case QgsMapRendererTask::ImageAllocationFail:
@ -573,10 +573,10 @@ void QgsMapSaveDialog::onAccepted()
mapRendererTask->setExportMetadata( exportMetadata() );
}
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [fileName] {
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [=] {
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as PDF" ), tr( "Successfully saved map to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( fileName ).toString(), QDir::toNativeSeparators( fileName ) ) );
} );
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, []( int ) {
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, [=]( int ) {
QgisApp::instance()->messageBar()->pushWarning( tr( "Save as PDF" ), tr( "Could not save the map to PDF" ) );
} );

View File

@ -50,7 +50,7 @@ QgsMapThemes::QgsMapThemes()
mReplaceMenu = new QMenu( tr( "Replace Theme" ) );
mMenu->addMenu( mReplaceMenu );
mActionRenameCurrentPreset = mMenu->addAction( tr( "Rename Current Theme…" ), this, &QgsMapThemes::renameCurrentPreset );
mActionAddPreset = mMenu->addAction( tr( "Add Theme…" ), this, [this] { addPreset(); } );
mActionAddPreset = mMenu->addAction( tr( "Add Theme…" ), this, [=] { addPreset(); } );
mMenuSeparator = mMenu->addSeparator();
mActionRemoveCurrentPreset = mMenu->addAction( tr( "Remove Current Theme" ), this, &QgsMapThemes::removeCurrentPreset );

View File

@ -149,10 +149,10 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
featureTitle = FID_TO_STRING( feature.id() );
QAction *featureAction = featureMenu->addAction( featureTitle );
connect( featureAction, &QAction::triggered, this, [this, layer, feature, point] { doActionForFeature( layer, feature, point ); } );
connect( featureAction, &QAction::triggered, this, [=] { doActionForFeature( layer, feature, point ); } );
}
QAction *allFeatureAction = featureMenu->addAction( tr( "All Features" ) );
connect( allFeatureAction, &QAction::triggered, this, [this, features, layer, point] {
connect( allFeatureAction, &QAction::triggered, this, [=] {
for ( const QgsFeature &feature : std::as_const( features ) )
{
doActionForFeature( layer, feature, point );

View File

@ -606,7 +606,7 @@ void QgsMapToolOffsetCurve::createUserInputWidget()
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffsetFromWidget );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingCanceled, this, &QgsMapToolOffsetCurve::cancel );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetConfigChanged, this, [this] { updateGeometryAndRubberBand( mUserInputWidget->offset() ); } );
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetConfigChanged, this, [=] { updateGeometryAndRubberBand( mUserInputWidget->offset() ); } );
}
void QgsMapToolOffsetCurve::deleteUserInputWidget()
@ -710,16 +710,16 @@ QgsOffsetUserWidget::QgsOffsetUserWidget( QWidget *parent )
mOffsetSpinBox->installEventFilter( this );
connect( mOffsetSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsOffsetUserWidget::offsetChanged );
connect( mJoinStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this] { QgsSettingsRegistryCore::settingsDigitizingOffsetJoinStyle->setValue( static_cast< Qgis::JoinStyle >( mJoinStyleComboBox->currentData().toInt() ) ); emit offsetConfigChanged(); } );
connect( mQuadrantSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [this]( const int quadSegments ) { QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg->setValue( quadSegments ); emit offsetConfigChanged(); } );
connect( mMiterLimitSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this]( double miterLimit ) { QgsSettingsRegistryCore::settingsDigitizingOffsetMiterLimit->setValue( miterLimit ); emit offsetConfigChanged(); } );
connect( mCapStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this] { QgsSettingsRegistryCore::settingsDigitizingOffsetCapStyle->setValue( static_cast< Qgis::EndCapStyle >( mCapStyleComboBox->currentData().toInt() ) ); emit offsetConfigChanged(); } );
connect( mJoinStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=] { QgsSettingsRegistryCore::settingsDigitizingOffsetJoinStyle->setValue( static_cast< Qgis::JoinStyle >( mJoinStyleComboBox->currentData().toInt() ) ); emit offsetConfigChanged(); } );
connect( mQuadrantSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [=]( const int quadSegments ) { QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg->setValue( quadSegments ); emit offsetConfigChanged(); } );
connect( mMiterLimitSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=]( double miterLimit ) { QgsSettingsRegistryCore::settingsDigitizingOffsetMiterLimit->setValue( miterLimit ); emit offsetConfigChanged(); } );
connect( mCapStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=] { QgsSettingsRegistryCore::settingsDigitizingOffsetCapStyle->setValue( static_cast< Qgis::EndCapStyle >( mCapStyleComboBox->currentData().toInt() ) ); emit offsetConfigChanged(); } );
const bool showAdvanced = QgsSettingsRegistryCore::settingsDigitizingOffsetShowAdvanced->value();
mShowAdvancedButton->setChecked( showAdvanced );
mAdvancedConfigWidget->setVisible( showAdvanced );
connect( mShowAdvancedButton, &QToolButton::clicked, mAdvancedConfigWidget, &QWidget::setVisible );
connect( mShowAdvancedButton, &QToolButton::clicked, this, []( const bool clicked ) { QgsSettingsRegistryCore::settingsDigitizingConvertToCurveDistanceTolerance->setValue( clicked ); } );
connect( mShowAdvancedButton, &QToolButton::clicked, this, [=]( const bool clicked ) { QgsSettingsRegistryCore::settingsDigitizingConvertToCurveDistanceTolerance->setValue( clicked ); } );
// config focus
setFocusProxy( mOffsetSpinBox );

View File

@ -207,7 +207,7 @@ void QgsMapToolSelectionHandler::selectFeaturesMoveEvent( QgsMapMouseEvent *e )
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( e->pos() ) ), e->modifiers() );
mOnMouseMoveDelayTimer = std::make_unique<QTimer>();
mOnMouseMoveDelayTimer->setSingleShot( true );
connect( mOnMouseMoveDelayTimer.get(), &QTimer::timeout, this, [this, e] {
connect( mOnMouseMoveDelayTimer.get(), &QTimer::timeout, this, [=] {
if ( !mMoveLastCursorPos.isNull() )
{
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( mMoveLastCursorPos ) ), e->modifiers() );

View File

@ -57,16 +57,16 @@ QgsSimplifyUserInputWidget::QgsSimplifyUserInputWidget( QWidget *parent )
// communication with map tool
connect( mToleranceSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::toleranceChanged );
connect( mToleranceUnitsComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( int ) { emit toleranceUnitsChanged( mToleranceUnitsComboBox->currentData().value<Qgis::MapToolUnit>() ); } );
connect( mMethodComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( const int method ) { emit methodChanged( ( QgsMapToolSimplify::Method ) method ); } );
connect( mMethodComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this] {
connect( mToleranceUnitsComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int ) { emit toleranceUnitsChanged( mToleranceUnitsComboBox->currentData().value<Qgis::MapToolUnit>() ); } );
connect( mMethodComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( const int method ) { emit methodChanged( ( QgsMapToolSimplify::Method ) method ); } );
connect( mMethodComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=] {
if ( mMethodComboBox->currentData().toInt() != QgsMapToolSimplify::Smooth )
mOptionsStackedWidget->setCurrentIndex( 0 );
else
mOptionsStackedWidget->setCurrentIndex( 1 );
} );
connect( mOffsetSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [this]( const int offset ) { emit smoothOffsetChanged( offset / 100.0 ); } );
connect( mOffsetSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [=]( const int offset ) { emit smoothOffsetChanged( offset / 100.0 ); } );
connect( mIterationsSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::smoothIterationsChanged );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsSimplifyUserInputWidget::accepted );

View File

@ -455,7 +455,7 @@ QComboBox *QgsMergeAttributesDialog::createMergeComboBox( QMetaType::Type column
newComboBox->addItem( tr( "Manual Value" ), QStringLiteral( "manual" ) );
newComboBox->addItem( tr( "Set to NULL" ), QStringLiteral( "null" ) );
connect( newComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this, newComboBox, column]() {
connect( newComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]() {
bool isManual = newComboBox->currentData() == QLatin1String( "manual" );
updateManualWidget( column, isManual );
refreshMergedValue( column );

Some files were not shown because too many files have changed in this diff Show More