mirror of
https://github.com/qgis/QGIS.git
synced 2025-07-03 00:03:10 -04:00
Compare commits
14 Commits
18e38abd84
...
a3a97a6648
Author | SHA1 | Date | |
---|---|---|---|
|
a3a97a6648 | ||
|
74549aad26 | ||
|
eac401c009 | ||
|
1f0166d35e | ||
|
ada589bb1d | ||
|
08dd318614 | ||
|
ac9051e2b6 | ||
|
a940543035 | ||
|
89dbd40b8f | ||
|
b1c8ef3265 | ||
|
f4cf09d4b0 | ||
|
9db58e3726 | ||
|
551aa20f20 | ||
|
a156c43f7b |
@ -979,7 +979,31 @@ if (WITH_CORE)
|
|||||||
else()
|
else()
|
||||||
# UNIX
|
# UNIX
|
||||||
set (DEFAULT_BIN_SUBDIR bin)
|
set (DEFAULT_BIN_SUBDIR bin)
|
||||||
set (DEFAULT_CGIBIN_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_LIB_SUBDIR lib${LIB_SUFFIX})
|
set (DEFAULT_LIB_SUBDIR lib${LIB_SUFFIX})
|
||||||
set (DEFAULT_DATA_SUBDIR share/qgis)
|
set (DEFAULT_DATA_SUBDIR share/qgis)
|
||||||
set (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
|
set (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
|
||||||
|
@ -62,7 +62,7 @@ Returns intensity of the light
|
|||||||
Sets intensity of the light
|
Sets intensity of the light
|
||||||
%End
|
%End
|
||||||
|
|
||||||
bool operator==( const QgsDirectionalLightSettings &other );
|
bool operator==( const QgsDirectionalLightSettings &other ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ Returns quadratic attenuation (A_2)
|
|||||||
Sets quadratic attenuation (A_2)
|
Sets quadratic attenuation (A_2)
|
||||||
%End
|
%End
|
||||||
|
|
||||||
bool operator==( const QgsPointLightSettings &other );
|
bool operator==( const QgsPointLightSettings &other ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Returns intensity of the light
|
|||||||
Sets intensity of the light
|
Sets intensity of the light
|
||||||
%End
|
%End
|
||||||
|
|
||||||
bool operator==( const QgsDirectionalLightSettings &other );
|
bool operator==( const QgsDirectionalLightSettings &other ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ Returns quadratic attenuation (A_2)
|
|||||||
Sets quadratic attenuation (A_2)
|
Sets quadratic attenuation (A_2)
|
||||||
%End
|
%End
|
||||||
|
|
||||||
bool operator==( const QgsPointLightSettings &other );
|
bool operator==( const QgsPointLightSettings &other ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -659,6 +659,9 @@ class Repositories(QObject):
|
|||||||
.strip()
|
.strip()
|
||||||
)
|
)
|
||||||
if not qgisMaximumVersion:
|
if not qgisMaximumVersion:
|
||||||
|
if qgisMinimumVersion[0] == "3" and supports_qt6:
|
||||||
|
qgisMaximumVersion = "4.99"
|
||||||
|
else:
|
||||||
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
|
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
|
||||||
# if compatible, add the plugin to the list
|
# if compatible, add the plugin to the list
|
||||||
if not pluginNodes.item(i).firstChildElement(
|
if not pluginNodes.item(i).firstChildElement(
|
||||||
@ -845,6 +848,9 @@ class Plugins(QObject):
|
|||||||
qgisMinimumVersion = "0"
|
qgisMinimumVersion = "0"
|
||||||
qgisMaximumVersion = pluginMetadata("qgisMaximumVersion").strip()
|
qgisMaximumVersion = pluginMetadata("qgisMaximumVersion").strip()
|
||||||
if not qgisMaximumVersion:
|
if not qgisMaximumVersion:
|
||||||
|
if qgisMinimumVersion[0] == "3" and supports_qt6:
|
||||||
|
qgisMaximumVersion = "4.99"
|
||||||
|
else:
|
||||||
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
|
qgisMaximumVersion = qgisMinimumVersion[0] + ".99"
|
||||||
# if compatible, add the plugin to the list
|
# if compatible, add the plugin to the list
|
||||||
if not isCompatible(
|
if not isCompatible(
|
||||||
|
@ -64,7 +64,7 @@ void QgsDirectionalLightSettings::readXml( const QDomElement &elem, const QgsRea
|
|||||||
mIntensity = elem.attribute( QStringLiteral( "intensity" ) ).toFloat();
|
mIntensity = elem.attribute( QStringLiteral( "intensity" ) ).toFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsDirectionalLightSettings::operator==( const QgsDirectionalLightSettings &other )
|
bool QgsDirectionalLightSettings::operator==( const QgsDirectionalLightSettings &other ) const
|
||||||
{
|
{
|
||||||
return mDirection == other.mDirection && mColor == other.mColor && mIntensity == other.mIntensity;
|
return mDirection == other.mDirection && mColor == other.mColor && mIntensity == other.mIntensity;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class _3D_EXPORT QgsDirectionalLightSettings : public QgsLightSource
|
|||||||
void setIntensity( float intensity ) { mIntensity = intensity; }
|
void setIntensity( float intensity ) { mIntensity = intensity; }
|
||||||
|
|
||||||
// TODO c++20 - replace with = default
|
// TODO c++20 - replace with = default
|
||||||
bool operator==( const QgsDirectionalLightSettings &other );
|
bool operator==( const QgsDirectionalLightSettings &other ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsVector3D mDirection { -0.32, 0.27, -0.91 };
|
QgsVector3D mDirection { -0.32, 0.27, -0.91 };
|
||||||
|
@ -107,7 +107,7 @@ void QgsPointLightSettings::readXml( const QDomElement &elem, const QgsReadWrite
|
|||||||
mQuadraticAttenuation = elem.attribute( QStringLiteral( "attenuation-2" ) ).toDouble();
|
mQuadraticAttenuation = elem.attribute( QStringLiteral( "attenuation-2" ) ).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPointLightSettings::operator==( const QgsPointLightSettings &other )
|
bool QgsPointLightSettings::operator==( const QgsPointLightSettings &other ) const
|
||||||
{
|
{
|
||||||
return mPosition == other.mPosition && mColor == other.mColor && mIntensity == other.mIntensity && mConstantAttenuation == other.mConstantAttenuation && mLinearAttenuation == other.mLinearAttenuation && mQuadraticAttenuation == other.mQuadraticAttenuation;
|
return mPosition == other.mPosition && mColor == other.mColor && mIntensity == other.mIntensity && mConstantAttenuation == other.mConstantAttenuation && mLinearAttenuation == other.mLinearAttenuation && mQuadraticAttenuation == other.mQuadraticAttenuation;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ class _3D_EXPORT QgsPointLightSettings : public QgsLightSource
|
|||||||
void setQuadraticAttenuation( float value ) { mQuadraticAttenuation = value; }
|
void setQuadraticAttenuation( float value ) { mQuadraticAttenuation = value; }
|
||||||
|
|
||||||
// TODO c++20 - replace with = default
|
// TODO c++20 - replace with = default
|
||||||
bool operator==( const QgsPointLightSettings &other );
|
bool operator==( const QgsPointLightSettings &other ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsVector3D mPosition { 0, 0, 1000 };
|
QgsVector3D mPosition { 0, 0, 1000 };
|
||||||
|
@ -66,7 +66,7 @@ Qgs3DMapCanvas::Qgs3DMapCanvas()
|
|||||||
const QgsSettings setting;
|
const QgsSettings setting;
|
||||||
mEngine = new QgsWindow3DEngine( this );
|
mEngine = new QgsWindow3DEngine( this );
|
||||||
|
|
||||||
connect( mEngine, &QgsAbstract3DEngine::imageCaptured, this, [=]( const QImage &image ) {
|
connect( mEngine, &QgsAbstract3DEngine::imageCaptured, this, [this]( const QImage &image ) {
|
||||||
if ( image.save( mCaptureFileName, mCaptureFileFormat.toLocal8Bit().data() ) )
|
if ( image.save( mCaptureFileName, mCaptureFileFormat.toLocal8Bit().data() ) )
|
||||||
{
|
{
|
||||||
emit savedAsImage( mCaptureFileName );
|
emit savedAsImage( mCaptureFileName );
|
||||||
@ -169,7 +169,7 @@ void Qgs3DMapCanvas::setMapSettings( Qgs3DMapSettings *mapSettings )
|
|||||||
|
|
||||||
resetView();
|
resetView();
|
||||||
|
|
||||||
connect( cameraController(), &QgsCameraController::setCursorPosition, this, [=]( QPoint point ) {
|
connect( cameraController(), &QgsCameraController::setCursorPosition, this, [this]( QPoint point ) {
|
||||||
QCursor::setPos( mapToGlobal( point ) );
|
QCursor::setPos( mapToGlobal( point ) );
|
||||||
} );
|
} );
|
||||||
connect( cameraController(), &QgsCameraController::cameraMovementSpeedChanged, mMapSettings, &Qgs3DMapSettings::setCameraMovementSpeed );
|
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;
|
Qt3DLogic::QFrameAction *screenCaptureFrameAction = new Qt3DLogic::QFrameAction;
|
||||||
mScene->addComponent( screenCaptureFrameAction );
|
mScene->addComponent( screenCaptureFrameAction );
|
||||||
// Wait to have the render capture enabled in the next frame
|
// Wait to have the render capture enabled in the next frame
|
||||||
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [=]( float ) {
|
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [this, screenCaptureFrameAction]( float ) {
|
||||||
mEngine->requestCaptureImage();
|
mEngine->requestCaptureImage();
|
||||||
mScene->removeComponent( screenCaptureFrameAction );
|
mScene->removeComponent( screenCaptureFrameAction );
|
||||||
screenCaptureFrameAction->deleteLater();
|
screenCaptureFrameAction->deleteLater();
|
||||||
@ -232,7 +232,7 @@ void Qgs3DMapCanvas::captureDepthBuffer()
|
|||||||
Qt3DLogic::QFrameAction *screenCaptureFrameAction = new Qt3DLogic::QFrameAction;
|
Qt3DLogic::QFrameAction *screenCaptureFrameAction = new Qt3DLogic::QFrameAction;
|
||||||
mScene->addComponent( screenCaptureFrameAction );
|
mScene->addComponent( screenCaptureFrameAction );
|
||||||
// Wait to have the render capture enabled in the next frame
|
// Wait to have the render capture enabled in the next frame
|
||||||
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [=]( float ) {
|
connect( screenCaptureFrameAction, &Qt3DLogic::QFrameAction::triggered, this, [this, screenCaptureFrameAction]( float ) {
|
||||||
mEngine->requestDepthBufferCapture();
|
mEngine->requestDepthBufferCapture();
|
||||||
mScene->removeComponent( screenCaptureFrameAction );
|
mScene->removeComponent( screenCaptureFrameAction );
|
||||||
screenCaptureFrameAction->deleteLater();
|
screenCaptureFrameAction->deleteLater();
|
||||||
|
@ -159,7 +159,7 @@ Qgs3DMapScene::Qgs3DMapScene( Qgs3DMapSettings &map, QgsAbstract3DEngine *engine
|
|||||||
|
|
||||||
connect( &map, &Qgs3DMapSettings::originChanged, this, &Qgs3DMapScene::onOriginChanged );
|
connect( &map, &Qgs3DMapSettings::originChanged, this, &Qgs3DMapScene::onOriginChanged );
|
||||||
|
|
||||||
connect( QgsApplication::sourceCache(), &QgsSourceCache::remoteSourceFetched, this, [=]( const QString &url ) {
|
connect( QgsApplication::sourceCache(), &QgsSourceCache::remoteSourceFetched, this, [this]( const QString &url ) {
|
||||||
const QList<QgsMapLayer *> modelVectorLayers = mModelVectorLayers;
|
const QList<QgsMapLayer *> modelVectorLayers = mModelVectorLayers;
|
||||||
for ( QgsMapLayer *layer : modelVectorLayers )
|
for ( QgsMapLayer *layer : modelVectorLayers )
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ void QgsAbstract3DEngine::requestCaptureImage()
|
|||||||
mFrameGraph->setRenderCaptureEnabled( true );
|
mFrameGraph->setRenderCaptureEnabled( true );
|
||||||
captureReply = mFrameGraph->renderCapture()->requestCapture();
|
captureReply = mFrameGraph->renderCapture()->requestCapture();
|
||||||
|
|
||||||
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [=] {
|
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [this, captureReply] {
|
||||||
emit imageCaptured( captureReply->image() );
|
emit imageCaptured( captureReply->image() );
|
||||||
captureReply->deleteLater();
|
captureReply->deleteLater();
|
||||||
mFrameGraph->setRenderCaptureEnabled( false );
|
mFrameGraph->setRenderCaptureEnabled( false );
|
||||||
@ -45,7 +45,7 @@ void QgsAbstract3DEngine::requestDepthBufferCapture()
|
|||||||
Qt3DRender::QRenderCaptureReply *captureReply;
|
Qt3DRender::QRenderCaptureReply *captureReply;
|
||||||
captureReply = mFrameGraph->depthRenderCapture()->requestCapture();
|
captureReply = mFrameGraph->depthRenderCapture()->requestCapture();
|
||||||
|
|
||||||
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [=] {
|
connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [this, captureReply] {
|
||||||
emit depthBufferCaptured( captureReply->image() );
|
emit depthBufferCaptured( captureReply->image() );
|
||||||
captureReply->deleteLater();
|
captureReply->deleteLater();
|
||||||
} );
|
} );
|
||||||
|
@ -522,8 +522,8 @@ void QgsCameraController::onPositionChangedTerrainNavigation( Qt3DInput::QMouseE
|
|||||||
const int dx = mouse->x() - mMousePos.x();
|
const int dx = mouse->x() - mMousePos.x();
|
||||||
const int dy = mouse->y() - mMousePos.y();
|
const int dy = mouse->y() - mMousePos.y();
|
||||||
|
|
||||||
const bool hasShift = ( mouse->modifiers() & Qt::ShiftModifier );
|
const bool hasShift = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ShiftModifier );
|
||||||
const bool hasCtrl = ( mouse->modifiers() & Qt::ControlModifier );
|
const bool hasCtrl = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier );
|
||||||
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
|
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
|
||||||
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
|
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
|
||||||
const bool hasRightButton = ( mouse->buttons() & Qt::RightButton );
|
const bool hasRightButton = ( mouse->buttons() & Qt::RightButton );
|
||||||
@ -676,8 +676,8 @@ void QgsCameraController::onPositionChangedTerrainNavigation( Qt3DInput::QMouseE
|
|||||||
|
|
||||||
void QgsCameraController::onPositionChangedGlobeTerrainNavigation( Qt3DInput::QMouseEvent *mouse )
|
void QgsCameraController::onPositionChangedGlobeTerrainNavigation( Qt3DInput::QMouseEvent *mouse )
|
||||||
{
|
{
|
||||||
const bool hasShift = ( mouse->modifiers() & Qt::ShiftModifier );
|
const bool hasShift = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ShiftModifier );
|
||||||
const bool hasCtrl = ( mouse->modifiers() & Qt::ControlModifier );
|
const bool hasCtrl = ( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier );
|
||||||
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
|
const bool hasLeftButton = ( mouse->buttons() & Qt::LeftButton );
|
||||||
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
|
const bool hasMiddleButton = ( mouse->buttons() & Qt::MiddleButton );
|
||||||
|
|
||||||
@ -815,7 +815,7 @@ void QgsCameraController::onWheel( Qt3DInput::QWheelEvent *wheel )
|
|||||||
{
|
{
|
||||||
case Qgis::NavigationMode::Walk:
|
case Qgis::NavigationMode::Walk:
|
||||||
{
|
{
|
||||||
const float scaling = ( ( wheel->modifiers() & Qt::ControlModifier ) != 0 ? 0.1f : 1.0f ) / 1000.f;
|
const float scaling = ( ( wheel->modifiers() & Qt3DInput::QWheelEvent::Modifiers::ControlModifier ) != 0 ? 0.1f : 1.0f ) / 1000.f;
|
||||||
setCameraMovementSpeed( mCameraMovementSpeed + mCameraMovementSpeed * scaling * wheel->angleDelta().y() );
|
setCameraMovementSpeed( mCameraMovementSpeed + mCameraMovementSpeed * scaling * wheel->angleDelta().y() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -824,7 +824,7 @@ void QgsCameraController::onWheel( Qt3DInput::QWheelEvent *wheel )
|
|||||||
{
|
{
|
||||||
// Scale our variable to roughly "number of normal steps", with Ctrl
|
// Scale our variable to roughly "number of normal steps", with Ctrl
|
||||||
// increasing granularity 10x
|
// increasing granularity 10x
|
||||||
const double scaling = ( 1.0 / 120.0 ) * ( ( wheel->modifiers() & Qt::ControlModifier ) != 0 ? 0.1 : 1.0 );
|
const double scaling = ( 1.0 / 120.0 ) * ( ( wheel->modifiers() & Qt3DInput::QWheelEvent::Modifiers::ControlModifier ) != 0 ? 0.1 : 1.0 );
|
||||||
|
|
||||||
// Apparently angleDelta needs to be accumulated
|
// Apparently angleDelta needs to be accumulated
|
||||||
// see: https://doc.qt.io/qt-5/qwheelevent.html#angleDelta
|
// see: https://doc.qt.io/qt-5/qwheelevent.html#angleDelta
|
||||||
@ -861,7 +861,7 @@ void QgsCameraController::onMousePressed( Qt3DInput::QMouseEvent *mouse )
|
|||||||
|
|
||||||
mKeyboardHandler->setFocus( true );
|
mKeyboardHandler->setFocus( true );
|
||||||
|
|
||||||
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 ) )
|
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 ) )
|
||||||
{
|
{
|
||||||
mMousePos = QPoint( mouse->x(), mouse->y() );
|
mMousePos = QPoint( mouse->x(), mouse->y() );
|
||||||
|
|
||||||
@ -869,7 +869,7 @@ void QgsCameraController::onMousePressed( Qt3DInput::QMouseEvent *mouse )
|
|||||||
mIgnoreNextMouseMove = true;
|
mIgnoreNextMouseMove = true;
|
||||||
|
|
||||||
const MouseOperation operation {
|
const MouseOperation operation {
|
||||||
( mouse->modifiers() & Qt::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ? MouseOperation::RotationCamera : MouseOperation::RotationCenter
|
( mouse->modifiers() & Qt3DInput::QMouseEvent::Modifiers::ControlModifier ) != 0 && mouse->button() == Qt3DInput::QMouseEvent::LeftButton ? MouseOperation::RotationCamera : MouseOperation::RotationCenter
|
||||||
};
|
};
|
||||||
setMouseParameters( operation, mMousePos );
|
setMouseParameters( operation, mMousePos );
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ class QgsGlobeChunkLoader : public QgsChunkLoader
|
|||||||
, mTextureGenerator( textureGenerator )
|
, mTextureGenerator( textureGenerator )
|
||||||
, mGlobeCrsToLatLon( globeCrsToLatLon )
|
, mGlobeCrsToLatLon( globeCrsToLatLon )
|
||||||
{
|
{
|
||||||
connect( mTextureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [=]( int job, const QImage &img ) {
|
connect( mTextureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [this]( int job, const QImage &img ) {
|
||||||
if ( job == mJobId )
|
if ( job == mJobId )
|
||||||
{
|
{
|
||||||
mTexture = img;
|
mTexture = img;
|
||||||
@ -436,7 +436,7 @@ class QgsGlobeMapUpdateJob : public QgsChunkQueueJob
|
|||||||
QgsTerrainTextureImage *terrainTexImage = qobject_cast<QgsTerrainTextureImage *>( texImages[0] );
|
QgsTerrainTextureImage *terrainTexImage = qobject_cast<QgsTerrainTextureImage *>( texImages[0] );
|
||||||
Q_ASSERT( terrainTexImage );
|
Q_ASSERT( terrainTexImage );
|
||||||
|
|
||||||
connect( textureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [=]( int jobId, const QImage &image ) {
|
connect( textureGenerator, &QgsTerrainTextureGenerator::tileReady, this, [this, terrainTexImage]( int jobId, const QImage &image ) {
|
||||||
if ( mJobId == jobId )
|
if ( mJobId == jobId )
|
||||||
{
|
{
|
||||||
terrainTexImage->setImage( image );
|
terrainTexImage->setImage( image );
|
||||||
@ -487,7 +487,7 @@ class QgsGlobeMapUpdateJobFactory : public QgsChunkQueueJobFactory
|
|||||||
QgsGlobeEntity::QgsGlobeEntity( Qgs3DMapSettings *mapSettings )
|
QgsGlobeEntity::QgsGlobeEntity( Qgs3DMapSettings *mapSettings )
|
||||||
: QgsChunkedEntity( mapSettings, mapSettings->terrainSettings()->maximumScreenError(), new QgsGlobeChunkLoaderFactory( mapSettings ), true )
|
: QgsChunkedEntity( mapSettings, mapSettings->terrainSettings()->maximumScreenError(), new QgsGlobeChunkLoaderFactory( mapSettings ), true )
|
||||||
{
|
{
|
||||||
connect( mapSettings, &Qgs3DMapSettings::showTerrainBoundingBoxesChanged, this, [=] {
|
connect( mapSettings, &Qgs3DMapSettings::showTerrainBoundingBoxesChanged, this, [this, mapSettings] {
|
||||||
setShowBoundingBoxes( mapSettings->showTerrainBoundingBoxes() );
|
setShowBoundingBoxes( mapSettings->showTerrainBoundingBoxes() );
|
||||||
} );
|
} );
|
||||||
connect( mapSettings, &Qgs3DMapSettings::showTerrainTilesInfoChanged, this, &QgsGlobeEntity::invalidateMapImages );
|
connect( mapSettings, &Qgs3DMapSettings::showTerrainTilesInfoChanged, this, &QgsGlobeEntity::invalidateMapImages );
|
||||||
|
@ -135,7 +135,7 @@ bool QgsVectorWarperTask::run()
|
|||||||
|
|
||||||
QgsVectorWarper warper( mMethod, mPoints, mDestinationCrs );
|
QgsVectorWarper warper( mMethod, mPoints, mDestinationCrs );
|
||||||
|
|
||||||
connect( mFeedback.get(), &QgsFeedback::processedCountChanged, this, [=]( long long count ) {
|
connect( mFeedback.get(), &QgsFeedback::processedCountChanged, this, [this]( long long count ) {
|
||||||
const double newProgress = 100.0 * count / mFeatureCount;
|
const double newProgress = 100.0 * count / mFeatureCount;
|
||||||
// avoid flooding with too many events
|
// avoid flooding with too many events
|
||||||
if ( static_cast<int>( newProgress * 10 ) != static_cast<int>( mLastProgress * 10 ) )
|
if ( static_cast<int>( newProgress * 10 ) != static_cast<int>( mLastProgress * 10 ) )
|
||||||
|
@ -73,10 +73,10 @@ QVariantMap QgsPdalInformationAlgorithm::processAlgorithm( const QVariantMap &pa
|
|||||||
QStringList commandOutput;
|
QStringList commandOutput;
|
||||||
|
|
||||||
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
|
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
|
||||||
wrenchProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
wrenchProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba.trimmed() );
|
feedback->reportError( ba.trimmed() );
|
||||||
} );
|
} );
|
||||||
wrenchProcess.setStdOutHandler( [=, &commandOutput]( const QByteArray &ba ) {
|
wrenchProcess.setStdOutHandler( [feedback, &commandOutput]( const QByteArray &ba ) {
|
||||||
feedback->pushConsoleInfo( ba.trimmed() );
|
feedback->pushConsoleInfo( ba.trimmed() );
|
||||||
commandOutput << ba;
|
commandOutput << ba;
|
||||||
} );
|
} );
|
||||||
|
@ -189,10 +189,10 @@ QVariantMap QgsPdalAlgorithmBase::processAlgorithm( const QVariantMap ¶meter
|
|||||||
QString buffer;
|
QString buffer;
|
||||||
|
|
||||||
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
|
QgsBlockingProcess wrenchProcess( wrenchPath, processArgs );
|
||||||
wrenchProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
wrenchProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba.trimmed() );
|
feedback->reportError( ba.trimmed() );
|
||||||
} );
|
} );
|
||||||
wrenchProcess.setStdOutHandler( [=, &progress, &buffer]( const QByteArray &ba ) {
|
wrenchProcess.setStdOutHandler( [feedback, &progress, &buffer]( const QByteArray &ba ) {
|
||||||
QString data( ba );
|
QString data( ba );
|
||||||
|
|
||||||
QRegularExpression re( "\\.*(\\d+)?\\.*$" );
|
QRegularExpression re( "\\.*(\\d+)?\\.*$" );
|
||||||
|
@ -137,7 +137,7 @@ QgsFeatureList QgsDrapeAlgorithmBase::processFeature( const QgsFeature &feature,
|
|||||||
// a pointless iteration over all vertices
|
// a pointless iteration over all vertices
|
||||||
if ( !mRasterExtent.isNull() && geometry.boundingBoxIntersects( mRasterExtent ) )
|
if ( !mRasterExtent.isNull() && geometry.boundingBoxIntersects( mRasterExtent ) )
|
||||||
{
|
{
|
||||||
geometry.transformVertices( [=]( const QgsPoint &p ) -> QgsPoint {
|
geometry.transformVertices( [this, nodata, scale, offset, feedback, &f]( const QgsPoint &p ) -> QgsPoint {
|
||||||
QgsPointXY t;
|
QgsPointXY t;
|
||||||
double val = nodata;
|
double val = nodata;
|
||||||
try
|
try
|
||||||
|
@ -111,10 +111,10 @@ QVariantMap QgsConvertGpxFeatureTypeAlgorithm::processAlgorithm( const QVariantM
|
|||||||
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + babelPath + ' ' + logArgs.join( ' ' ) );
|
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + babelPath + ' ' + logArgs.join( ' ' ) );
|
||||||
|
|
||||||
QgsBlockingProcess babelProcess( babelPath, processArgs );
|
QgsBlockingProcess babelProcess( babelPath, processArgs );
|
||||||
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba );
|
feedback->reportError( ba );
|
||||||
} );
|
} );
|
||||||
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->pushDebugInfo( ba );
|
feedback->pushDebugInfo( ba );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -355,10 +355,10 @@ QVariantMap QgsConvertGpsDataAlgorithm::processAlgorithm( const QVariantMap &par
|
|||||||
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + logCommand.join( ' ' ) );
|
feedback->pushCommandInfo( QObject::tr( "Conversion command: " ) + logCommand.join( ' ' ) );
|
||||||
|
|
||||||
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
||||||
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba );
|
feedback->reportError( ba );
|
||||||
} );
|
} );
|
||||||
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->pushDebugInfo( ba );
|
feedback->pushDebugInfo( ba );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -576,10 +576,10 @@ QVariantMap QgsDownloadGpsDataAlgorithm::processAlgorithm( const QVariantMap &pa
|
|||||||
feedback->pushCommandInfo( QObject::tr( "Download command: " ) + logCommand.join( ' ' ) );
|
feedback->pushCommandInfo( QObject::tr( "Download command: " ) + logCommand.join( ' ' ) );
|
||||||
|
|
||||||
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
||||||
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba );
|
feedback->reportError( ba );
|
||||||
} );
|
} );
|
||||||
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->pushDebugInfo( ba );
|
feedback->pushDebugInfo( ba );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -796,10 +796,10 @@ QVariantMap QgsUploadGpsDataAlgorithm::processAlgorithm( const QVariantMap ¶
|
|||||||
feedback->pushCommandInfo( QObject::tr( "Upload command: " ) + logCommand.join( ' ' ) );
|
feedback->pushCommandInfo( QObject::tr( "Upload command: " ) + logCommand.join( ' ' ) );
|
||||||
|
|
||||||
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
QgsBlockingProcess babelProcess( processCommand.value( 0 ), processCommand.mid( 1 ) );
|
||||||
babelProcess.setStdErrHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdErrHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->reportError( ba );
|
feedback->reportError( ba );
|
||||||
} );
|
} );
|
||||||
babelProcess.setStdOutHandler( [=]( const QByteArray &ba ) {
|
babelProcess.setStdOutHandler( [feedback]( const QByteArray &ba ) {
|
||||||
feedback->pushDebugInfo( ba );
|
feedback->pushDebugInfo( ba );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ QVariantMap QgsPackageAlgorithm::processAlgorithm( const QVariantMap ¶meters
|
|||||||
int recursionGuard { 0 };
|
int recursionGuard { 0 };
|
||||||
|
|
||||||
// This function recursively finds referenced layers
|
// This function recursively finds referenced layers
|
||||||
const auto findReferenced = [=, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferenced ) -> void {
|
const auto findReferenced = [this, &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() ) ) ) };
|
const QgsVectorLayer *originalLayer { qobject_cast<QgsVectorLayer *>( project->mapLayer( mClonedLayerIds.value( vLayer->id(), vLayer->id() ) ) ) };
|
||||||
Q_ASSERT( originalLayer );
|
Q_ASSERT( originalLayer );
|
||||||
const QList<QgsRelation> relations { project->relationManager()->referencingRelations( originalLayer ) };
|
const QList<QgsRelation> relations { project->relationManager()->referencingRelations( originalLayer ) };
|
||||||
@ -208,7 +208,7 @@ QVariantMap QgsPackageAlgorithm::processAlgorithm( const QVariantMap ¶meters
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This function recursively finds referencing layers
|
// This function recursively finds referencing layers
|
||||||
const auto findReferencing = [=, &project, &feedback, &recursionGuard, &layers]( const QgsVectorLayer *vLayer, bool onlySaveSelected, auto &&findReferencing ) -> void {
|
const auto findReferencing = [this, &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() ) ) ) };
|
const QgsVectorLayer *originalLayer { qobject_cast<QgsVectorLayer *>( project->mapLayer( mClonedLayerIds.value( vLayer->id(), vLayer->id() ) ) ) };
|
||||||
Q_ASSERT( originalLayer );
|
Q_ASSERT( originalLayer );
|
||||||
const QList<QgsRelation> relations { project->relationManager()->referencedRelations( originalLayer ) };
|
const QList<QgsRelation> relations { project->relationManager()->referencedRelations( originalLayer ) };
|
||||||
|
@ -179,7 +179,7 @@ QVariantMap QgsRasterBooleanLogicAlgorithmBase::processAlgorithm( const QVariant
|
|||||||
|
|
||||||
QgsRasterLogicalOrAlgorithm::QgsRasterLogicalOrAlgorithm()
|
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;
|
res = false;
|
||||||
resIsNoData = false;
|
resIsNoData = false;
|
||||||
bool isNoData = false;
|
bool isNoData = false;
|
||||||
@ -252,7 +252,7 @@ QgsRasterLogicalOrAlgorithm *QgsRasterLogicalOrAlgorithm::createInstance() const
|
|||||||
|
|
||||||
QgsRasterLogicalAndAlgorithm::QgsRasterLogicalAndAlgorithm()
|
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;
|
res = true;
|
||||||
resIsNoData = false;
|
resIsNoData = false;
|
||||||
bool isNoData = false;
|
bool isNoData = false;
|
||||||
|
@ -40,7 +40,7 @@ Qgs3DAnimationExportDialog::Qgs3DAnimationExportDialog()
|
|||||||
QValidator *validator = new QRegularExpressionValidator( rx, this );
|
QValidator *validator = new QRegularExpressionValidator( rx, this );
|
||||||
mTemplateLineEdit->setValidator( validator );
|
mTemplateLineEdit->setValidator( validator );
|
||||||
|
|
||||||
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [=] {
|
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "Export3DAnimation/fileNameTemplate" ), mTemplateLineEdit->text() );
|
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->setDefaultRoot( settings.value( QStringLiteral( "Export3DAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
|
||||||
mOutputDirFileWidget->setFilePath( 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, [=] {
|
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "Export3DAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
|
settings.setValue( QStringLiteral( "Export3DAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mFpsSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/fps" ), 30 ).toInt() );
|
mFpsSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/fps" ), 30 ).toInt() );
|
||||||
connect( mFpsSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
|
connect( mFpsSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "Export3DAnimation/fps" ), mFpsSpinBox->value() );
|
settings.setValue( QStringLiteral( "Export3DAnimation/fps" ), mFpsSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mWidthSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/width" ), 800 ).toInt() );
|
mWidthSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/width" ), 800 ).toInt() );
|
||||||
connect( mWidthSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
|
connect( mWidthSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "Export3DAnimation/width" ), mWidthSpinBox->value() );
|
settings.setValue( QStringLiteral( "Export3DAnimation/width" ), mWidthSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mHeightSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/height" ), 600 ).toInt() );
|
mHeightSpinBox->setValue( settings.value( QStringLiteral( "Export3DAnimation/height" ), 600 ).toInt() );
|
||||||
connect( mHeightSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [=] {
|
connect( mHeightSpinBox, static_cast<void ( QSpinBox::* )( int )>( &QgsSpinBox::valueChanged ), this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "Export3DAnimation/height" ), mHeightSpinBox->value() );
|
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" ) );
|
QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html#create-animation" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -75,29 +75,29 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
|
|||||||
whileBlocking( chkStopUpdates )->setChecked( mMap->stopUpdates() );
|
whileBlocking( chkStopUpdates )->setChecked( mMap->stopUpdates() );
|
||||||
whileBlocking( chkStopOriginShifts )->setChecked( !m3DMapCanvas->scene()->hasSceneOriginShiftEnabled() );
|
whileBlocking( chkStopOriginShifts )->setChecked( !m3DMapCanvas->scene()->hasSceneOriginShiftEnabled() );
|
||||||
whileBlocking( chkDebugOverlay )->setChecked( mMap->isDebugOverlayEnabled() );
|
whileBlocking( chkDebugOverlay )->setChecked( mMap->isDebugOverlayEnabled() );
|
||||||
connect( chkShowTileInfo, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowTerrainTilesInfo( enabled ); } );
|
connect( chkShowTileInfo, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowTerrainTilesInfo( enabled ); } );
|
||||||
connect( chkShowBoundingBoxes, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowTerrainBoundingBoxes( enabled ); } );
|
connect( chkShowBoundingBoxes, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowTerrainBoundingBoxes( enabled ); } );
|
||||||
connect( chkShowCameraViewCenter, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowCameraViewCenter( enabled ); } );
|
connect( chkShowCameraViewCenter, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowCameraViewCenter( enabled ); } );
|
||||||
connect( chkShowCameraRotationCenter, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowCameraRotationCenter( enabled ); } );
|
connect( chkShowCameraRotationCenter, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowCameraRotationCenter( enabled ); } );
|
||||||
connect( chkShowLightSourceOrigins, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setShowLightSourceOrigins( enabled ); } );
|
connect( chkShowLightSourceOrigins, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setShowLightSourceOrigins( enabled ); } );
|
||||||
connect( chkStopUpdates, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setStopUpdates( enabled ); } );
|
connect( chkStopUpdates, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setStopUpdates( enabled ); } );
|
||||||
connect( chkStopOriginShifts, &QCheckBox::toggled, this, [=]( const bool enabled ) {
|
connect( chkStopOriginShifts, &QCheckBox::toggled, this, [this]( const bool enabled ) {
|
||||||
m3DMapCanvas->scene()->setSceneOriginShiftEnabled( !enabled );
|
m3DMapCanvas->scene()->setSceneOriginShiftEnabled( !enabled );
|
||||||
} );
|
} );
|
||||||
connect( chkDebugOverlay, &QCheckBox::toggled, this, [=]( const bool enabled ) { mMap->setIsDebugOverlayEnabled( enabled ); } );
|
connect( chkDebugOverlay, &QCheckBox::toggled, this, [this]( const bool enabled ) { mMap->setIsDebugOverlayEnabled( enabled ); } );
|
||||||
|
|
||||||
// set up the shadow map block
|
// set up the shadow map block
|
||||||
whileBlocking( mDebugShadowMapGroupBox )->setChecked( mMap->debugShadowMapEnabled() );
|
whileBlocking( mDebugShadowMapGroupBox )->setChecked( mMap->debugShadowMapEnabled() );
|
||||||
whileBlocking( mDebugShadowMapCornerComboBox )->setCurrentIndex( mMap->debugShadowMapCorner() );
|
whileBlocking( mDebugShadowMapCornerComboBox )->setCurrentIndex( mMap->debugShadowMapCorner() );
|
||||||
whileBlocking( mDebugShadowMapSizeSpinBox )->setValue( mMap->debugShadowMapSize() );
|
whileBlocking( mDebugShadowMapSizeSpinBox )->setValue( mMap->debugShadowMapSize() );
|
||||||
// Do not display the shadow debug map if the shadow effect is not enabled.
|
// Do not display the shadow debug map if the shadow effect is not enabled.
|
||||||
connect( mDebugShadowMapGroupBox, &QGroupBox::toggled, this, [=]( const bool enabled ) {
|
connect( mDebugShadowMapGroupBox, &QGroupBox::toggled, this, [this]( const bool enabled ) {
|
||||||
mMap->setDebugShadowMapSettings( enabled && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );
|
mMap->setDebugShadowMapSettings( enabled && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
connect( mDebugShadowMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( const int index ) {
|
connect( mDebugShadowMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( const int index ) {
|
||||||
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( index ), mDebugShadowMapSizeSpinBox->value() );
|
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( index ), mDebugShadowMapSizeSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
connect( mDebugShadowMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mDebugShadowMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), 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( mDebugDepthMapGroupBox )->setChecked( mMap->debugDepthMapEnabled() );
|
||||||
whileBlocking( mDebugDepthMapCornerComboBox )->setCurrentIndex( mMap->debugDepthMapCorner() );
|
whileBlocking( mDebugDepthMapCornerComboBox )->setCurrentIndex( mMap->debugDepthMapCorner() );
|
||||||
whileBlocking( mDebugDepthMapSizeSpinBox )->setValue( mMap->debugDepthMapSize() );
|
whileBlocking( mDebugDepthMapSizeSpinBox )->setValue( mMap->debugDepthMapSize() );
|
||||||
connect( mDebugDepthMapGroupBox, &QGroupBox::toggled, this, [=]( const bool enabled ) {
|
connect( mDebugDepthMapGroupBox, &QGroupBox::toggled, this, [this]( const bool enabled ) {
|
||||||
mMap->setDebugDepthMapSettings( enabled, static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() );
|
mMap->setDebugDepthMapSettings( enabled, static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
connect( mDebugDepthMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( const int index ) {
|
connect( mDebugDepthMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( const int index ) {
|
||||||
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( index ), mDebugDepthMapSizeSpinBox->value() );
|
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( index ), mDebugDepthMapSizeSpinBox->value() );
|
||||||
} );
|
} );
|
||||||
connect( mDebugDepthMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mDebugDepthMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), value );
|
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), value );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// connect the camera info spin boxes with changing functions
|
// connect the camera info spin boxes with changing functions
|
||||||
connect( mNearPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mNearPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
m3DMapCanvas->cameraController()->camera()->setNearPlane( static_cast<float>( value ) );
|
m3DMapCanvas->cameraController()->camera()->setNearPlane( static_cast<float>( value ) );
|
||||||
} );
|
} );
|
||||||
connect( mFarPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mFarPlane, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
m3DMapCanvas->cameraController()->camera()->setFarPlane( static_cast<float>( value ) );
|
m3DMapCanvas->cameraController()->camera()->setFarPlane( static_cast<float>( value ) );
|
||||||
} );
|
} );
|
||||||
connect( mCameraX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mCameraX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
||||||
newPosition.setX( static_cast<float>( value ) );
|
newPosition.setX( static_cast<float>( value ) );
|
||||||
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
||||||
} );
|
} );
|
||||||
connect( mCameraY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mCameraY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
||||||
newPosition.setY( static_cast<float>( value ) );
|
newPosition.setY( static_cast<float>( value ) );
|
||||||
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
||||||
} );
|
} );
|
||||||
connect( mCameraZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mCameraZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
QVector3D newPosition = m3DMapCanvas->cameraController()->camera()->position();
|
||||||
newPosition.setZ( static_cast<float>( value ) );
|
newPosition.setZ( static_cast<float>( value ) );
|
||||||
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
m3DMapCanvas->cameraController()->camera()->setPosition( newPosition );
|
||||||
} );
|
} );
|
||||||
connect( mLookingX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mLookingX, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
||||||
newLookingAt.setX( value );
|
newLookingAt.setX( value );
|
||||||
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
||||||
@ -147,7 +147,7 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
|
|||||||
m3DMapCanvas->cameraController()->yaw()
|
m3DMapCanvas->cameraController()->yaw()
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
connect( mLookingY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mLookingY, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
||||||
newLookingAt.setY( value );
|
newLookingAt.setY( value );
|
||||||
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
||||||
@ -157,7 +157,7 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
|
|||||||
m3DMapCanvas->cameraController()->yaw()
|
m3DMapCanvas->cameraController()->yaw()
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
connect( mLookingZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( const double value ) {
|
connect( mLookingZ, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( const double value ) {
|
||||||
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
QgsVector3D newLookingAt = m3DMapCanvas->cameraController()->lookingAtPoint();
|
||||||
newLookingAt.setZ( value );
|
newLookingAt.setZ( value );
|
||||||
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
m3DMapCanvas->cameraController()->setLookingAtPoint(
|
||||||
|
@ -230,7 +230,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
|||||||
|
|
||||||
mActionSync2DNavTo3D = new QAction( tr( "2D Map View Follows 3D Camera" ), this );
|
mActionSync2DNavTo3D = new QAction( tr( "2D Map View Follows 3D Camera" ), this );
|
||||||
mActionSync2DNavTo3D->setCheckable( true );
|
mActionSync2DNavTo3D->setCheckable( true );
|
||||||
connect( mActionSync2DNavTo3D, &QAction::triggered, this, [=]( bool enabled ) {
|
connect( mActionSync2DNavTo3D, &QAction::triggered, this, [this]( bool enabled ) {
|
||||||
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
|
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
|
||||||
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync2DTo3D, enabled );
|
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync2DTo3D, enabled );
|
||||||
mCanvas->mapSettings()->setViewSyncMode( syncMode );
|
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 = new QAction( tr( "3D Camera Follows 2D Map View" ), this );
|
||||||
mActionSync3DNavTo2D->setCheckable( true );
|
mActionSync3DNavTo2D->setCheckable( true );
|
||||||
connect( mActionSync3DNavTo2D, &QAction::triggered, this, [=]( bool enabled ) {
|
connect( mActionSync3DNavTo2D, &QAction::triggered, this, [this]( bool enabled ) {
|
||||||
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
|
Qgis::ViewSyncModeFlags syncMode = mCanvas->mapSettings()->viewSyncMode();
|
||||||
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync3DTo2D, enabled );
|
syncMode.setFlag( Qgis::ViewSyncModeFlag::Sync3DTo2D, enabled );
|
||||||
mCanvas->mapSettings()->setViewSyncMode( syncMode );
|
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 = new QAction( tr( "Show Visible Camera Area in 2D Map View" ), this );
|
||||||
mShowFrustumPolygon->setCheckable( true );
|
mShowFrustumPolygon->setCheckable( true );
|
||||||
connect( mShowFrustumPolygon, &QAction::triggered, this, [=]( bool enabled ) {
|
connect( mShowFrustumPolygon, &QAction::triggered, this, [this]( bool enabled ) {
|
||||||
mCanvas->mapSettings()->setViewFrustumVisualizationEnabled( enabled );
|
mCanvas->mapSettings()->setViewFrustumVisualizationEnabled( enabled );
|
||||||
} );
|
} );
|
||||||
mCameraMenu->addAction( mShowFrustumPolygon );
|
mCameraMenu->addAction( mShowFrustumPolygon );
|
||||||
|
|
||||||
mActionSetSceneExtent = mCameraMenu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "extents.svg" ) ), tr( "Set 3D Scene Extent on 2D Map View" ), this, &Qgs3DMapCanvasWidget::setSceneExtentOn2DCanvas );
|
mActionSetSceneExtent = mCameraMenu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "extents.svg" ) ), tr( "Set 3D Scene Extent on 2D Map View" ), this, &Qgs3DMapCanvasWidget::setSceneExtentOn2DCanvas );
|
||||||
mActionSetSceneExtent->setCheckable( true );
|
mActionSetSceneExtent->setCheckable( true );
|
||||||
auto createShortcuts = [=]( const QString &objectName, void ( Qgs3DMapCanvasWidget::*slot )() ) {
|
auto createShortcuts = [this]( const QString &objectName, void ( Qgs3DMapCanvasWidget::*slot )() ) {
|
||||||
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
|
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
|
||||||
connect( sc, &QShortcut::activated, this, slot );
|
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 = new QAction( tr( "Show Shadows" ), this );
|
||||||
mActionEnableShadows->setCheckable( true );
|
mActionEnableShadows->setCheckable( true );
|
||||||
connect( mActionEnableShadows, &QAction::toggled, this, [=]( bool enabled ) {
|
connect( mActionEnableShadows, &QAction::toggled, this, [this]( bool enabled ) {
|
||||||
QgsShadowSettings settings = mCanvas->mapSettings()->shadowSettings();
|
QgsShadowSettings settings = mCanvas->mapSettings()->shadowSettings();
|
||||||
settings.setRenderShadows( enabled );
|
settings.setRenderShadows( enabled );
|
||||||
mCanvas->mapSettings()->setShadowSettings( settings );
|
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 = new QAction( tr( "Show Eye Dome Lighting" ), this );
|
||||||
mActionEnableEyeDome->setCheckable( true );
|
mActionEnableEyeDome->setCheckable( true );
|
||||||
connect( mActionEnableEyeDome, &QAction::triggered, this, [=]( bool enabled ) {
|
connect( mActionEnableEyeDome, &QAction::triggered, this, [this]( bool enabled ) {
|
||||||
mCanvas->mapSettings()->setEyeDomeLightingEnabled( enabled );
|
mCanvas->mapSettings()->setEyeDomeLightingEnabled( enabled );
|
||||||
} );
|
} );
|
||||||
mEffectsMenu->addAction( mActionEnableEyeDome );
|
mEffectsMenu->addAction( mActionEnableEyeDome );
|
||||||
|
|
||||||
mActionEnableAmbientOcclusion = new QAction( tr( "Show Ambient Occlusion" ), this );
|
mActionEnableAmbientOcclusion = new QAction( tr( "Show Ambient Occlusion" ), this );
|
||||||
mActionEnableAmbientOcclusion->setCheckable( true );
|
mActionEnableAmbientOcclusion->setCheckable( true );
|
||||||
connect( mActionEnableAmbientOcclusion, &QAction::triggered, this, [=]( bool enabled ) {
|
connect( mActionEnableAmbientOcclusion, &QAction::triggered, this, [this]( bool enabled ) {
|
||||||
QgsAmbientOcclusionSettings ambientOcclusionSettings = mCanvas->mapSettings()->ambientOcclusionSettings();
|
QgsAmbientOcclusionSettings ambientOcclusionSettings = mCanvas->mapSettings()->ambientOcclusionSettings();
|
||||||
ambientOcclusionSettings.setEnabled( enabled );
|
ambientOcclusionSettings.setEnabled( enabled );
|
||||||
mCanvas->mapSettings()->setAmbientOcclusionSettings( ambientOcclusionSettings );
|
mCanvas->mapSettings()->setAmbientOcclusionSettings( ambientOcclusionSettings );
|
||||||
@ -308,7 +308,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
|||||||
mCanvas = new Qgs3DMapCanvas;
|
mCanvas = new Qgs3DMapCanvas;
|
||||||
mCanvas->setMinimumSize( QSize( 200, 200 ) );
|
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 ) ) );
|
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 = new QTimer( this );
|
||||||
mLabelNavSpeedHideTimeout->setInterval( 1000 );
|
mLabelNavSpeedHideTimeout->setInterval( 1000 );
|
||||||
connect( mLabelNavSpeedHideTimeout, &QTimer::timeout, this, [=] {
|
connect( mLabelNavSpeedHideTimeout, &QTimer::timeout, this, [this] {
|
||||||
mLabelNavigationSpeed->hide();
|
mLabelNavigationSpeed->hide();
|
||||||
mLabelNavSpeedHideTimeout->stop();
|
mLabelNavSpeedHideTimeout->stop();
|
||||||
} );
|
} );
|
||||||
@ -404,10 +404,10 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
|||||||
}
|
}
|
||||||
QAction *dockAction = mDockableWidgetHelper->createDockUndockAction( tr( "Dock 3D Map View" ), this );
|
QAction *dockAction = mDockableWidgetHelper->createDockUndockAction( tr( "Dock 3D Map View" ), this );
|
||||||
toolBar->addAction( dockAction );
|
toolBar->addAction( dockAction );
|
||||||
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
|
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
|
||||||
QgisApp::instance()->close3DMapView( canvasName() );
|
QgisApp::instance()->close3DMapView( canvasName() );
|
||||||
} );
|
} );
|
||||||
connect( dockAction, &QAction::toggled, this, [=]( const bool isSmallSize ) {
|
connect( dockAction, &QAction::toggled, this, [toolBar]( const bool isSmallSize ) {
|
||||||
toolBar->setIconSize( QgisApp::instance()->iconSize( isSmallSize ) );
|
toolBar->setIconSize( QgisApp::instance()->iconSize( isSmallSize ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ void Qgs3DMapCanvasWidget::configure()
|
|||||||
Qgs3DMapConfigWidget *w = new Qgs3DMapConfigWidget( map, mMainCanvas, mCanvas, mConfigureDialog );
|
Qgs3DMapConfigWidget *w = new Qgs3DMapConfigWidget( map, mMainCanvas, mCanvas, mConfigureDialog );
|
||||||
QDialogButtonBox *buttons = new QDialogButtonBox( QDialogButtonBox::Apply | QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, mConfigureDialog );
|
QDialogButtonBox *buttons = new QDialogButtonBox( QDialogButtonBox::Apply | QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, mConfigureDialog );
|
||||||
|
|
||||||
auto applyConfig = [=]() {
|
auto applyConfig = [this, map, w]() {
|
||||||
const QgsVector3D oldOrigin = map->origin();
|
const QgsVector3D oldOrigin = map->origin();
|
||||||
const QgsCoordinateReferenceSystem oldCrs = map->crs();
|
const QgsCoordinateReferenceSystem oldCrs = map->crs();
|
||||||
const QgsCameraPose oldCameraPose = mCanvas->cameraController()->cameraPose();
|
const QgsCameraPose oldCameraPose = mCanvas->cameraController()->cameraPose();
|
||||||
@ -797,7 +797,7 @@ void Qgs3DMapCanvasWidget::configure()
|
|||||||
};
|
};
|
||||||
|
|
||||||
connect( buttons, &QDialogButtonBox::rejected, mConfigureDialog, &QDialog::reject );
|
connect( buttons, &QDialogButtonBox::rejected, mConfigureDialog, &QDialog::reject );
|
||||||
connect( buttons, &QDialogButtonBox::clicked, mConfigureDialog, [=]( QAbstractButton *button ) {
|
connect( buttons, &QDialogButtonBox::clicked, mConfigureDialog, [this, buttons, applyConfig]( QAbstractButton *button ) {
|
||||||
if ( button == buttons->button( QDialogButtonBox::Apply ) || button == buttons->button( QDialogButtonBox::Ok ) )
|
if ( button == buttons->button( QDialogButtonBox::Apply ) || button == buttons->button( QDialogButtonBox::Ok ) )
|
||||||
applyConfig();
|
applyConfig();
|
||||||
if ( button == buttons->button( QDialogButtonBox::Ok ) )
|
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( buttons, &QDialogButtonBox::helpRequested, w, []() { QgsHelp::openHelp( QStringLiteral( "map_views/3d_map_view.html#scene-configuration" ) ); } );
|
||||||
|
|
||||||
connect( w, &Qgs3DMapConfigWidget::isValidChanged, this, [=]( bool valid ) {
|
connect( w, &Qgs3DMapConfigWidget::isValidChanged, this, [buttons]( bool valid ) {
|
||||||
buttons->button( QDialogButtonBox::Apply )->setEnabled( valid );
|
buttons->button( QDialogButtonBox::Apply )->setEnabled( valid );
|
||||||
buttons->button( QDialogButtonBox::Ok )->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::accepted, &dlg, &QDialog::accept );
|
||||||
connect( buttons, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
|
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 );
|
QVBoxLayout *layout = new QVBoxLayout( &dlg );
|
||||||
layout->addWidget( &exportWidget, 1 );
|
layout->addWidget( &exportWidget, 1 );
|
||||||
@ -902,7 +902,7 @@ void Qgs3DMapCanvasWidget::mapThemeMenuAboutToShow()
|
|||||||
{
|
{
|
||||||
actionFollowMain->setChecked( true );
|
actionFollowMain->setChecked( true );
|
||||||
}
|
}
|
||||||
connect( actionFollowMain, &QAction::triggered, this, [=] {
|
connect( actionFollowMain, &QAction::triggered, this, [this] {
|
||||||
mCanvas->mapSettings()->setTerrainMapTheme( QString() );
|
mCanvas->mapSettings()->setTerrainMapTheme( QString() );
|
||||||
} );
|
} );
|
||||||
mMapThemeMenuPresetActions.append( actionFollowMain );
|
mMapThemeMenuPresetActions.append( actionFollowMain );
|
||||||
|
@ -59,7 +59,7 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
|
|||||||
// get rid of annoying outer focus rect on Mac
|
// get rid of annoying outer focus rect on Mac
|
||||||
m3DOptionsListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );
|
m3DOptionsListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );
|
||||||
m3DOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/3DMapConfig/Tab" ), 0 ).toInt() );
|
m3DOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/3DMapConfig/Tab" ), 0 ).toInt() );
|
||||||
connect( m3DOptionsListWidget, &QListWidget::currentRowChanged, this, [=]( int index ) { m3DOptionsStackedWidget->setCurrentIndex( index ); } );
|
connect( m3DOptionsListWidget, &QListWidget::currentRowChanged, this, [this]( int index ) { m3DOptionsStackedWidget->setCurrentIndex( index ); } );
|
||||||
m3DOptionsStackedWidget->setCurrentIndex( m3DOptionsListWidget->currentRow() );
|
m3DOptionsStackedWidget->setCurrentIndex( m3DOptionsListWidget->currentRow() );
|
||||||
|
|
||||||
if ( !settings.contains( QStringLiteral( "Windows/3DMapConfig/OptionsSplitState" ) ) )
|
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( "Perspective Projection" ), Qt3DRender::QCameraLens::PerspectiveProjection );
|
||||||
cboCameraProjectionType->addItem( tr( "Orthogonal Projection" ), Qt3DRender::QCameraLens::OrthographicProjection );
|
cboCameraProjectionType->addItem( tr( "Orthogonal Projection" ), Qt3DRender::QCameraLens::OrthographicProjection );
|
||||||
connect( cboCameraProjectionType, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]() {
|
connect( cboCameraProjectionType, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]() {
|
||||||
spinCameraFieldOfView->setEnabled( cboCameraProjectionType->currentIndex() == cboCameraProjectionType->findData( Qt3DRender::QCameraLens::PerspectiveProjection ) );
|
spinCameraFieldOfView->setEnabled( cboCameraProjectionType->currentIndex() == cboCameraProjectionType->findData( Qt3DRender::QCameraLens::PerspectiveProjection ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mZoomInButton,
|
mZoomInButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeZoom( ZOOM_FACTOR );
|
controller->globeZoom( ZOOM_FACTOR );
|
||||||
@ -61,7 +61,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mZoomOutButton,
|
mZoomOutButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeZoom( 1 / ZOOM_FACTOR );
|
controller->globeZoom( 1 / ZOOM_FACTOR );
|
||||||
@ -75,7 +75,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mTiltUpButton,
|
mTiltUpButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( 1 );
|
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( 1 );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -85,7 +85,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mTiltDownButton,
|
mTiltDownButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( -1 );
|
m3DMapCanvas->cameraController()->tiltUpAroundViewCenter( -1 );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -98,7 +98,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mCompass,
|
mCompass,
|
||||||
&QwtDial::valueChanged,
|
&QwtDial::valueChanged,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
m3DMapCanvas->cameraController()->setCameraHeadingAngle( float( mCompass->value() ) );
|
m3DMapCanvas->cameraController()->setCameraHeadingAngle( float( mCompass->value() ) );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -108,7 +108,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mMoveUpButton,
|
mMoveUpButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeMoveCenterPoint( MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
|
controller->globeMoveCenterPoint( MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
|
||||||
@ -122,7 +122,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mMoveRightButton,
|
mMoveRightButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeMoveCenterPoint( 0, MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );
|
controller->globeMoveCenterPoint( 0, MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );
|
||||||
@ -136,7 +136,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mMoveDownButton,
|
mMoveDownButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeMoveCenterPoint( -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
|
controller->globeMoveCenterPoint( -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint(), 0 );
|
||||||
@ -150,7 +150,7 @@ Qgs3DNavigationWidget::Qgs3DNavigationWidget( Qgs3DMapCanvas *canvas, QWidget *p
|
|||||||
mMoveLeftButton,
|
mMoveLeftButton,
|
||||||
&QToolButton::clicked,
|
&QToolButton::clicked,
|
||||||
m3DMapCanvas,
|
m3DMapCanvas,
|
||||||
[=] {
|
[this] {
|
||||||
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
QgsCameraController *controller = m3DMapCanvas->cameraController();
|
||||||
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
if ( m3DMapCanvas->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||||
controller->globeMoveCenterPoint( 0, -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );
|
controller->globeMoveCenterPoint( 0, -MOVE_FACTOR * controller->cameraPose().distanceFromCenterPoint() );
|
||||||
|
@ -38,14 +38,14 @@ QgsMap3DExportWidget::QgsMap3DExportWidget( Qgs3DMapScene *scene, Qgs3DMapExport
|
|||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
connect( ui->sceneNameLineEdit, &QLineEdit::textChanged, this, [=]( const QString & ) { settingsChanged(); } );
|
connect( ui->sceneNameLineEdit, &QLineEdit::textChanged, this, [this]( const QString & ) { settingsChanged(); } );
|
||||||
connect( ui->selectFolderWidget, &QgsFileWidget::fileChanged, this, [=]( const QString & ) { settingsChanged(); } );
|
connect( ui->selectFolderWidget, &QgsFileWidget::fileChanged, this, [this]( const QString & ) { settingsChanged(); } );
|
||||||
connect( ui->smoothEdgesCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
|
connect( ui->smoothEdgesCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
|
||||||
connect( ui->terrainResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
|
connect( ui->terrainResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
|
||||||
connect( ui->exportNormalsCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
|
connect( ui->exportNormalsCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
|
||||||
connect( ui->exportTexturesCheckBox, &QCheckBox::stateChanged, this, [=]( int ) { settingsChanged(); } );
|
connect( ui->exportTexturesCheckBox, &QCheckBox::stateChanged, this, [this]( int ) { settingsChanged(); } );
|
||||||
connect( ui->terrainTextureResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
|
connect( ui->terrainTextureResolutionSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
|
||||||
connect( ui->scaleSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( int ) { settingsChanged(); } );
|
connect( ui->scaleSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( int ) { settingsChanged(); } );
|
||||||
|
|
||||||
// sets the export settings to whatever is on the scene
|
// sets the export settings to whatever is on the scene
|
||||||
settingsChanged();
|
settingsChanged();
|
||||||
|
@ -30,11 +30,11 @@ QgsMetalRoughMaterialWidget::QgsMetalRoughMaterialWidget( QWidget *parent, bool
|
|||||||
setSettings( &defaultMaterial, nullptr );
|
setSettings( &defaultMaterial, nullptr );
|
||||||
|
|
||||||
connect( mButtonBaseColor, &QgsColorButton::colorChanged, this, &QgsMetalRoughMaterialWidget::changed );
|
connect( mButtonBaseColor, &QgsColorButton::colorChanged, this, &QgsMetalRoughMaterialWidget::changed );
|
||||||
connect( mSpinMetalness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
|
connect( mSpinMetalness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
|
||||||
updateWidgetState();
|
updateWidgetState();
|
||||||
emit changed();
|
emit changed();
|
||||||
} );
|
} );
|
||||||
connect( mSpinRoughness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
|
connect( mSpinRoughness, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
|
||||||
updateWidgetState();
|
updateWidgetState();
|
||||||
emit changed();
|
emit changed();
|
||||||
} );
|
} );
|
||||||
|
@ -34,7 +34,7 @@ QgsPhongMaterialWidget::QgsPhongMaterialWidget( QWidget *parent, bool hasOpacity
|
|||||||
connect( btnDiffuse, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
connect( btnDiffuse, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
||||||
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
||||||
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
|
||||||
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
|
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
|
||||||
updateWidgetState();
|
updateWidgetState();
|
||||||
emit changed();
|
emit changed();
|
||||||
} );
|
} );
|
||||||
|
@ -33,7 +33,7 @@ QgsPhongTexturedMaterialWidget::QgsPhongTexturedMaterialWidget( QWidget *parent
|
|||||||
|
|
||||||
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
|
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
|
||||||
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
|
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongTexturedMaterialWidget::changed );
|
||||||
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [=] {
|
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, [this] {
|
||||||
updateWidgetState();
|
updateWidgetState();
|
||||||
emit changed();
|
emit changed();
|
||||||
} );
|
} );
|
||||||
|
@ -587,8 +587,8 @@ Qgs3DRendererRulePropsWidget::Qgs3DRendererRulePropsWidget( QgsRuleBased3DRender
|
|||||||
connect( editDescription, &QLineEdit::textChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
connect( editDescription, &QLineEdit::textChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
||||||
connect( groupSymbol, &QGroupBox::toggled, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
connect( groupSymbol, &QGroupBox::toggled, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
||||||
connect( mSymbolWidget, &QgsSymbol3DWidget::widgetChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
connect( mSymbolWidget, &QgsSymbol3DWidget::widgetChanged, this, &Qgs3DRendererRulePropsWidget::widgetChanged );
|
||||||
connect( mFilterRadio, &QRadioButton::toggled, this, [=]( bool toggled ) { filterFrame->setEnabled( toggled ); } );
|
connect( mFilterRadio, &QRadioButton::toggled, this, [this]( bool toggled ) { filterFrame->setEnabled( toggled ); } );
|
||||||
connect( mElseRadio, &QRadioButton::toggled, this, [=]( bool toggled ) { if ( toggled ) editFilter->setText( QStringLiteral( "ELSE" ) ); } );
|
connect( mElseRadio, &QRadioButton::toggled, this, [this]( bool toggled ) { if ( toggled ) editFilter->setText( QStringLiteral( "ELSE" ) ); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
Qgs3DRendererRulePropsWidget::~Qgs3DRendererRulePropsWidget() = default;
|
Qgs3DRendererRulePropsWidget::~Qgs3DRendererRulePropsWidget() = default;
|
||||||
|
@ -93,7 +93,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
|
|
||||||
QAction *actionRefresh = new QAction( tr( "Refresh" ), menu );
|
QAction *actionRefresh = new QAction( tr( "Refresh" ), menu );
|
||||||
connect( actionRefresh, &QAction::triggered, this, [=] { directoryItem->refresh(); } );
|
connect( actionRefresh, &QAction::triggered, this, [directoryItem] { directoryItem->refresh(); } );
|
||||||
menu->addAction( actionRefresh );
|
menu->addAction( actionRefresh );
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
@ -101,7 +101,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
QMenu *newMenu = new QMenu( tr( "New" ), menu );
|
QMenu *newMenu = new QMenu( tr( "New" ), menu );
|
||||||
|
|
||||||
QAction *createFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFolder.svg" ) ), tr( "Directory…" ), menu );
|
QAction *createFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFolder.svg" ) ), tr( "Directory…" ), menu );
|
||||||
connect( createFolder, &QAction::triggered, this, [=] {
|
connect( createFolder, &QAction::triggered, this, [directoryItem, context] {
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
const QString name = QInputDialog::getText( QgisApp::instance(), tr( "Create Directory" ), tr( "Directory name" ), QLineEdit::Normal, QString(), &ok );
|
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 );
|
QAction *createGpkg = new QAction( tr( "GeoPackage…" ), newMenu );
|
||||||
createGpkg->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewGeoPackageLayer.svg" ) ) );
|
createGpkg->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewGeoPackageLayer.svg" ) ) );
|
||||||
connect( createGpkg, &QAction::triggered, this, [=] {
|
connect( createGpkg, &QAction::triggered, this, [directoryItem, context] {
|
||||||
QDir dir( directoryItem->dirPath() );
|
QDir dir( directoryItem->dirPath() );
|
||||||
QString newName = tr( "New GeoPackage.gpkg" );
|
QString newName = tr( "New GeoPackage.gpkg" );
|
||||||
int i = 1;
|
int i = 1;
|
||||||
@ -175,7 +175,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
|
|
||||||
QAction *createShp = new QAction( tr( "ShapeFile…" ), newMenu );
|
QAction *createShp = new QAction( tr( "ShapeFile…" ), newMenu );
|
||||||
createShp->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewVectorLayer.svg" ) ) );
|
createShp->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewVectorLayer.svg" ) ) );
|
||||||
connect( createShp, &QAction::triggered, this, [=] {
|
connect( createShp, &QAction::triggered, this, [directoryItem, item, context] {
|
||||||
QString enc;
|
QString enc;
|
||||||
QDir dir( directoryItem->dirPath() );
|
QDir dir( directoryItem->dirPath() );
|
||||||
QString error;
|
QString error;
|
||||||
@ -195,7 +195,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION( 3, 6, 0 )
|
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION( 3, 6, 0 )
|
||||||
QAction *createFgdb = new QAction( tr( "ESRI FileGeodatabase…" ), newMenu );
|
QAction *createFgdb = new QAction( tr( "ESRI FileGeodatabase…" ), newMenu );
|
||||||
createFgdb->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFileGeodatabase.svg" ) ) );
|
createFgdb->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFileGeodatabase.svg" ) ) );
|
||||||
connect( createFgdb, &QAction::triggered, this, [=] {
|
connect( createFgdb, &QAction::triggered, this, [directoryItem, context] {
|
||||||
QDir dir( directoryItem->dirPath() );
|
QDir dir( directoryItem->dirPath() );
|
||||||
QString newName = tr( "New File Geodatabase.gdb" );
|
QString newName = tr( "New File Geodatabase.gdb" );
|
||||||
int i = 1;
|
int i = 1;
|
||||||
@ -254,7 +254,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
QAction *addAsFavorite = new QAction( tr( "Add as a Favorite" ), menu );
|
QAction *addAsFavorite = new QAction( tr( "Add as a Favorite" ), menu );
|
||||||
addAsFavorite->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFavorites.svg" ) ) );
|
addAsFavorite->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFavorites.svg" ) ) );
|
||||||
menu->addAction( addAsFavorite );
|
menu->addAction( addAsFavorite );
|
||||||
connect( addAsFavorite, &QAction::triggered, this, [=] {
|
connect( addAsFavorite, &QAction::triggered, this, [this, directoryItem] {
|
||||||
addFavorite( directoryItem );
|
addFavorite( directoryItem );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -263,13 +263,13 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
if ( QgsFavoriteItem *favoriteItem = qobject_cast<QgsFavoriteItem *>( item ) )
|
if ( QgsFavoriteItem *favoriteItem = qobject_cast<QgsFavoriteItem *>( item ) )
|
||||||
{
|
{
|
||||||
QAction *actionRename = new QAction( tr( "Rename Favorite…" ), menu );
|
QAction *actionRename = new QAction( tr( "Rename Favorite…" ), menu );
|
||||||
connect( actionRename, &QAction::triggered, this, [=] {
|
connect( actionRename, &QAction::triggered, this, [this, favoriteItem] {
|
||||||
renameFavorite( favoriteItem );
|
renameFavorite( favoriteItem );
|
||||||
} );
|
} );
|
||||||
menu->addAction( actionRename );
|
menu->addAction( actionRename );
|
||||||
|
|
||||||
QAction *removeFavoriteAction = new QAction( tr( "Remove Favorite" ), menu );
|
QAction *removeFavoriteAction = new QAction( tr( "Remove Favorite" ), menu );
|
||||||
connect( removeFavoriteAction, &QAction::triggered, this, [=] {
|
connect( removeFavoriteAction, &QAction::triggered, this, [this, favoriteItem] {
|
||||||
removeFavorite( favoriteItem );
|
removeFavorite( favoriteItem );
|
||||||
} );
|
} );
|
||||||
menu->addAction( removeFavoriteAction );
|
menu->addAction( removeFavoriteAction );
|
||||||
@ -277,7 +277,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QAction *hideAction = new QAction( tr( "Hide from Browser" ), menu );
|
QAction *hideAction = new QAction( tr( "Hide from Browser" ), menu );
|
||||||
connect( hideAction, &QAction::triggered, this, [=] {
|
connect( hideAction, &QAction::triggered, this, [this, directoryItem] {
|
||||||
hideDirectory( directoryItem );
|
hideDirectory( directoryItem );
|
||||||
} );
|
} );
|
||||||
menu->addAction( hideAction );
|
menu->addAction( hideAction );
|
||||||
@ -289,7 +289,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
for ( const QString &path : hiddenPathList )
|
for ( const QString &path : hiddenPathList )
|
||||||
{
|
{
|
||||||
QAction *action = new QAction( QDir::toNativeSeparators( path ), hiddenMenu );
|
QAction *action = new QAction( QDir::toNativeSeparators( path ), hiddenMenu );
|
||||||
connect( action, &QAction::triggered, this, [=] {
|
connect( action, &QAction::triggered, this, [path] {
|
||||||
QgsSettings s;
|
QgsSettings s;
|
||||||
QStringList pathsList = s.value( QStringLiteral( "/browser/hiddenPaths" ) ).toStringList();
|
QStringList pathsList = s.value( QStringLiteral( "/browser/hiddenPaths" ) ).toStringList();
|
||||||
pathsList.removeAll( path );
|
pathsList.removeAll( path );
|
||||||
@ -321,7 +321,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
hiddenMenu->addSeparator();
|
hiddenMenu->addSeparator();
|
||||||
|
|
||||||
QAction *moreAction = new QAction( tr( "Show More…" ), hiddenMenu );
|
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" ) );
|
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mOptionsPageDataSources" ) );
|
||||||
} );
|
} );
|
||||||
hiddenMenu->addAction( moreAction );
|
hiddenMenu->addAction( moreAction );
|
||||||
@ -337,14 +337,14 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
const QPixmap icon = QgsColorButton::createMenuIcon( directoryItem->iconColor(), true );
|
const QPixmap icon = QgsColorButton::createMenuIcon( directoryItem->iconColor(), true );
|
||||||
actionSetIconColor->setIcon( icon );
|
actionSetIconColor->setIcon( icon );
|
||||||
}
|
}
|
||||||
connect( actionSetIconColor, &QAction::triggered, this, [=] {
|
connect( actionSetIconColor, &QAction::triggered, this, [this, directoryItem] {
|
||||||
changeDirectoryColor( directoryItem );
|
changeDirectoryColor( directoryItem );
|
||||||
} );
|
} );
|
||||||
menu->addAction( actionSetIconColor );
|
menu->addAction( actionSetIconColor );
|
||||||
if ( directoryItem->iconColor().isValid() )
|
if ( directoryItem->iconColor().isValid() )
|
||||||
{
|
{
|
||||||
QAction *actionClearIconColor = new QAction( tr( "Clear Custom Color" ), menu );
|
QAction *actionClearIconColor = new QAction( tr( "Clear Custom Color" ), menu );
|
||||||
connect( actionClearIconColor, &QAction::triggered, this, [=] {
|
connect( actionClearIconColor, &QAction::triggered, this, [this, directoryItem] {
|
||||||
clearDirectoryColor( directoryItem );
|
clearDirectoryColor( directoryItem );
|
||||||
} );
|
} );
|
||||||
menu->addAction( actionClearIconColor );
|
menu->addAction( actionClearIconColor );
|
||||||
@ -353,7 +353,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
QMenu *scanningMenu = new QMenu( tr( "Scanning" ), menu );
|
QMenu *scanningMenu = new QMenu( tr( "Scanning" ), menu );
|
||||||
|
|
||||||
QAction *monitorAction = new QAction( tr( "Monitor for Changes" ), scanningMenu );
|
QAction *monitorAction = new QAction( tr( "Monitor for Changes" ), scanningMenu );
|
||||||
connect( monitorAction, &QAction::triggered, this, [=] {
|
connect( monitorAction, &QAction::triggered, this, [this, directoryItem] {
|
||||||
toggleMonitor( directoryItem );
|
toggleMonitor( directoryItem );
|
||||||
} );
|
} );
|
||||||
monitorAction->setCheckable( true );
|
monitorAction->setCheckable( true );
|
||||||
@ -361,7 +361,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
scanningMenu->addAction( monitorAction );
|
scanningMenu->addAction( monitorAction );
|
||||||
|
|
||||||
QAction *fastScanAction = new QAction( tr( "Fast Scan this Directory" ), scanningMenu );
|
QAction *fastScanAction = new QAction( tr( "Fast Scan this Directory" ), scanningMenu );
|
||||||
connect( fastScanAction, &QAction::triggered, this, [=] {
|
connect( fastScanAction, &QAction::triggered, this, [this, directoryItem] {
|
||||||
toggleFastScan( directoryItem );
|
toggleFastScan( directoryItem );
|
||||||
} );
|
} );
|
||||||
fastScanAction->setCheckable( true );
|
fastScanAction->setCheckable( true );
|
||||||
@ -373,7 +373,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
QAction *openFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mIconFolder.svg" ) ), tr( "Open Directory…" ), menu );
|
QAction *openFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mIconFolder.svg" ) ), tr( "Open Directory…" ), menu );
|
||||||
connect( openFolder, &QAction::triggered, this, [=] {
|
connect( openFolder, &QAction::triggered, this, [directoryItem] {
|
||||||
QDesktopServices::openUrl( QUrl::fromLocalFile( directoryItem->dirPath() ) );
|
QDesktopServices::openUrl( QUrl::fromLocalFile( directoryItem->dirPath() ) );
|
||||||
} );
|
} );
|
||||||
menu->addAction( openFolder );
|
menu->addAction( openFolder );
|
||||||
@ -381,7 +381,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
if ( QgsGui::nativePlatformInterface()->capabilities() & QgsNative::NativeOpenTerminalAtPath )
|
if ( QgsGui::nativePlatformInterface()->capabilities() & QgsNative::NativeOpenTerminalAtPath )
|
||||||
{
|
{
|
||||||
QAction *openTerminal = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionTerminal.svg" ) ), tr( "Open in Terminal…" ), menu );
|
QAction *openTerminal = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionTerminal.svg" ) ), tr( "Open in Terminal…" ), menu );
|
||||||
connect( openTerminal, &QAction::triggered, this, [=] {
|
connect( openTerminal, &QAction::triggered, this, [directoryItem] {
|
||||||
QgsGui::nativePlatformInterface()->openTerminalAtPath( directoryItem->dirPath() );
|
QgsGui::nativePlatformInterface()->openTerminalAtPath( directoryItem->dirPath() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( openTerminal );
|
menu->addAction( openTerminal );
|
||||||
@ -389,7 +389,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
}
|
}
|
||||||
|
|
||||||
QAction *propertiesAction = new QAction( tr( "Properties…" ), menu );
|
QAction *propertiesAction = new QAction( tr( "Properties…" ), menu );
|
||||||
connect( propertiesAction, &QAction::triggered, this, [=] {
|
connect( propertiesAction, &QAction::triggered, this, [this, directoryItem, context] {
|
||||||
showProperties( directoryItem, context );
|
showProperties( directoryItem, context );
|
||||||
} );
|
} );
|
||||||
menu->addAction( propertiesAction );
|
menu->addAction( propertiesAction );
|
||||||
@ -513,7 +513,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
|||||||
if ( !sourceSelectProviders.isEmpty() && sourceSelectProviders.first()->capabilities().testFlag( QgsSourceSelectProvider::Capability::ConfigureFromUri ) )
|
if ( !sourceSelectProviders.isEmpty() && sourceSelectProviders.first()->capabilities().testFlag( QgsSourceSelectProvider::Capability::ConfigureFromUri ) )
|
||||||
{
|
{
|
||||||
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
|
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
|
||||||
connect( openDataSourceManagerAction, &QAction::triggered, this, [=] {
|
connect( openDataSourceManagerAction, &QAction::triggered, this, [layerItem] {
|
||||||
QString pageName { layerItem->providerKey() };
|
QString pageName { layerItem->providerKey() };
|
||||||
// GPKG special handling
|
// GPKG special handling
|
||||||
if ( qobject_cast<QgsGeoPackageVectorLayerItem *>( layerItem ) )
|
if ( qobject_cast<QgsGeoPackageVectorLayerItem *>( layerItem ) )
|
||||||
@ -537,7 +537,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
|||||||
{
|
{
|
||||||
const QgsProviderSublayerDetails &sublayer { sublayers.first() };
|
const QgsProviderSublayerDetails &sublayer { sublayers.first() };
|
||||||
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
|
openDataSourceManagerAction = new QAction( tr( "Open with Data Source Manager…" ), menu );
|
||||||
connect( openDataSourceManagerAction, &QAction::triggered, this, [=] {
|
connect( openDataSourceManagerAction, &QAction::triggered, this, [sublayer, layerItem] {
|
||||||
QString pageName { sublayer.providerKey() };
|
QString pageName { sublayer.providerKey() };
|
||||||
// GPKG special handling
|
// GPKG special handling
|
||||||
if ( sublayer.driverName() == QLatin1String( "GeoPackage" ) )
|
if ( sublayer.driverName() == QLatin1String( "GeoPackage" ) )
|
||||||
@ -587,7 +587,7 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
|||||||
if ( fi.suffix().compare( ext, Qt::CaseInsensitive ) == 0 )
|
if ( fi.suffix().compare( ext, Qt::CaseInsensitive ) == 0 )
|
||||||
{
|
{
|
||||||
QAction *viewAction = new QAction( tr( "Open %1 Externally…" ).arg( name ), menu );
|
QAction *viewAction = new QAction( tr( "Open %1 Externally…" ).arg( name ), menu );
|
||||||
connect( viewAction, &QAction::triggered, this, [=] {
|
connect( viewAction, &QAction::triggered, this, [filename] {
|
||||||
QDesktopServices::openUrl( QUrl::fromLocalFile( filename ) );
|
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() );
|
const QString renameText = tr( "Rename “%1”…" ).arg( fi.fileName() );
|
||||||
QAction *renameAction = new QAction( renameText, menu );
|
QAction *renameAction = new QAction( renameText, menu );
|
||||||
connect( renameAction, &QAction::triggered, this, [=] {
|
connect( renameAction, &QAction::triggered, this, [this, selectedFiles, context, selectedParents, menu] {
|
||||||
const QString oldPath = selectedFiles.value( 0 );
|
const QString oldPath = selectedFiles.value( 0 );
|
||||||
const QStringList existingNames = QFileInfo( oldPath ).dir().entryList();
|
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() )
|
const QString deleteText = selectedFiles.count() == 1 ? tr( "Delete “%1”…" ).arg( fi.fileName() )
|
||||||
: tr( "Delete Selected Files…" );
|
: tr( "Delete Selected Files…" );
|
||||||
QAction *deleteAction = new QAction( deleteText, menu );
|
QAction *deleteAction = new QAction( deleteText, menu );
|
||||||
connect( deleteAction, &QAction::triggered, this, [=] {
|
connect( deleteAction, &QAction::triggered, this, [selectedFiles, selectedParents, context] {
|
||||||
// Check if the files correspond to paths in the project
|
// Check if the files correspond to paths in the project
|
||||||
QList<QgsMapLayer *> layersList;
|
QList<QgsMapLayer *> layersList;
|
||||||
for ( const QString &path : std::as_const( selectedFiles ) )
|
for ( const QString &path : std::as_const( selectedFiles ) )
|
||||||
@ -810,12 +810,12 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
|||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
QAction *showInFilesAction = menu->addAction( tr( "Show in Files" ) );
|
QAction *showInFilesAction = menu->addAction( tr( "Show in Files" ) );
|
||||||
connect( showInFilesAction, &QAction::triggered, this, [=] {
|
connect( showInFilesAction, &QAction::triggered, this, [item] {
|
||||||
QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( item->path() );
|
QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( item->path() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QAction *filePropertiesAction = menu->addAction( tr( "File Properties…" ) );
|
QAction *filePropertiesAction = menu->addAction( tr( "File Properties…" ) );
|
||||||
connect( filePropertiesAction, &QAction::triggered, this, [=] {
|
connect( filePropertiesAction, &QAction::triggered, this, [item] {
|
||||||
QgsGui::nativePlatformInterface()->showFileProperties( item->path() );
|
QgsGui::nativePlatformInterface()->showFileProperties( item->path() );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -939,7 +939,7 @@ void QgsProjectHomeItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
|
|||||||
menu->insertSeparator( menu->actions().at( 0 ) );
|
menu->insertSeparator( menu->actions().at( 0 ) );
|
||||||
|
|
||||||
QAction *setHome = new QAction( tr( "Set Project Home…" ), menu );
|
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 oldHome = QgsProject::instance()->homePath();
|
||||||
QString newPath = QFileDialog::getExistingDirectory( QgisApp::instance(), tr( "Select Project Home Directory" ), oldHome );
|
QString newPath = QFileDialog::getExistingDirectory( QgisApp::instance(), tr( "Select Project Home Directory" ), oldHome );
|
||||||
if ( !newPath.isEmpty() )
|
if ( !newPath.isEmpty() )
|
||||||
@ -970,7 +970,7 @@ void QgsFavoritesItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QAction *addAction = new QAction( tr( "Add a Directory…" ), menu );
|
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" ) );
|
QString directory = QFileDialog::getExistingDirectory( QgisApp::instance(), tr( "Add Directory to Favorites" ) );
|
||||||
if ( !directory.isEmpty() )
|
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() )
|
const QString deleteText = selectedDeletableItemPaths.count() == 1 ? tr( "Delete Layer “%1”…" ).arg( layerItem->name() )
|
||||||
: tr( "Delete Selected Layers…" );
|
: tr( "Delete Selected Layers…" );
|
||||||
QAction *deleteAction = new QAction( deleteText, menu );
|
QAction *deleteAction = new QAction( deleteText, menu );
|
||||||
connect( deleteAction, &QAction::triggered, this, [=] {
|
connect( deleteAction, &QAction::triggered, this, [this, selectedDeletableItemPaths, context] {
|
||||||
deleteLayers( selectedDeletableItemPaths, context );
|
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" )
|
const QString addText = selectedItems.count() == 1 ? tr( "Add Layer to Project" )
|
||||||
: tr( "Add Selected Layers to Project" );
|
: tr( "Add Selected Layers to Project" );
|
||||||
QAction *addAction = new QAction( addText, menu );
|
QAction *addAction = new QAction( addText, menu );
|
||||||
connect( addAction, &QAction::triggered, this, [=] {
|
connect( addAction, &QAction::triggered, this, [this, selectedItems] {
|
||||||
addLayersFromItems( selectedItems );
|
addLayersFromItems( selectedItems );
|
||||||
} );
|
} );
|
||||||
menu->addAction( addAction );
|
menu->addAction( addAction );
|
||||||
@ -1117,7 +1117,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
|
|||||||
}
|
}
|
||||||
|
|
||||||
QAction *propertiesAction = new QAction( tr( "Layer Properties…" ), menu );
|
QAction *propertiesAction = new QAction( tr( "Layer Properties…" ), menu );
|
||||||
connect( propertiesAction, &QAction::triggered, this, [=] {
|
connect( propertiesAction, &QAction::triggered, this, [this, layerItem, context] {
|
||||||
showPropertiesForItem( layerItem, context );
|
showPropertiesForItem( layerItem, context );
|
||||||
} );
|
} );
|
||||||
menu->addAction( propertiesAction );
|
menu->addAction( propertiesAction );
|
||||||
@ -2077,13 +2077,13 @@ bool QgsDatabaseItemGuiProvider::handleDrop( QgsDataItem *item, QgsDataItemGuiCo
|
|||||||
mainTask->addSubTask( exportTask );
|
mainTask->addSubTask( exportTask );
|
||||||
hasSubTasks = true;
|
hasSubTasks = true;
|
||||||
// when export is successful:
|
// when export is successful:
|
||||||
connect( exportTask, &QgsVectorLayerExporterTask::exportComplete, item, [=]() {
|
connect( exportTask, &QgsVectorLayerExporterTask::exportComplete, item, [item, context]() {
|
||||||
notify( tr( "Import to database" ), tr( "Import was successful." ), context, Qgis::MessageLevel::Success );
|
notify( tr( "Import to database" ), tr( "Import was successful." ), context, Qgis::MessageLevel::Success );
|
||||||
item->refresh();
|
item->refresh();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// when an error occurs:
|
// 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 )
|
if ( error != Qgis::VectorExportResult::UserCanceled )
|
||||||
{
|
{
|
||||||
QgsMessageOutput *output = QgsMessageOutput::createMessageOutput();
|
QgsMessageOutput *output = QgsMessageOutput::createMessageOutput();
|
||||||
@ -2297,7 +2297,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
|
|||||||
{
|
{
|
||||||
QAction *rangeDomainAction = new QAction( QObject::tr( "New Range Domain…" ) );
|
QAction *rangeDomainAction = new QAction( QObject::tr( "New Range Domain…" ) );
|
||||||
createFieldDomainMenu->addAction( rangeDomainAction );
|
createFieldDomainMenu->addAction( rangeDomainAction );
|
||||||
connect( rangeDomainAction, &QAction::triggered, this, [=] {
|
connect( rangeDomainAction, &QAction::triggered, this, [createDomain] {
|
||||||
createDomain( Qgis::FieldDomainType::Range );
|
createDomain( Qgis::FieldDomainType::Range );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -2306,7 +2306,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
|
|||||||
{
|
{
|
||||||
QAction *codedDomainAction = new QAction( QObject::tr( "New Coded Values Domain…" ) );
|
QAction *codedDomainAction = new QAction( QObject::tr( "New Coded Values Domain…" ) );
|
||||||
createFieldDomainMenu->addAction( codedDomainAction );
|
createFieldDomainMenu->addAction( codedDomainAction );
|
||||||
connect( codedDomainAction, &QAction::triggered, this, [=] {
|
connect( codedDomainAction, &QAction::triggered, this, [createDomain] {
|
||||||
createDomain( Qgis::FieldDomainType::Coded );
|
createDomain( Qgis::FieldDomainType::Coded );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -2315,7 +2315,7 @@ void QgsFieldDomainItemGuiProvider::populateContextMenu( QgsDataItem *item, QMen
|
|||||||
{
|
{
|
||||||
QAction *globDomainAction = new QAction( QObject::tr( "New Glob Domain…" ) );
|
QAction *globDomainAction = new QAction( QObject::tr( "New Glob Domain…" ) );
|
||||||
createFieldDomainMenu->addAction( globDomainAction );
|
createFieldDomainMenu->addAction( globDomainAction );
|
||||||
connect( globDomainAction, &QAction::triggered, this, [=] {
|
connect( globDomainAction, &QAction::triggered, this, [createDomain] {
|
||||||
createDomain( Qgis::FieldDomainType::Glob );
|
createDomain( Qgis::FieldDomainType::Glob );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -2580,7 +2580,7 @@ void QgsRelationshipItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
|||||||
|
|
||||||
QPointer<QgsDataItem> itemWeakPointer( item );
|
QPointer<QgsDataItem> itemWeakPointer( item );
|
||||||
|
|
||||||
connect( editRelationshipAction, &QAction::triggered, this, [=] {
|
connect( editRelationshipAction, &QAction::triggered, this, [md, itemWeakPointer, relation, connectionUri, context] {
|
||||||
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn { static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connectionUri, {} ) ) };
|
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn { static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connectionUri, {} ) ) };
|
||||||
|
|
||||||
QgsDbRelationDialog dialog( conn.release(), QgisApp::instance() );
|
QgsDbRelationDialog dialog( conn.release(), QgisApp::instance() );
|
||||||
|
@ -67,7 +67,7 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
|
|||||||
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
||||||
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
||||||
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
||||||
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
||||||
} );
|
} );
|
||||||
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
||||||
|
@ -38,7 +38,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
|
|||||||
|
|
||||||
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsDecorationGridDialog::buttonBox_accepted );
|
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsDecorationGridDialog::buttonBox_accepted );
|
||||||
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsDecorationGridDialog::buttonBox_rejected );
|
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsDecorationGridDialog::buttonBox_rejected );
|
||||||
connect( mGridTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int ) { updateSymbolButtons(); } );
|
connect( mGridTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( int ) { updateSymbolButtons(); } );
|
||||||
connect( mPbtnUpdateFromExtents, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromExtents_clicked );
|
connect( mPbtnUpdateFromExtents, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromExtents_clicked );
|
||||||
connect( mPbtnUpdateFromLayer, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromLayer_clicked );
|
connect( mPbtnUpdateFromLayer, &QPushButton::clicked, this, &QgsDecorationGridDialog::mPbtnUpdateFromLayer_clicked );
|
||||||
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationGridDialog::showHelp );
|
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationGridDialog::showHelp );
|
||||||
@ -47,7 +47,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
|
|||||||
mLineSymbolButton->setSymbolType( Qgis::SymbolType::Line );
|
mLineSymbolButton->setSymbolType( Qgis::SymbolType::Line );
|
||||||
|
|
||||||
grpEnable->setChecked( mDeco.enabled() );
|
grpEnable->setChecked( mDeco.enabled() );
|
||||||
connect( grpEnable, &QGroupBox::toggled, this, [=] { updateSymbolButtons(); } );
|
connect( grpEnable, &QGroupBox::toggled, this, [this] { updateSymbolButtons(); } );
|
||||||
|
|
||||||
mOffsetXEdit->setShowClearButton( true );
|
mOffsetXEdit->setShowClearButton( true );
|
||||||
mOffsetXEdit->setClearValue( 0 );
|
mOffsetXEdit->setClearValue( 0 );
|
||||||
|
@ -51,7 +51,7 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
|
|||||||
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
||||||
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
||||||
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
||||||
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
||||||
} );
|
} );
|
||||||
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
||||||
@ -69,7 +69,7 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
|
|||||||
|
|
||||||
// enabled
|
// enabled
|
||||||
grpEnable->setChecked( mDeco.enabled() );
|
grpEnable->setChecked( mDeco.enabled() );
|
||||||
connect( grpEnable, &QGroupBox::toggled, this, [=] { updateEnabledColorButtons(); } );
|
connect( grpEnable, &QGroupBox::toggled, this, [this] { updateEnabledColorButtons(); } );
|
||||||
|
|
||||||
wgtImagePath->setFilePath( mDeco.imagePath() );
|
wgtImagePath->setFilePath( mDeco.imagePath() );
|
||||||
connect( wgtImagePath, &QgsFileWidget::fileChanged, this, &QgsDecorationImageDialog::updateImagePath );
|
connect( wgtImagePath, &QgsFileWidget::fileChanged, this, &QgsDecorationImageDialog::updateImagePath );
|
||||||
@ -83,8 +83,8 @@ QgsDecorationImageDialog::QgsDecorationImageDialog( QgsDecorationImage &deco, QW
|
|||||||
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
|
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
|
||||||
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
|
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
|
||||||
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select SVG Image Outline Color" ) );
|
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select SVG Image Outline Color" ) );
|
||||||
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawImage(); } );
|
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawImage(); } );
|
||||||
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawImage(); } );
|
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawImage(); } );
|
||||||
|
|
||||||
drawImage();
|
drawImage();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
|
|||||||
spinAngle->setEnabled( !mDeco.mAutomatic );
|
spinAngle->setEnabled( !mDeco.mAutomatic );
|
||||||
sliderRotation->setEnabled( !mDeco.mAutomatic );
|
sliderRotation->setEnabled( !mDeco.mAutomatic );
|
||||||
|
|
||||||
connect( cboxAutomatic, &QAbstractButton::toggled, this, [=]( bool checked ) {
|
connect( cboxAutomatic, &QAbstractButton::toggled, this, [this]( bool checked ) {
|
||||||
spinAngle->setEnabled( !checked );
|
spinAngle->setEnabled( !checked );
|
||||||
sliderRotation->setEnabled( !checked );
|
sliderRotation->setEnabled( !checked );
|
||||||
} );
|
} );
|
||||||
@ -66,7 +66,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
|
|||||||
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
||||||
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
||||||
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
||||||
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
spinHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
||||||
} );
|
} );
|
||||||
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
||||||
@ -87,7 +87,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
|
|||||||
|
|
||||||
mSvgPathLineEdit->setText( mDeco.mSvgPath );
|
mSvgPathLineEdit->setText( mDeco.mSvgPath );
|
||||||
connect( mSvgPathLineEdit, &QLineEdit::textChanged, this, &QgsDecorationNorthArrowDialog::updateSvgPath );
|
connect( mSvgPathLineEdit, &QLineEdit::textChanged, this, &QgsDecorationNorthArrowDialog::updateSvgPath );
|
||||||
connect( mSvgSelectorBtn, &QPushButton::clicked, this, [=] {
|
connect( mSvgSelectorBtn, &QPushButton::clicked, this, [this] {
|
||||||
QgsSvgSelectorDialog svgDlg( this );
|
QgsSvgSelectorDialog svgDlg( this );
|
||||||
svgDlg.setWindowTitle( tr( "Select SVG file" ) );
|
svgDlg.setWindowTitle( tr( "Select SVG file" ) );
|
||||||
svgDlg.svgSelector()->setSvgPath( mSvgPathLineEdit->text().trimmed() );
|
svgDlg.svgSelector()->setSvgPath( mSvgPathLineEdit->text().trimmed() );
|
||||||
@ -109,8 +109,8 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
|
|||||||
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
|
pbnChangeOutlineColor->setColor( mDeco.mOutlineColor );
|
||||||
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
|
pbnChangeOutlineColor->setContext( QStringLiteral( "gui" ) );
|
||||||
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select North Arrow Outline Color" ) );
|
pbnChangeOutlineColor->setColorDialogTitle( tr( "Select North Arrow Outline Color" ) );
|
||||||
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawNorthArrow(); } );
|
connect( pbnChangeColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawNorthArrow(); } );
|
||||||
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [=]( QColor ) { drawNorthArrow(); } );
|
connect( pbnChangeOutlineColor, &QgsColorButton::colorChanged, this, [this]( QColor ) { drawNorthArrow(); } );
|
||||||
|
|
||||||
drawNorthArrow();
|
drawNorthArrow();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
|
|||||||
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
||||||
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
||||||
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
||||||
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
||||||
} );
|
} );
|
||||||
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
||||||
|
@ -74,7 +74,7 @@ QgsDecorationTitleDialog::QgsDecorationTitleDialog( QgsDecorationTitle &deco, QW
|
|||||||
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
cboPlacement->addItem( tr( "Bottom Left" ), QgsDecorationItem::BottomLeft );
|
||||||
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
cboPlacement->addItem( tr( "Bottom Center" ), QgsDecorationItem::BottomCenter );
|
||||||
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
cboPlacement->addItem( tr( "Bottom Right" ), QgsDecorationItem::BottomRight );
|
||||||
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( cboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
spnHorizontal->setMinimum( cboPlacement->currentData() == QgsDecorationItem::TopCenter || cboPlacement->currentData() == QgsDecorationItem::BottomCenter ? -100 : 0 );
|
||||||
} );
|
} );
|
||||||
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
cboPlacement->setCurrentIndex( cboPlacement->findData( mDeco.placement() ) );
|
||||||
|
@ -152,19 +152,19 @@ QList<QAction *> QgsNetworkLoggerRequestGroup::actions( QObject *parent )
|
|||||||
{
|
{
|
||||||
QList<QAction *> res;
|
QList<QAction *> res;
|
||||||
QAction *openUrlAction = new QAction( QObject::tr( "Open URL" ), parent );
|
QAction *openUrlAction = new QAction( QObject::tr( "Open URL" ), parent );
|
||||||
QObject::connect( openUrlAction, &QAction::triggered, openUrlAction, [=] {
|
QObject::connect( openUrlAction, &QAction::triggered, openUrlAction, [this] {
|
||||||
QDesktopServices::openUrl( mUrl );
|
QDesktopServices::openUrl( mUrl );
|
||||||
} );
|
} );
|
||||||
res << openUrlAction;
|
res << openUrlAction;
|
||||||
|
|
||||||
QAction *copyUrlAction = new QAction( QObject::tr( "Copy URL" ), parent );
|
QAction *copyUrlAction = new QAction( QObject::tr( "Copy URL" ), parent );
|
||||||
QObject::connect( copyUrlAction, &QAction::triggered, openUrlAction, [=] {
|
QObject::connect( copyUrlAction, &QAction::triggered, openUrlAction, [this] {
|
||||||
QApplication::clipboard()->setText( mUrl.url() );
|
QApplication::clipboard()->setText( mUrl.url() );
|
||||||
} );
|
} );
|
||||||
res << copyUrlAction;
|
res << copyUrlAction;
|
||||||
|
|
||||||
QAction *copyAsCurlAction = new QAction( QObject::tr( "Copy As cURL" ), parent );
|
QAction *copyAsCurlAction = new QAction( QObject::tr( "Copy As cURL" ), parent );
|
||||||
QObject::connect( copyAsCurlAction, &QAction::triggered, copyAsCurlAction, [=] {
|
QObject::connect( copyAsCurlAction, &QAction::triggered, copyAsCurlAction, [this] {
|
||||||
QString curlHeaders;
|
QString curlHeaders;
|
||||||
for ( const QPair<QString, QString> &header : std::as_const( mHeaders ) )
|
for ( const QPair<QString, QString> &header : std::as_const( mHeaders ) )
|
||||||
curlHeaders += QStringLiteral( "-H '%1: %2' " ).arg( header.first, header.second );
|
curlHeaders += QStringLiteral( "-H '%1: %2' " ).arg( header.first, header.second );
|
||||||
@ -211,7 +211,7 @@ QList<QAction *> QgsNetworkLoggerRequestGroup::actions( QObject *parent )
|
|||||||
res << copyAsCurlAction;
|
res << copyAsCurlAction;
|
||||||
|
|
||||||
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
|
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
|
||||||
QObject::connect( copyJsonAction, &QAction::triggered, openUrlAction, [=] {
|
QObject::connect( copyJsonAction, &QAction::triggered, openUrlAction, [this] {
|
||||||
const QVariant value = toVariant();
|
const QVariant value = toVariant();
|
||||||
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
|
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
|
||||||
QApplication::clipboard()->setText( json );
|
QApplication::clipboard()->setText( json );
|
||||||
|
@ -60,7 +60,7 @@ QgsNetworkLoggerTreeView::QgsNetworkLoggerTreeView( QgsNetworkLogger *logger, QW
|
|||||||
mAutoScroll = false;
|
mAutoScroll = false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [=] {
|
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [this] {
|
||||||
if ( mLogger->rowCount() > ( QgsNetworkLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
|
if ( mLogger->rowCount() > ( QgsNetworkLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
|
||||||
{
|
{
|
||||||
// never trim expanded nodes
|
// never trim expanded nodes
|
||||||
@ -185,11 +185,11 @@ QgsNetworkLoggerPanelWidget::QgsNetworkLoggerPanelWidget( QgsNetworkLogger *logg
|
|||||||
connect( mActionShowSuccessful, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowSuccessful );
|
connect( mActionShowSuccessful, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowSuccessful );
|
||||||
connect( mActionShowCached, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowCached );
|
connect( mActionShowCached, &QAction::toggled, mTreeView, &QgsNetworkLoggerTreeView::setShowCached );
|
||||||
connect( mActionClear, &QAction::triggered, mLogger, &QgsNetworkLogger::clear );
|
connect( mActionClear, &QAction::triggered, mLogger, &QgsNetworkLogger::clear );
|
||||||
connect( mActionRecord, &QAction::toggled, this, [=]( bool enabled ) {
|
connect( mActionRecord, &QAction::toggled, this, [this]( bool enabled ) {
|
||||||
QgsSettings().setValue( QStringLiteral( "logNetworkRequests" ), enabled, QgsSettings::App );
|
QgsSettings().setValue( QStringLiteral( "logNetworkRequests" ), enabled, QgsSettings::App );
|
||||||
mLogger->enableLogging( enabled );
|
mLogger->enableLogging( enabled );
|
||||||
} );
|
} );
|
||||||
connect( mActionSaveLog, &QAction::triggered, this, [=]() {
|
connect( mActionSaveLog, &QAction::triggered, this, [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 )
|
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;
|
return;
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ QgsNetworkLoggerPanelWidget::QgsNetworkLoggerPanelWidget( QgsNetworkLogger *logg
|
|||||||
|
|
||||||
mToolbar->addSeparator();
|
mToolbar->addSeparator();
|
||||||
QCheckBox *disableCacheCheck = new QCheckBox( tr( "Disable cache" ) );
|
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
|
// 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
|
// 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...
|
// users to accidentally leave this enabled and cause unnecessary server load...
|
||||||
|
@ -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 ) );
|
mTreeView->setItemDelegateForColumn( 1, new CostDelegate( static_cast<int>( QgsRuntimeProfilerNode::CustomRole::Elapsed ), static_cast<int>( QgsRuntimeProfilerNode::CustomRole::ParentElapsed ), mTreeView ) );
|
||||||
|
|
||||||
connect( mProfiler, &QgsRuntimeProfiler::groupAdded, this, [=]( const QString &group ) {
|
connect( mProfiler, &QgsRuntimeProfiler::groupAdded, this, [this]( const QString &group ) {
|
||||||
mCategoryComboBox->addItem( QgsRuntimeProfiler::translateGroupName( group ).isEmpty() ? group : QgsRuntimeProfiler::translateGroupName( group ), group );
|
mCategoryComboBox->addItem( QgsRuntimeProfiler::translateGroupName( group ).isEmpty() ? group : QgsRuntimeProfiler::translateGroupName( group ), group );
|
||||||
if ( mCategoryComboBox->count() == 1 )
|
if ( mCategoryComboBox->count() == 1 )
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ QgsProfilerPanelWidget::QgsProfilerPanelWidget( QgsRuntimeProfiler *profiler, QW
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mCategoryComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) {
|
connect( mCategoryComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) {
|
||||||
mProxyModel->setGroup( mCategoryComboBox->currentData().toString() );
|
mProxyModel->setGroup( mCategoryComboBox->currentData().toString() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ QList<QAction *> QgsDevToolsModelValueNode::actions( QObject *parent )
|
|||||||
QList<QAction *> res;
|
QList<QAction *> res;
|
||||||
|
|
||||||
QAction *copyAction = new QAction( QObject::tr( "Copy" ), parent );
|
QAction *copyAction = new QAction( QObject::tr( "Copy" ), parent );
|
||||||
QObject::connect( copyAction, &QAction::triggered, copyAction, [=] {
|
QObject::connect( copyAction, &QAction::triggered, copyAction, [this] {
|
||||||
QApplication::clipboard()->setText( QStringLiteral( "%1: %2" ).arg( mKey, mValue ) );
|
QApplication::clipboard()->setText( QStringLiteral( "%1: %2" ).arg( mKey, mValue ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -166,13 +166,13 @@ QList<QAction *> QgsDatabaseQueryLoggerQueryGroup::actions( QObject *parent )
|
|||||||
QList<QAction *> res;
|
QList<QAction *> res;
|
||||||
|
|
||||||
QAction *copyUrlAction = new QAction( QObject::tr( "Copy SQL" ), parent );
|
QAction *copyUrlAction = new QAction( QObject::tr( "Copy SQL" ), parent );
|
||||||
QObject::connect( copyUrlAction, &QAction::triggered, copyUrlAction, [=] {
|
QObject::connect( copyUrlAction, &QAction::triggered, copyUrlAction, [this] {
|
||||||
QApplication::clipboard()->setText( mSql );
|
QApplication::clipboard()->setText( mSql );
|
||||||
} );
|
} );
|
||||||
res << copyUrlAction;
|
res << copyUrlAction;
|
||||||
|
|
||||||
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
|
QAction *copyJsonAction = new QAction( QObject::tr( "Copy as JSON" ), parent );
|
||||||
QObject::connect( copyJsonAction, &QAction::triggered, copyJsonAction, [=] {
|
QObject::connect( copyJsonAction, &QAction::triggered, copyJsonAction, [this] {
|
||||||
const QVariant value = toVariant();
|
const QVariant value = toVariant();
|
||||||
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
|
const QString json = QString::fromStdString( QgsJsonUtils::jsonFromVariant( value ).dump( 2 ) );
|
||||||
QApplication::clipboard()->setText( json );
|
QApplication::clipboard()->setText( json );
|
||||||
|
@ -75,7 +75,7 @@ QgsDatabaseQueryLoggerTreeView::QgsDatabaseQueryLoggerTreeView( QgsAppQueryLogge
|
|||||||
mAutoScroll = false;
|
mAutoScroll = false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [=] {
|
connect( mLogger, &QAbstractItemModel::rowsInserted, this, [this] {
|
||||||
if ( mLogger->rowCount() > ( QgsAppQueryLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
|
if ( mLogger->rowCount() > ( QgsAppQueryLogger::MAX_LOGGED_REQUESTS * 1.2 ) ) // 20 % more as buffer
|
||||||
{
|
{
|
||||||
// never trim expanded nodes
|
// never trim expanded nodes
|
||||||
@ -183,11 +183,11 @@ QgsDatabaseQueryLoggerPanelWidget::QgsDatabaseQueryLoggerPanelWidget( QgsAppQuer
|
|||||||
|
|
||||||
connect( mFilterLineEdit, &QgsFilterLineEdit::textChanged, mTreeView, &QgsDatabaseQueryLoggerTreeView::setFilterString );
|
connect( mFilterLineEdit, &QgsFilterLineEdit::textChanged, mTreeView, &QgsDatabaseQueryLoggerTreeView::setFilterString );
|
||||||
connect( mActionClear, &QAction::triggered, mLogger, &QgsAppQueryLogger::clear );
|
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 );
|
QgsSettings().setValue( QStringLiteral( "logDatabaseQueries" ), enabled, QgsSettings::App );
|
||||||
QgsApplication::databaseQueryLog()->setEnabled( enabled );
|
QgsApplication::databaseQueryLog()->setEnabled( enabled );
|
||||||
} );
|
} );
|
||||||
connect( mActionSaveLog, &QAction::triggered, this, [=]() {
|
connect( mActionSaveLog, &QAction::triggered, this, [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 )
|
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;
|
return;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ QgsDwgImporter::QgsDwgImporter( const QString &database, const QgsCoordinateRefe
|
|||||||
|
|
||||||
// setup custom debug printer for libdxfrw
|
// setup custom debug printer for libdxfrw
|
||||||
static std::once_flag initialized;
|
static std::once_flag initialized;
|
||||||
std::call_once( initialized, [=]() {
|
std::call_once( initialized, []() {
|
||||||
DRW::setCustomDebugPrinter( new QgsDrwDebugPrinter( 4 ) );
|
DRW::setCustomDebugPrinter( new QgsDrwDebugPrinter( 4 ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -145,12 +145,12 @@ QgsElevationProfileToolMeasure::QgsElevationProfileToolMeasure( QgsElevationProf
|
|||||||
mDialog = new QgsProfileMeasureResultsDialog();
|
mDialog = new QgsProfileMeasureResultsDialog();
|
||||||
|
|
||||||
connect( this, &QgsElevationProfileToolMeasure::cleared, mDialog, &QDialog::hide );
|
connect( this, &QgsElevationProfileToolMeasure::cleared, mDialog, &QDialog::hide );
|
||||||
connect( this, &QgsElevationProfileToolMeasure::measureChanged, mDialog, [=]( double totalDistance, double deltaCurve, double deltaElevation ) {
|
connect( this, &QgsElevationProfileToolMeasure::measureChanged, mDialog, [this]( double totalDistance, double deltaCurve, double deltaElevation ) {
|
||||||
mDialog->setCrs( mElevationCanvas->crs() );
|
mDialog->setCrs( mElevationCanvas->crs() );
|
||||||
mDialog->setMeasures( totalDistance, deltaCurve, deltaElevation );
|
mDialog->setMeasures( totalDistance, deltaCurve, deltaElevation );
|
||||||
mDialog->show();
|
mDialog->show();
|
||||||
} );
|
} );
|
||||||
connect( mDialog, &QgsProfileMeasureResultsDialog::closed, this, [=] {
|
connect( mDialog, &QgsProfileMeasureResultsDialog::closed, this, [this] {
|
||||||
clear();
|
clear();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mCanvas->setLockAxisScales( settingLockAxis->value() );
|
mCanvas->setLockAxisScales( settingLockAxis->value() );
|
||||||
|
|
||||||
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
|
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
|
||||||
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [=] {
|
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [this] {
|
||||||
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
|
mCanvas->setBackgroundColor( settingBackgroundColor->value() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mLayerTreeView = new QgsAppElevationProfileLayerTreeView( mLayerTree.get() );
|
mLayerTreeView = new QgsAppElevationProfileLayerTreeView( mLayerTree.get() );
|
||||||
connect( mLayerTreeView, &QgsAppElevationProfileLayerTreeView::addLayers, this, &QgsElevationProfileWidget::addLayersInternal );
|
connect( mLayerTreeView, &QgsAppElevationProfileLayerTreeView::addLayers, this, &QgsElevationProfileWidget::addLayersInternal );
|
||||||
|
|
||||||
connect( mLayerTreeView, &QAbstractItemView::doubleClicked, this, [=]( const QModelIndex &index ) {
|
connect( mLayerTreeView, &QAbstractItemView::doubleClicked, this, [this]( const QModelIndex &index ) {
|
||||||
if ( QgsMapLayer *layer = mLayerTreeView->indexToLayer( index ) )
|
if ( QgsMapLayer *layer = mLayerTreeView->indexToLayer( index ) )
|
||||||
{
|
{
|
||||||
QgisApp::instance()->showLayerProperties( layer, QStringLiteral( "mOptsPage_Elevation" ) );
|
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 );
|
QAction *showLayerTree = new QAction( tr( "Show Layer Tree" ), this );
|
||||||
showLayerTree->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconLayerTree.svg" ) ) );
|
showLayerTree->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconLayerTree.svg" ) ) );
|
||||||
showLayerTree->setCheckable( true );
|
showLayerTree->setCheckable( true );
|
||||||
connect( showLayerTree, &QAction::toggled, this, [=]( bool checked ) {
|
connect( showLayerTree, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
settingShowLayerTree->setValue( checked );
|
settingShowLayerTree->setValue( checked );
|
||||||
mLayerTreeView->setVisible( checked );
|
mLayerTreeView->setVisible( checked );
|
||||||
} );
|
} );
|
||||||
@ -210,7 +210,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mCaptureCurveAction = new QAction( tr( "Capture Curve" ), this );
|
mCaptureCurveAction = new QAction( tr( "Capture Curve" ), this );
|
||||||
mCaptureCurveAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureLine.svg" ) ) );
|
mCaptureCurveAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureLine.svg" ) ) );
|
||||||
mCaptureCurveAction->setCheckable( true );
|
mCaptureCurveAction->setCheckable( true );
|
||||||
connect( mCaptureCurveAction, &QAction::triggered, this, [=] {
|
connect( mCaptureCurveAction, &QAction::triggered, this, [this] {
|
||||||
if ( mCaptureCurveMapTool && mMainCanvas )
|
if ( mCaptureCurveMapTool && mMainCanvas )
|
||||||
{
|
{
|
||||||
mMainCanvas->setMapTool( mCaptureCurveMapTool.get() );
|
mMainCanvas->setMapTool( mCaptureCurveMapTool.get() );
|
||||||
@ -221,7 +221,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mCaptureCurveFromFeatureAction = new QAction( tr( "Capture Curve From Feature" ), this );
|
mCaptureCurveFromFeatureAction = new QAction( tr( "Capture Curve From Feature" ), this );
|
||||||
mCaptureCurveFromFeatureAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureCurveFromFeature.svg" ) ) );
|
mCaptureCurveFromFeatureAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionCaptureCurveFromFeature.svg" ) ) );
|
||||||
mCaptureCurveFromFeatureAction->setCheckable( true );
|
mCaptureCurveFromFeatureAction->setCheckable( true );
|
||||||
connect( mCaptureCurveFromFeatureAction, &QAction::triggered, this, [=] {
|
connect( mCaptureCurveFromFeatureAction, &QAction::triggered, this, [this] {
|
||||||
if ( mCaptureCurveFromFeatureMapTool && mMainCanvas )
|
if ( mCaptureCurveFromFeatureMapTool && mMainCanvas )
|
||||||
{
|
{
|
||||||
mMainCanvas->setMapTool( mCaptureCurveFromFeatureMapTool.get() );
|
mMainCanvas->setMapTool( mCaptureCurveFromFeatureMapTool.get() );
|
||||||
@ -241,7 +241,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mNudgeRightAction->setEnabled( false );
|
mNudgeRightAction->setEnabled( false );
|
||||||
toolBar->addAction( mNudgeRightAction );
|
toolBar->addAction( mNudgeRightAction );
|
||||||
|
|
||||||
auto createShortcuts = [=]( const QString &objectName, void ( QgsElevationProfileWidget::*slot )() ) {
|
auto createShortcuts = [this]( const QString &objectName, void ( QgsElevationProfileWidget::*slot )() ) {
|
||||||
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
|
if ( QShortcut *sc = QgsGui::shortcutsManager()->shortcutByName( objectName ) )
|
||||||
connect( sc, &QShortcut::activated, this, slot );
|
connect( sc, &QShortcut::activated, this, slot );
|
||||||
};
|
};
|
||||||
@ -260,7 +260,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
identifyToolAction->setCheckable( true );
|
identifyToolAction->setCheckable( true );
|
||||||
identifyToolAction->setChecked( true );
|
identifyToolAction->setChecked( true );
|
||||||
mIdentifyTool->setAction( identifyToolAction );
|
mIdentifyTool->setAction( identifyToolAction );
|
||||||
connect( identifyToolAction, &QAction::triggered, mPanTool, [=] { mCanvas->setTool( mIdentifyTool ); } );
|
connect( identifyToolAction, &QAction::triggered, mPanTool, [this] { mCanvas->setTool( mIdentifyTool ); } );
|
||||||
toolBar->addAction( identifyToolAction );
|
toolBar->addAction( identifyToolAction );
|
||||||
|
|
||||||
QAction *panToolAction = new QAction( tr( "Pan" ), this );
|
QAction *panToolAction = new QAction( tr( "Pan" ), this );
|
||||||
@ -268,21 +268,21 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
panToolAction->setCheckable( true );
|
panToolAction->setCheckable( true );
|
||||||
panToolAction->setChecked( false );
|
panToolAction->setChecked( false );
|
||||||
mPanTool->setAction( panToolAction );
|
mPanTool->setAction( panToolAction );
|
||||||
connect( panToolAction, &QAction::triggered, mPanTool, [=] { mCanvas->setTool( mPanTool ); } );
|
connect( panToolAction, &QAction::triggered, mPanTool, [this] { mCanvas->setTool( mPanTool ); } );
|
||||||
toolBar->addAction( panToolAction );
|
toolBar->addAction( panToolAction );
|
||||||
|
|
||||||
QAction *zoomXAxisToolAction = new QAction( tr( "Zoom X Axis" ), this );
|
QAction *zoomXAxisToolAction = new QAction( tr( "Zoom X Axis" ), this );
|
||||||
zoomXAxisToolAction->setCheckable( true );
|
zoomXAxisToolAction->setCheckable( true );
|
||||||
zoomXAxisToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomInXAxis.svg" ) ) );
|
zoomXAxisToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomInXAxis.svg" ) ) );
|
||||||
mXAxisZoomTool->setAction( zoomXAxisToolAction );
|
mXAxisZoomTool->setAction( zoomXAxisToolAction );
|
||||||
connect( zoomXAxisToolAction, &QAction::triggered, mXAxisZoomTool, [=] { mCanvas->setTool( mXAxisZoomTool ); } );
|
connect( zoomXAxisToolAction, &QAction::triggered, mXAxisZoomTool, [this] { mCanvas->setTool( mXAxisZoomTool ); } );
|
||||||
toolBar->addAction( zoomXAxisToolAction );
|
toolBar->addAction( zoomXAxisToolAction );
|
||||||
|
|
||||||
QAction *zoomToolAction = new QAction( tr( "Zoom" ), this );
|
QAction *zoomToolAction = new QAction( tr( "Zoom" ), this );
|
||||||
zoomToolAction->setCheckable( true );
|
zoomToolAction->setCheckable( true );
|
||||||
zoomToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );
|
zoomToolAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );
|
||||||
mZoomTool->setAction( zoomToolAction );
|
mZoomTool->setAction( zoomToolAction );
|
||||||
connect( zoomToolAction, &QAction::triggered, mZoomTool, [=] { mCanvas->setTool( mZoomTool ); } );
|
connect( zoomToolAction, &QAction::triggered, mZoomTool, [this] { mCanvas->setTool( mZoomTool ); } );
|
||||||
toolBar->addAction( zoomToolAction );
|
toolBar->addAction( zoomToolAction );
|
||||||
|
|
||||||
QAction *resetViewAction = new QAction( tr( "Zoom Full" ), this );
|
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->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMeasure.svg" ) ) );
|
||||||
measureToolAction->setCheckable( true );
|
measureToolAction->setCheckable( true );
|
||||||
mMeasureTool->setAction( measureToolAction );
|
mMeasureTool->setAction( measureToolAction );
|
||||||
connect( measureToolAction, &QAction::triggered, this, [=] {
|
connect( measureToolAction, &QAction::triggered, this, [this] {
|
||||||
mCanvas->setTool( mMeasureTool.get() );
|
mCanvas->setTool( mMeasureTool.get() );
|
||||||
} );
|
} );
|
||||||
toolBar->addAction( measureToolAction );
|
toolBar->addAction( measureToolAction );
|
||||||
@ -383,7 +383,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
action->setData( QVariant::fromValue( unit ) );
|
action->setData( QVariant::fromValue( unit ) );
|
||||||
action->setCheckable( true );
|
action->setCheckable( true );
|
||||||
action->setActionGroup( unitGroup );
|
action->setActionGroup( unitGroup );
|
||||||
connect( action, &QAction::toggled, this, [=]( bool active ) {
|
connect( action, &QAction::toggled, this, [this, unit]( bool active ) {
|
||||||
if ( active )
|
if ( active )
|
||||||
{
|
{
|
||||||
mCanvas->setDistanceUnit( unit );
|
mCanvas->setDistanceUnit( unit );
|
||||||
@ -391,7 +391,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
} );
|
} );
|
||||||
mDistanceUnitMenu->addAction( action );
|
mDistanceUnitMenu->addAction( action );
|
||||||
}
|
}
|
||||||
connect( mDistanceUnitMenu, &QMenu::aboutToShow, this, [=] {
|
connect( mDistanceUnitMenu, &QMenu::aboutToShow, this, [this] {
|
||||||
for ( QAction *action : mDistanceUnitMenu->actions() )
|
for ( QAction *action : mDistanceUnitMenu->actions() )
|
||||||
{
|
{
|
||||||
if ( action->data().value<Qgis::DistanceUnit>() == mCanvas->distanceUnit() && !action->isChecked() )
|
if ( action->data().value<Qgis::DistanceUnit>() == mCanvas->distanceUnit() && !action->isChecked() )
|
||||||
@ -405,7 +405,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
mSettingsAction = new QgsElevationProfileWidgetSettingsAction( mOptionsMenu );
|
mSettingsAction = new QgsElevationProfileWidgetSettingsAction( mOptionsMenu );
|
||||||
|
|
||||||
mSettingsAction->toleranceSpinBox()->setValue( settingTolerance->value() );
|
mSettingsAction->toleranceSpinBox()->setValue( settingTolerance->value() );
|
||||||
connect( mSettingsAction->toleranceSpinBox(), qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [=]( double value ) {
|
connect( mSettingsAction->toleranceSpinBox(), qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( double value ) {
|
||||||
settingTolerance->setValue( value );
|
settingTolerance->setValue( value );
|
||||||
createOrUpdateRubberBands();
|
createOrUpdateRubberBands();
|
||||||
scheduleUpdate();
|
scheduleUpdate();
|
||||||
@ -483,7 +483,7 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name )
|
|||||||
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
|
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
|
||||||
toggleButton->setToolTip( tr( "Dock Elevation Profile View" ) );
|
toggleButton->setToolTip( tr( "Dock Elevation Profile View" ) );
|
||||||
toolBar->addWidget( toggleButton );
|
toolBar->addWidget( toggleButton );
|
||||||
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
|
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
|
||||||
close();
|
close();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -527,8 +527,8 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
|
|||||||
|
|
||||||
mCaptureCurveMapTool = std::make_unique<QgsMapToolProfileCurve>( canvas, QgisApp::instance()->cadDockWidget() );
|
mCaptureCurveMapTool = std::make_unique<QgsMapToolProfileCurve>( canvas, QgisApp::instance()->cadDockWidget() );
|
||||||
mCaptureCurveMapTool->setAction( mCaptureCurveAction );
|
mCaptureCurveMapTool->setAction( mCaptureCurveAction );
|
||||||
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::curveCaptured, this, [=]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
|
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::curveCaptured, this, [this]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
|
||||||
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureStarted, this, [=] {
|
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureStarted, this, [this] {
|
||||||
// if capturing a new curve, we just hide the existing rubber band -- if the user cancels the new curve digitizing then we'll
|
// 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
|
// re-show the old curve rubber band
|
||||||
if ( mRubberBand )
|
if ( mRubberBand )
|
||||||
@ -538,7 +538,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
|
|||||||
if ( mMapPointRubberBand )
|
if ( mMapPointRubberBand )
|
||||||
mMapPointRubberBand->hide();
|
mMapPointRubberBand->hide();
|
||||||
} );
|
} );
|
||||||
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureCanceled, this, [=] {
|
connect( mCaptureCurveMapTool.get(), &QgsMapToolProfileCurve::captureCanceled, this, [this] {
|
||||||
if ( mRubberBand )
|
if ( mRubberBand )
|
||||||
mRubberBand->show();
|
mRubberBand->show();
|
||||||
if ( mToleranceRubberBand )
|
if ( mToleranceRubberBand )
|
||||||
@ -549,7 +549,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
|
|||||||
|
|
||||||
mCaptureCurveFromFeatureMapTool = std::make_unique<QgsMapToolProfileCurveFromFeature>( canvas );
|
mCaptureCurveFromFeatureMapTool = std::make_unique<QgsMapToolProfileCurveFromFeature>( canvas );
|
||||||
mCaptureCurveFromFeatureMapTool->setAction( mCaptureCurveFromFeatureAction );
|
mCaptureCurveFromFeatureMapTool->setAction( mCaptureCurveFromFeatureAction );
|
||||||
connect( mCaptureCurveFromFeatureMapTool.get(), &QgsMapToolProfileCurveFromFeature::curveCaptured, this, [=]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
|
connect( mCaptureCurveFromFeatureMapTool.get(), &QgsMapToolProfileCurveFromFeature::curveCaptured, this, [this]( const QgsGeometry &curve ) { setProfileCurve( curve, true ); } );
|
||||||
|
|
||||||
mMapPointRubberBand.reset( new QgsRubberBand( canvas, Qgis::GeometryType::Point ) );
|
mMapPointRubberBand.reset( new QgsRubberBand( canvas, Qgis::GeometryType::Point ) );
|
||||||
mMapPointRubberBand->setZValue( 1000 );
|
mMapPointRubberBand->setZValue( 1000 );
|
||||||
@ -561,7 +561,7 @@ void QgsElevationProfileWidget::setMainCanvas( QgsMapCanvas *canvas )
|
|||||||
mMapPointRubberBand->hide();
|
mMapPointRubberBand->hide();
|
||||||
|
|
||||||
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
|
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
|
||||||
connect( mMainCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
|
connect( mMainCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
|
||||||
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
|
mCanvas->setDistanceUnit( mMainCanvas->mapSettings().destinationCrs().mapUnits() );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -655,7 +655,7 @@ void QgsElevationProfileWidget::onTotalPendingJobsCountChanged( int count )
|
|||||||
mJobProgressBarTimer.setSingleShot( true );
|
mJobProgressBarTimer.setSingleShot( true );
|
||||||
mJobProgressBarTimer.setInterval( 500 );
|
mJobProgressBarTimer.setInterval( 500 );
|
||||||
disconnect( mJobProgressBarTimerConnection );
|
disconnect( mJobProgressBarTimerConnection );
|
||||||
mJobProgressBarTimerConnection = connect( &mJobProgressBarTimer, &QTimer::timeout, this, [=]() {
|
mJobProgressBarTimerConnection = connect( &mJobProgressBarTimer, &QTimer::timeout, this, [this]() {
|
||||||
mProgressPendingJobs->setVisible( true );
|
mProgressPendingJobs->setVisible( true );
|
||||||
} );
|
} );
|
||||||
mJobProgressBarTimer.start();
|
mJobProgressBarTimer.start();
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
QgsMapToolProfileCurve::QgsMapToolProfileCurve( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget )
|
QgsMapToolProfileCurve::QgsMapToolProfileCurve( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget )
|
||||||
: QgsMapToolCapture( canvas, cadDockWidget, CaptureMode::CaptureLine )
|
: QgsMapToolCapture( canvas, cadDockWidget, CaptureMode::CaptureLine )
|
||||||
{
|
{
|
||||||
connect( canvas, &QgsMapCanvas::mapToolSet, this, [=]( QgsMapTool *tool, QgsMapTool * ) {
|
connect( canvas, &QgsMapCanvas::mapToolSet, this, [this]( QgsMapTool *tool, QgsMapTool * ) {
|
||||||
if ( tool != this )
|
if ( tool != this )
|
||||||
mPreviousTool = tool;
|
mPreviousTool = tool;
|
||||||
} );
|
} );
|
||||||
|
@ -57,7 +57,7 @@ QgsGCPListWidget::QgsGCPListWidget( QWidget *parent )
|
|||||||
connect( this, &QAbstractItemView::clicked, this, &QgsGCPListWidget::itemClicked );
|
connect( this, &QAbstractItemView::clicked, this, &QgsGCPListWidget::itemClicked );
|
||||||
connect( this, &QWidget::customContextMenuRequested, this, &QgsGCPListWidget::showContextMenu );
|
connect( this, &QWidget::customContextMenuRequested, this, &QgsGCPListWidget::showContextMenu );
|
||||||
|
|
||||||
connect( mGCPListModel, &QgsGCPListModel::pointEnabled, this, [=]( QgsGeorefDataPoint *point, int row ) {
|
connect( mGCPListModel, &QgsGCPListModel::pointEnabled, this, [this]( QgsGeorefDataPoint *point, int row ) {
|
||||||
emit pointEnabled( point, row );
|
emit pointEnabled( point, row );
|
||||||
adjustTableContent();
|
adjustTableContent();
|
||||||
return;
|
return;
|
||||||
@ -181,7 +181,7 @@ void QgsGCPListWidget::showContextMenu( QPoint p )
|
|||||||
setCurrentIndex( index );
|
setCurrentIndex( index );
|
||||||
|
|
||||||
QAction *jumpToPointAction = new QAction( tr( "Recenter" ), this );
|
QAction *jumpToPointAction = new QAction( tr( "Recenter" ), this );
|
||||||
connect( jumpToPointAction, &QAction::triggered, this, [=] {
|
connect( jumpToPointAction, &QAction::triggered, this, [this] {
|
||||||
const QModelIndex sourceIndex = static_cast<const QSortFilterProxyModel *>( model() )->mapToSource( currentIndex() );
|
const QModelIndex sourceIndex = static_cast<const QSortFilterProxyModel *>( model() )->mapToSource( currentIndex() );
|
||||||
mPrevRow = sourceIndex.row();
|
mPrevRow = sourceIndex.row();
|
||||||
mPrevColumn = sourceIndex.column();
|
mPrevColumn = sourceIndex.column();
|
||||||
|
@ -874,10 +874,10 @@ void QgsGeoreferencerMainWindow::showCoordDialog( const QgsPointXY &sourceCoordi
|
|||||||
{
|
{
|
||||||
mNewlyAddedPoint = new QgsGeorefDataPoint( mCanvas, QgisApp::instance()->mapCanvas(), sourceCoordinates, QgsPointXY(), QgsCoordinateReferenceSystem(), true );
|
mNewlyAddedPoint = new QgsGeorefDataPoint( mCanvas, QgisApp::instance()->mapCanvas(), sourceCoordinates, QgsPointXY(), QgsCoordinateReferenceSystem(), true );
|
||||||
mMapCoordsDialog = new QgsMapCoordsDialog( QgisApp::instance()->mapCanvas(), mNewlyAddedPoint, lastProjection, this );
|
mMapCoordsDialog = new QgsMapCoordsDialog( QgisApp::instance()->mapCanvas(), mNewlyAddedPoint, lastProjection, this );
|
||||||
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded, this, [=]( const QgsPointXY &sourceLayerCoordinate, const QgsPointXY &destinationCoordinate, const QgsCoordinateReferenceSystem &destinationCrs ) {
|
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded, this, [this]( const QgsPointXY &sourceLayerCoordinate, const QgsPointXY &destinationCoordinate, const QgsCoordinateReferenceSystem &destinationCrs ) {
|
||||||
addPoint( sourceLayerCoordinate, destinationCoordinate, destinationCrs );
|
addPoint( sourceLayerCoordinate, destinationCoordinate, destinationCrs );
|
||||||
} );
|
} );
|
||||||
connect( mMapCoordsDialog, &QObject::destroyed, this, [=] {
|
connect( mMapCoordsDialog, &QObject::destroyed, this, [this] {
|
||||||
delete mNewlyAddedPoint;
|
delete mNewlyAddedPoint;
|
||||||
mNewlyAddedPoint = nullptr;
|
mNewlyAddedPoint = nullptr;
|
||||||
} );
|
} );
|
||||||
@ -1102,9 +1102,9 @@ void QgsGeoreferencerMainWindow::createActions()
|
|||||||
connect( mActionReset, &QAction::triggered, this, &QgsGeoreferencerMainWindow::reset );
|
connect( mActionReset, &QAction::triggered, this, &QgsGeoreferencerMainWindow::reset );
|
||||||
|
|
||||||
mActionOpenRaster->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddRasterLayer.svg" ) ) );
|
mActionOpenRaster->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddRasterLayer.svg" ) ) );
|
||||||
connect( mActionOpenRaster, &QAction::triggered, this, [=] { openLayer( Qgis::LayerType::Raster ); } );
|
connect( mActionOpenRaster, &QAction::triggered, this, [this] { openLayer( Qgis::LayerType::Raster ); } );
|
||||||
|
|
||||||
connect( mActionOpenVector, &QAction::triggered, this, [=] { openLayer( Qgis::LayerType::Vector ); } );
|
connect( mActionOpenVector, &QAction::triggered, this, [this] { openLayer( Qgis::LayerType::Vector ); } );
|
||||||
|
|
||||||
mActionStartGeoref->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionStart.svg" ) ) );
|
mActionStartGeoref->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionStart.svg" ) ) );
|
||||||
connect( mActionStartGeoref, &QAction::triggered, this, &QgsGeoreferencerMainWindow::georeference );
|
connect( mActionStartGeoref, &QAction::triggered, this, &QgsGeoreferencerMainWindow::georeference );
|
||||||
@ -1211,7 +1211,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mCanvas );
|
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mCanvas );
|
||||||
addDockWidget( Qt::LeftDockWidgetArea, mAdvancedDigitizingDockWidget );
|
addDockWidget( Qt::LeftDockWidgetArea, mAdvancedDigitizingDockWidget );
|
||||||
mAdvancedDigitizingDockWidget->hide();
|
mAdvancedDigitizingDockWidget->hide();
|
||||||
connect( mActionAdvancedDigitizingDock, &QAction::triggered, mAdvancedDigitizingDockWidget, [=]( bool checked ) { mAdvancedDigitizingDockWidget->setVisible( checked ); } );
|
connect( mActionAdvancedDigitizingDock, &QAction::triggered, mAdvancedDigitizingDockWidget, [this]( bool checked ) { mAdvancedDigitizingDockWidget->setVisible( checked ); } );
|
||||||
|
|
||||||
QgsSnappingConfig snappingConfig;
|
QgsSnappingConfig snappingConfig;
|
||||||
snappingConfig.setMode( Qgis::SnappingMode::AllLayers );
|
snappingConfig.setMode( Qgis::SnappingMode::AllLayers );
|
||||||
@ -1247,7 +1247,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
|
|
||||||
mSnappingTypeButton->setMenu( typeMenu );
|
mSnappingTypeButton->setMenu( typeMenu );
|
||||||
mSnappingTypeButton->setObjectName( QStringLiteral( "SnappingTypeButton" ) );
|
mSnappingTypeButton->setObjectName( QStringLiteral( "SnappingTypeButton" ) );
|
||||||
connect( mSnappingTypeButton, &QToolButton::triggered, this, [=]( QAction *action ) {
|
connect( mSnappingTypeButton, &QToolButton::triggered, this, [this]( QAction *action ) {
|
||||||
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
|
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
|
||||||
unsigned int type = static_cast<int>( snappingConfig.typeFlag() );
|
unsigned int type = static_cast<int>( snappingConfig.typeFlag() );
|
||||||
const Qgis::SnappingTypes actionFlag = static_cast<Qgis::SnappingTypes>( action->data().toInt() );
|
const Qgis::SnappingTypes actionFlag = static_cast<Qgis::SnappingTypes>( action->data().toInt() );
|
||||||
@ -1256,7 +1256,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
mSnappingUtils->setConfig( snappingConfig );
|
mSnappingUtils->setConfig( snappingConfig );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mSnappingTypeButton, &QToolButton::clicked, this, [=]( bool checked ) {
|
connect( mSnappingTypeButton, &QToolButton::clicked, this, [this]( bool checked ) {
|
||||||
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
|
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
|
||||||
snappingConfig.setEnabled( checked );
|
snappingConfig.setEnabled( checked );
|
||||||
mSnappingUtils->setConfig( snappingConfig );
|
mSnappingUtils->setConfig( snappingConfig );
|
||||||
@ -1285,7 +1285,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
mToolDeletePoint->setAction( mActionDeletePoint );
|
mToolDeletePoint->setAction( mActionDeletePoint );
|
||||||
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::hoverPoint, this, &QgsGeoreferencerMainWindow::hoverPoint );
|
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::hoverPoint, this, &QgsGeoreferencerMainWindow::hoverPoint );
|
||||||
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::deletePoint, this, &QgsGeoreferencerMainWindow::deletePoint );
|
connect( mToolDeletePoint, &QgsGeorefToolDeletePoint::deletePoint, this, &QgsGeoreferencerMainWindow::deletePoint );
|
||||||
connect( mToolDeletePoint, &QgsMapTool::deactivated, this, [=] {
|
connect( mToolDeletePoint, &QgsMapTool::deactivated, this, [this] {
|
||||||
if ( mHoveredPoint )
|
if ( mHoveredPoint )
|
||||||
{
|
{
|
||||||
mHoveredPoint->setHovered( false );
|
mHoveredPoint->setHovered( false );
|
||||||
@ -1299,7 +1299,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
|
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
|
||||||
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
|
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
|
||||||
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
|
connect( mToolMovePoint, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
|
||||||
connect( mToolMovePoint, &QgsMapTool::deactivated, this, [=] {
|
connect( mToolMovePoint, &QgsMapTool::deactivated, this, [this] {
|
||||||
mMovingPoint = nullptr;
|
mMovingPoint = nullptr;
|
||||||
if ( mHoveredPoint )
|
if ( mHoveredPoint )
|
||||||
{
|
{
|
||||||
@ -1315,7 +1315,7 @@ void QgsGeoreferencerMainWindow::createMapCanvas()
|
|||||||
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
|
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointMoving, this, &QgsGeoreferencerMainWindow::movePoint );
|
||||||
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
|
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointEndMove, this, &QgsGeoreferencerMainWindow::releasePoint );
|
||||||
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
|
connect( mToolMovePointQgis, &QgsGeorefToolMovePoint::pointCancelMove, this, &QgsGeoreferencerMainWindow::cancelPoint );
|
||||||
connect( mToolMovePointQgis, &QgsMapTool::deactivated, this, [=] {
|
connect( mToolMovePointQgis, &QgsMapTool::deactivated, this, [this] {
|
||||||
mMovingPointQgis = nullptr;
|
mMovingPointQgis = nullptr;
|
||||||
if ( mHoveredPoint )
|
if ( mHoveredPoint )
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
|
|||||||
outputFile->setDialogTitle( tr( "Destination File" ) );
|
outputFile->setDialogTitle( tr( "Destination File" ) );
|
||||||
const QString lastDestinationFolder = settingLastDestinationFolder->value();
|
const QString lastDestinationFolder = settingLastDestinationFolder->value();
|
||||||
outputFile->setDefaultRoot( lastDestinationFolder.isEmpty() ? QDir::homePath() : lastDestinationFolder );
|
outputFile->setDefaultRoot( lastDestinationFolder.isEmpty() ? QDir::homePath() : lastDestinationFolder );
|
||||||
connect( outputFile, &QgsFileWidget::fileChanged, this, [=] {
|
connect( outputFile, &QgsFileWidget::fileChanged, this, [outputFile] {
|
||||||
settingLastDestinationFolder->setValue( QFileInfo( outputFile->filePath() ).absolutePath() );
|
settingLastDestinationFolder->setValue( QFileInfo( outputFile->filePath() ).absolutePath() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
|
|||||||
mPdfMap->setDialogTitle( tr( "Save Map File As" ) );
|
mPdfMap->setDialogTitle( tr( "Save Map File As" ) );
|
||||||
const QString lastPdfFolder = settingLastPdfFolder->value();
|
const QString lastPdfFolder = settingLastPdfFolder->value();
|
||||||
mPdfMap->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
|
mPdfMap->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
|
||||||
connect( mPdfMap, &QgsFileWidget::fileChanged, this, [=] {
|
connect( mPdfMap, &QgsFileWidget::fileChanged, this, [this] {
|
||||||
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
|
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( Qgis::LayerType type, co
|
|||||||
mPdfReport->setFilter( tr( "PDF files" ) + " (*.pdf *.PDF)" );
|
mPdfReport->setFilter( tr( "PDF files" ) + " (*.pdf *.PDF)" );
|
||||||
mPdfReport->setDialogTitle( tr( "Save Report File As" ) );
|
mPdfReport->setDialogTitle( tr( "Save Report File As" ) );
|
||||||
mPdfReport->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
|
mPdfReport->setDefaultRoot( lastPdfFolder.isEmpty() ? QDir::homePath() : lastPdfFolder );
|
||||||
connect( mPdfReport, &QgsFileWidget::fileChanged, this, [=] {
|
connect( mPdfReport, &QgsFileWidget::fileChanged, this, [this] {
|
||||||
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
|
settingLastPdfFolder->setValue( QFileInfo( mPdfMap->filePath() ).absolutePath() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ void QgsAppGpsConnection::showGpsConnectFailureWarning( const QString &message )
|
|||||||
QgisApp::instance()->statusBarIface()->clearMessage();
|
QgisApp::instance()->statusBarIface()->clearMessage();
|
||||||
mConnectionMessageItem = QgisApp::instance()->messageBar()->createMessage( QString(), message );
|
mConnectionMessageItem = QgisApp::instance()->messageBar()->createMessage( QString(), message );
|
||||||
QPushButton *configureButton = new QPushButton( tr( "Configure Device…" ) );
|
QPushButton *configureButton = new QPushButton( tr( "Configure Device…" ) );
|
||||||
connect( configureButton, &QPushButton::clicked, configureButton, [=] {
|
connect( configureButton, &QPushButton::clicked, configureButton, [] {
|
||||||
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
|
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
|
||||||
} );
|
} );
|
||||||
mConnectionMessageItem->layout()->addWidget( configureButton );
|
mConnectionMessageItem->layout()->addWidget( configureButton );
|
||||||
|
@ -125,10 +125,10 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
|
|||||||
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mUpdateGpsDetailsAction );
|
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mUpdateGpsDetailsAction );
|
||||||
|
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
||||||
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
|
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
||||||
} );
|
} );
|
||||||
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
|
||||||
setTransformContext( QgsProject::instance()->transformContext() );
|
setTransformContext( QgsProject::instance()->transformContext() );
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, transformContext() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, transformContext() );
|
||||||
} );
|
} );
|
||||||
@ -136,7 +136,7 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
|
|||||||
|
|
||||||
setEllipsoid( QgsProject::instance()->ellipsoid() );
|
setEllipsoid( QgsProject::instance()->ellipsoid() );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
|
||||||
setEllipsoid( QgsProject::instance()->ellipsoid() );
|
setEllipsoid( QgsProject::instance()->ellipsoid() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -146,13 +146,13 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
|
|||||||
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsAppGpsDigitizing::gpsSettingsChanged );
|
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsAppGpsDigitizing::gpsSettingsChanged );
|
||||||
gpsSettingsChanged();
|
gpsSettingsChanged();
|
||||||
|
|
||||||
connect( QgisApp::instance(), &QgisApp::activeLayerChanged, this, [=]( QgsMapLayer *layer ) {
|
connect( QgisApp::instance(), &QgisApp::activeLayerChanged, this, []( QgsMapLayer *layer ) {
|
||||||
if ( QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
|
if ( QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setDestinationLayer( qobject_cast<QgsVectorLayer *>( layer ) );
|
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 )
|
if ( enabled )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setDestinationLayer( qobject_cast<QgsVectorLayer *>( QgisApp::instance()->activeLayer() ) );
|
QgsProject::instance()->gpsSettings()->setDestinationLayer( qobject_cast<QgsVectorLayer *>( QgisApp::instance()->activeLayer() ) );
|
||||||
@ -164,7 +164,7 @@ QgsAppGpsDigitizing::QgsAppGpsDigitizing( QgsAppGpsConnection *connection, QgsMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
setAutomaticallyAddTrackVertices( QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
|
setAutomaticallyAddTrackVertices( QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
|
||||||
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [=]( bool enabled ) {
|
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [this]( bool enabled ) {
|
||||||
setAutomaticallyAddTrackVertices( enabled );
|
setAutomaticallyAddTrackVertices( enabled );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -60,11 +60,11 @@ QgsAppGpsLogging::QgsAppGpsLogging( QgsAppGpsConnection *connection, QObject *pa
|
|||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, mConnection( connection )
|
, mConnection( connection )
|
||||||
{
|
{
|
||||||
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
|
||||||
if ( mGpkgLogger )
|
if ( mGpkgLogger )
|
||||||
mGpkgLogger->setTransformContext( QgsProject::instance()->transformContext() );
|
mGpkgLogger->setTransformContext( QgsProject::instance()->transformContext() );
|
||||||
} );
|
} );
|
||||||
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
|
||||||
if ( mGpkgLogger )
|
if ( mGpkgLogger )
|
||||||
mGpkgLogger->setEllipsoid( QgsProject::instance()->ellipsoid() );
|
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::connected, this, &QgsAppGpsLogging::gpsConnected );
|
||||||
connect( mConnection, &QgsAppGpsConnection::disconnected, this, &QgsAppGpsLogging::gpsDisconnected );
|
connect( mConnection, &QgsAppGpsConnection::disconnected, this, &QgsAppGpsLogging::gpsDisconnected );
|
||||||
|
|
||||||
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [=] {
|
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, [this] {
|
||||||
if ( mGpkgLogger )
|
if ( mGpkgLogger )
|
||||||
mGpkgLogger->updateGpsSettings();
|
mGpkgLogger->updateGpsSettings();
|
||||||
} );
|
} );
|
||||||
|
@ -101,7 +101,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
mShowLocationMarkerAction = new QAction( tr( "Show Location Marker" ), this );
|
mShowLocationMarkerAction = new QAction( tr( "Show Location Marker" ), this );
|
||||||
mShowLocationMarkerAction->setCheckable( true );
|
mShowLocationMarkerAction->setCheckable( true );
|
||||||
mShowLocationMarkerAction->setChecked( showLocationMarker );
|
mShowLocationMarkerAction->setChecked( showLocationMarker );
|
||||||
connect( mShowLocationMarkerAction, &QAction::toggled, this, [=]( bool checked ) {
|
connect( mShowLocationMarkerAction, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
emit locationMarkerToggled( checked );
|
emit locationMarkerToggled( checked );
|
||||||
QgsGpsMarker::settingShowLocationMarker->setValue( checked );
|
QgsGpsMarker::settingShowLocationMarker->setValue( checked );
|
||||||
} );
|
} );
|
||||||
@ -111,7 +111,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
mShowBearingLineAction = new QAction( tr( "Show Bearing Line" ), this );
|
mShowBearingLineAction = new QAction( tr( "Show Bearing Line" ), this );
|
||||||
mShowBearingLineAction->setCheckable( true );
|
mShowBearingLineAction->setCheckable( true );
|
||||||
mShowBearingLineAction->setChecked( showBearingLine );
|
mShowBearingLineAction->setChecked( showBearingLine );
|
||||||
connect( mShowBearingLineAction, &QAction::toggled, this, [=]( bool checked ) {
|
connect( mShowBearingLineAction, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
emit bearingLineToggled( checked );
|
emit bearingLineToggled( checked );
|
||||||
QgsGpsCanvasBridge::settingShowBearingLine->setValue( 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 = new QAction( tr( "Rotate Map to Match GPS Direction" ), this );
|
||||||
mRotateMapAction->setCheckable( true );
|
mRotateMapAction->setCheckable( true );
|
||||||
mRotateMapAction->setChecked( rotateMap );
|
mRotateMapAction->setChecked( rotateMap );
|
||||||
connect( mRotateMapAction, &QAction::toggled, this, [=]( bool checked ) {
|
connect( mRotateMapAction, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
QgsGpsCanvasBridge::settingRotateMap->setValue( checked );
|
QgsGpsCanvasBridge::settingRotateMap->setValue( checked );
|
||||||
emit rotateMapToggled( checked );
|
emit rotateMapToggled( checked );
|
||||||
} );
|
} );
|
||||||
@ -148,7 +148,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mRadioAlwaysRecenter, &QRadioButton::toggled, this, [=]( bool checked ) {
|
connect( mRadioAlwaysRecenter, &QRadioButton::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Always );
|
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Always );
|
||||||
@ -156,7 +156,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mRadioRecenterWhenOutside, &QRadioButton::toggled, this, [=]( bool checked ) {
|
connect( mRadioRecenterWhenOutside, &QRadioButton::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::WhenOutsideVisibleExtent );
|
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::WhenOutsideVisibleExtent );
|
||||||
@ -164,7 +164,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mRadioNeverRecenter, &QRadioButton::toggled, this, [=]( bool checked ) {
|
connect( mRadioNeverRecenter, &QRadioButton::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Never );
|
QgsGpsCanvasBridge::settingMapCenteringMode->setValue( Qgis::MapRecenteringMode::Never );
|
||||||
@ -180,7 +180,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
mAutoAddTrackVerticesAction = new QAction( tr( "Automatically Add Track Vertices" ), this );
|
mAutoAddTrackVerticesAction = new QAction( tr( "Automatically Add Track Vertices" ), this );
|
||||||
mAutoAddTrackVerticesAction->setCheckable( true );
|
mAutoAddTrackVerticesAction->setCheckable( true );
|
||||||
mAutoAddTrackVerticesAction->setChecked( QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
|
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() )
|
if ( checked != QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setAutomaticallyAddTrackVertices( checked );
|
QgsProject::instance()->gpsSettings()->setAutomaticallyAddTrackVertices( checked );
|
||||||
@ -194,7 +194,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
mAutoSaveAddedFeatureAction = new QAction( tr( "Automatically Save Added Feature" ), this );
|
mAutoSaveAddedFeatureAction = new QAction( tr( "Automatically Save Added Feature" ), this );
|
||||||
mAutoSaveAddedFeatureAction->setCheckable( true );
|
mAutoSaveAddedFeatureAction->setCheckable( true );
|
||||||
mAutoSaveAddedFeatureAction->setChecked( QgsProject::instance()->gpsSettings()->automaticallyCommitFeatures() );
|
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() )
|
if ( checked != QgsProject::instance()->gpsSettings()->automaticallyCommitFeatures() )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setAutomaticallyCommitFeatures( checked );
|
QgsProject::instance()->gpsSettings()->setAutomaticallyCommitFeatures( checked );
|
||||||
@ -217,7 +217,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
|
|
||||||
mActionGpkgLog = new QAction( tr( "Log to GeoPackage/Spatialite…" ), this );
|
mActionGpkgLog = new QAction( tr( "Log to GeoPackage/Spatialite…" ), this );
|
||||||
mActionGpkgLog->setCheckable( true );
|
mActionGpkgLog->setCheckable( true );
|
||||||
connect( mActionGpkgLog, &QAction::toggled, this, [=]( bool checked ) {
|
connect( mActionGpkgLog, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
const QString lastGpkgLog = QgsAppGpsLogging::settingLastGpkgLog->value();
|
const QString lastGpkgLog = QgsAppGpsLogging::settingLastGpkgLog->value();
|
||||||
@ -246,7 +246,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
|
|
||||||
mActionNmeaLog = new QAction( tr( "Log NMEA Sentences…" ), this );
|
mActionNmeaLog = new QAction( tr( "Log NMEA Sentences…" ), this );
|
||||||
mActionNmeaLog->setCheckable( true );
|
mActionNmeaLog->setCheckable( true );
|
||||||
connect( mActionNmeaLog, &QAction::toggled, this, [=]( bool checked ) {
|
connect( mActionNmeaLog, &QAction::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
const QString lastLogFolder = QgsAppGpsLogging::settingLastLogFolder->value();
|
const QString lastLogFolder = QgsAppGpsLogging::settingLastLogFolder->value();
|
||||||
@ -277,7 +277,7 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
|
|||||||
|
|
||||||
QAction *settingsAction = new QAction( tr( "GPS Settings…" ), this );
|
QAction *settingsAction = new QAction( tr( "GPS Settings…" ), this );
|
||||||
settingsAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) ) );
|
settingsAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) ) );
|
||||||
connect( settingsAction, &QAction::triggered, this, [=] {
|
connect( settingsAction, &QAction::triggered, this, [] {
|
||||||
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
|
QgisApp::instance()->showOptionsDialog( QgisApp::instance(), QStringLiteral( "mGpsOptions" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ void QgsAppGpsSettingsMenu::timeStampMenuAboutToShow()
|
|||||||
foundPreviousField = true;
|
foundPreviousField = true;
|
||||||
fieldAction->setChecked( currentTimeStampField == fieldName );
|
fieldAction->setChecked( currentTimeStampField == fieldName );
|
||||||
}
|
}
|
||||||
connect( fieldAction, &QAction::triggered, this, [=]() {
|
connect( fieldAction, &QAction::triggered, this, [fieldName]() {
|
||||||
if ( QgsProject::instance()->gpsSettings()->destinationTimeStampField() != fieldName )
|
if ( QgsProject::instance()->gpsSettings()->destinationTimeStampField() != fieldName )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setDestinationTimeStampField( QgsProject::instance()->gpsSettings()->destinationLayer(), fieldName );
|
QgsProject::instance()->gpsSettings()->setDestinationTimeStampField( QgsProject::instance()->gpsSettings()->destinationLayer(), fieldName );
|
||||||
|
@ -59,16 +59,16 @@ QgsGpsCanvasBridge::QgsGpsCanvasBridge( QgsAppGpsConnection *connection, QgsMapC
|
|||||||
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsGpsCanvasBridge::gpsSettingsChanged );
|
connect( QgsGui::instance(), &QgsGui::optionsChanged, this, &QgsGpsCanvasBridge::gpsSettingsChanged );
|
||||||
|
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
||||||
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [=] {
|
connect( mCanvas, &QgsMapCanvas::destinationCrsChanged, this, [this] {
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
||||||
} );
|
} );
|
||||||
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::transformContextChanged, this, [this] {
|
||||||
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
mCanvasToWgs84Transform = QgsCoordinateTransform( mCanvas->mapSettings().destinationCrs(), mWgs84CRS, QgsProject::instance() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
|
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
|
||||||
mDistanceCalculator.setSourceCrs( mWgs84CRS, QgsProject::instance()->transformContext() );
|
mDistanceCalculator.setSourceCrs( mWgs84CRS, QgsProject::instance()->transformContext() );
|
||||||
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged, this, [this] {
|
||||||
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
|
mDistanceCalculator.setEllipsoid( QgsProject::instance()->ellipsoid() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ QgsGpsCanvasBridge::QgsGpsCanvasBridge( QgsAppGpsConnection *connection, QgsMapC
|
|||||||
connect( mCanvas, &QgsMapCanvas::tapAndHoldGestureOccurred, this, &QgsGpsCanvasBridge::tapAndHold );
|
connect( mCanvas, &QgsMapCanvas::tapAndHoldGestureOccurred, this, &QgsGpsCanvasBridge::tapAndHold );
|
||||||
|
|
||||||
mBearingNumericFormat.reset( QgsLocalDefaultSettings::bearingFormat() );
|
mBearingNumericFormat.reset( QgsLocalDefaultSettings::bearingFormat() );
|
||||||
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [=] {
|
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [this] {
|
||||||
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
|
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
|
||||||
updateGpsDistanceStatusMessage( false );
|
updateGpsDistanceStatusMessage( false );
|
||||||
} );
|
} );
|
||||||
|
@ -188,7 +188,7 @@ QgsGpsInformationWidget::QgsGpsInformationWidget( QgsAppGpsConnection *connectio
|
|||||||
connect( mConnection, &QgsAppGpsConnection::stateChanged, this, &QgsGpsInformationWidget::displayGPSInformation );
|
connect( mConnection, &QgsAppGpsConnection::stateChanged, this, &QgsGpsInformationWidget::displayGPSInformation );
|
||||||
connect( mConnection, &QgsAppGpsConnection::fixStatusChanged, this, &QgsGpsInformationWidget::setStatusIndicator );
|
connect( mConnection, &QgsAppGpsConnection::fixStatusChanged, this, &QgsGpsInformationWidget::setStatusIndicator );
|
||||||
|
|
||||||
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [=]( Qgis::DeviceConnectionStatus status ) {
|
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [this]( Qgis::DeviceConnectionStatus status ) {
|
||||||
switch ( status )
|
switch ( status )
|
||||||
{
|
{
|
||||||
case Qgis::DeviceConnectionStatus::Disconnected:
|
case Qgis::DeviceConnectionStatus::Disconnected:
|
||||||
|
@ -56,7 +56,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
|
|||||||
mConnectAction->setCheckable( true );
|
mConnectAction->setCheckable( true );
|
||||||
addAction( mConnectAction );
|
addAction( mConnectAction );
|
||||||
|
|
||||||
connect( mConnectAction, &QAction::toggled, this, [=]( bool connect ) {
|
connect( mConnectAction, &QAction::toggled, this, [this]( bool connect ) {
|
||||||
if ( connect )
|
if ( connect )
|
||||||
mConnection->connectGps();
|
mConnection->connectGps();
|
||||||
else
|
else
|
||||||
@ -68,7 +68,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
|
|||||||
mRecenterAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionRecenter.svg" ) ) );
|
mRecenterAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionRecenter.svg" ) ) );
|
||||||
mRecenterAction->setEnabled( false );
|
mRecenterAction->setEnabled( false );
|
||||||
|
|
||||||
connect( mRecenterAction, &QAction::triggered, this, [=] {
|
connect( mRecenterAction, &QAction::triggered, this, [this] {
|
||||||
if ( mConnection->lastValidLocation().isEmpty() )
|
if ( mConnection->lastValidLocation().isEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *can
|
|||||||
mCreateFeatureAction->setEnabled( false );
|
mCreateFeatureAction->setEnabled( false );
|
||||||
mAddTrackVertexAction->setEnabled( false );
|
mAddTrackVertexAction->setEnabled( false );
|
||||||
mResetFeatureAction->setEnabled( false );
|
mResetFeatureAction->setEnabled( false );
|
||||||
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [=]( Qgis::DeviceConnectionStatus status ) {
|
connect( mConnection, &QgsAppGpsConnection::statusChanged, this, [this]( Qgis::DeviceConnectionStatus status ) {
|
||||||
switch ( status )
|
switch ( status )
|
||||||
{
|
{
|
||||||
case Qgis::DeviceConnectionStatus::Disconnected:
|
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::destinationLayerChanged, this, &QgsGpsToolBar::destinationLayerChanged );
|
||||||
|
|
||||||
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [=]( bool enabled ) { setAddVertexButtonEnabled( !enabled ); } );
|
connect( QgsProject::instance()->gpsSettings(), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, this, [this]( bool enabled ) { setAddVertexButtonEnabled( !enabled ); } );
|
||||||
setAddVertexButtonEnabled( !QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
|
setAddVertexButtonEnabled( !QgsProject::instance()->gpsSettings()->automaticallyAddTrackVertices() );
|
||||||
|
|
||||||
adjustSize();
|
adjustSize();
|
||||||
@ -408,7 +408,7 @@ void QgsGpsToolBar::destinationMenuAboutToShow()
|
|||||||
followAction->setCheckable( true );
|
followAction->setCheckable( true );
|
||||||
followAction->setChecked( QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() );
|
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() )
|
if ( checked && !QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
|
||||||
{
|
{
|
||||||
QgsProject::instance()->gpsSettings()->setDestinationFollowsActiveLayer( true );
|
QgsProject::instance()->gpsSettings()->setDestinationFollowsActiveLayer( true );
|
||||||
@ -431,7 +431,7 @@ void QgsGpsToolBar::destinationMenuAboutToShow()
|
|||||||
if ( actionLayerId == currentLayerId && !QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
|
if ( actionLayerId == currentLayerId && !QgsProject::instance()->gpsSettings()->destinationFollowsActiveLayer() )
|
||||||
layerAction->setChecked( true );
|
layerAction->setChecked( true );
|
||||||
|
|
||||||
connect( layerAction, &QAction::toggled, this, [=]( bool checked ) {
|
connect( layerAction, &QAction::toggled, this, [actionLayerId]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( QgsProject::instance()->mapLayer( actionLayerId ) );
|
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( QgsProject::instance()->mapLayer( actionLayerId ) );
|
||||||
@ -475,7 +475,7 @@ void QgsGpsToolBar::createLocationWidget()
|
|||||||
showComponentAction->setChecked( visibleComponents & component );
|
showComponentAction->setChecked( visibleComponents & component );
|
||||||
locationMenu->addAction( showComponentAction );
|
locationMenu->addAction( showComponentAction );
|
||||||
|
|
||||||
connect( showComponentAction, &QAction::toggled, this, [=]( bool checked ) {
|
connect( showComponentAction, &QAction::toggled, this, [this, component]( bool checked ) {
|
||||||
const Qgis::GpsInformationComponents currentVisibleComponents = settingShowInToolbar->value();
|
const Qgis::GpsInformationComponents currentVisibleComponents = settingShowInToolbar->value();
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
|
@ -67,13 +67,13 @@ QgsLayout3DMapWidget::QgsLayout3DMapWidget( QgsLayoutItem3DMap *map3D )
|
|||||||
|
|
||||||
mMenu3DCanvases = new QMenu( this );
|
mMenu3DCanvases = new QMenu( this );
|
||||||
mCopySettingsButton->setMenu( mMenu3DCanvases );
|
mCopySettingsButton->setMenu( mMenu3DCanvases );
|
||||||
_prepare3DViewsMenu( mMenu3DCanvases, this, [=]( Qgs3DMapCanvasWidget *widget ) {
|
_prepare3DViewsMenu( mMenu3DCanvases, this, [this]( Qgs3DMapCanvasWidget *widget ) {
|
||||||
copy3DMapSettings( widget );
|
copy3DMapSettings( widget );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mMenu3DCanvasesPose = new QMenu( this );
|
mMenu3DCanvasesPose = new QMenu( this );
|
||||||
mPoseFromViewButton->setMenu( mMenu3DCanvasesPose );
|
mPoseFromViewButton->setMenu( mMenu3DCanvasesPose );
|
||||||
_prepare3DViewsMenu( mMenu3DCanvasesPose, this, [=]( Qgs3DMapCanvasWidget *widget ) { copyCameraPose( widget ); } );
|
_prepare3DViewsMenu( mMenu3DCanvasesPose, this, [this]( Qgs3DMapCanvasWidget *widget ) { copyCameraPose( widget ); } );
|
||||||
|
|
||||||
QList<QgsDoubleSpinBox *> lst;
|
QList<QgsDoubleSpinBox *> lst;
|
||||||
lst << mCenterXSpinBox << mCenterYSpinBox << mCenterZSpinBox << mDistanceToCenterSpinBox << mPitchAngleSpinBox << mHeadingAngleSpinBox;
|
lst << mCenterXSpinBox << mCenterYSpinBox << mCenterZSpinBox << mDistanceToCenterSpinBox << mPitchAngleSpinBox << mHeadingAngleSpinBox;
|
||||||
|
@ -328,7 +328,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
QgsGui::enableAutoGeometryRestore( this );
|
QgsGui::enableAutoGeometryRestore( this );
|
||||||
|
|
||||||
mScreenHelper = new QgsScreenHelper( this );
|
mScreenHelper = new QgsScreenHelper( this );
|
||||||
connect( mScreenHelper, &QgsScreenHelper::screenDpiChanged, this, [=]( double ) {
|
connect( mScreenHelper, &QgsScreenHelper::screenDpiChanged, this, [this]( double ) {
|
||||||
updateStatusZoom();
|
updateStatusZoom();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mActionPageSetup->setVisible( false );
|
mActionPageSetup->setVisible( false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect( mActionOptions, &QAction::triggered, this, [=] {
|
connect( mActionOptions, &QAction::triggered, this, [this] {
|
||||||
QgisApp::instance()->showOptionsDialog( this, QStringLiteral( "mOptionsPageComposer" ) );
|
QgisApp::instance()->showOptionsDialog( this, QStringLiteral( "mOptionsPageComposer" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -448,12 +448,12 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
|
|
||||||
mDynamicTextMenu = new QMenu( tr( "Add Dynamic Text" ), this );
|
mDynamicTextMenu = new QMenu( tr( "Add Dynamic Text" ), this );
|
||||||
|
|
||||||
connect( mDynamicTextMenu, &QMenu::aboutToShow, this, [=] {
|
connect( mDynamicTextMenu, &QMenu::aboutToShow, this, [this] {
|
||||||
mDynamicTextMenu->clear();
|
mDynamicTextMenu->clear();
|
||||||
if ( mLayout )
|
if ( mLayout )
|
||||||
{
|
{
|
||||||
// we need to rebuild this on each show, as the content varies depending on other available items...
|
// we need to rebuild this on each show, as the content varies depending on other available items...
|
||||||
QgsLayoutLabelWidget::buildInsertDynamicTextMenu( mLayout, mDynamicTextMenu, [=]( const QString &expression ) {
|
QgsLayoutLabelWidget::buildInsertDynamicTextMenu( mLayout, mDynamicTextMenu, [this]( const QString &expression ) {
|
||||||
activateNewItemCreationTool( QgsGui::layoutItemGuiRegistry()->metadataIdForItemType( QgsLayoutItemRegistry::LayoutLabel ), false );
|
activateNewItemCreationTool( QgsGui::layoutItemGuiRegistry()->metadataIdForItemType( QgsLayoutItemRegistry::LayoutLabel ), false );
|
||||||
QVariantMap properties;
|
QVariantMap properties;
|
||||||
properties.insert( QStringLiteral( "expression" ), expression );
|
properties.insert( QStringLiteral( "expression" ), expression );
|
||||||
@ -574,28 +574,28 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mPanTool = new QgsLayoutViewToolPan( mView );
|
mPanTool = new QgsLayoutViewToolPan( mView );
|
||||||
mPanTool->setAction( mActionPan );
|
mPanTool->setAction( mActionPan );
|
||||||
mToolsActionGroup->addAction( mActionPan );
|
mToolsActionGroup->addAction( mActionPan );
|
||||||
connect( mActionPan, &QAction::triggered, mPanTool, [=] { mView->setTool( mPanTool ); } );
|
connect( mActionPan, &QAction::triggered, mPanTool, [this] { mView->setTool( mPanTool ); } );
|
||||||
mZoomTool = new QgsLayoutViewToolZoom( mView );
|
mZoomTool = new QgsLayoutViewToolZoom( mView );
|
||||||
mZoomTool->setAction( mActionZoomTool );
|
mZoomTool->setAction( mActionZoomTool );
|
||||||
mToolsActionGroup->addAction( mActionZoomTool );
|
mToolsActionGroup->addAction( mActionZoomTool );
|
||||||
connect( mActionZoomTool, &QAction::triggered, mZoomTool, [=] { mView->setTool( mZoomTool ); } );
|
connect( mActionZoomTool, &QAction::triggered, mZoomTool, [this] { mView->setTool( mZoomTool ); } );
|
||||||
mSelectTool = new QgsLayoutViewToolSelect( mView );
|
mSelectTool = new QgsLayoutViewToolSelect( mView );
|
||||||
mSelectTool->setAction( mActionSelectMoveItem );
|
mSelectTool->setAction( mActionSelectMoveItem );
|
||||||
mToolsActionGroup->addAction( mActionSelectMoveItem );
|
mToolsActionGroup->addAction( mActionSelectMoveItem );
|
||||||
connect( mActionSelectMoveItem, &QAction::triggered, mSelectTool, [=] { mView->setTool( mSelectTool ); } );
|
connect( mActionSelectMoveItem, &QAction::triggered, mSelectTool, [this] { mView->setTool( mSelectTool ); } );
|
||||||
// after creating an item with the add item tool, switch immediately to select tool
|
// after creating an item with the add item tool, switch immediately to select tool
|
||||||
connect( mAddItemTool, &QgsLayoutViewToolAddItem::createdItem, this, [=] { mView->setTool( mSelectTool ); } );
|
connect( mAddItemTool, &QgsLayoutViewToolAddItem::createdItem, this, [this] { mView->setTool( mSelectTool ); } );
|
||||||
connect( mAddNodeItemTool, &QgsLayoutViewToolAddNodeItem::createdItem, this, [=] { mView->setTool( mSelectTool ); } );
|
connect( mAddNodeItemTool, &QgsLayoutViewToolAddNodeItem::createdItem, this, [this] { mView->setTool( mSelectTool ); } );
|
||||||
|
|
||||||
mNodesTool = new QgsLayoutViewToolEditNodes( mView );
|
mNodesTool = new QgsLayoutViewToolEditNodes( mView );
|
||||||
mNodesTool->setAction( mActionEditNodesItem );
|
mNodesTool->setAction( mActionEditNodesItem );
|
||||||
mToolsActionGroup->addAction( mActionEditNodesItem );
|
mToolsActionGroup->addAction( mActionEditNodesItem );
|
||||||
connect( mActionEditNodesItem, &QAction::triggered, mNodesTool, [=] { mView->setTool( mNodesTool ); } );
|
connect( mActionEditNodesItem, &QAction::triggered, mNodesTool, [this] { mView->setTool( mNodesTool ); } );
|
||||||
|
|
||||||
mMoveContentTool = new QgsLayoutViewToolMoveItemContent( mView );
|
mMoveContentTool = new QgsLayoutViewToolMoveItemContent( mView );
|
||||||
mMoveContentTool->setAction( mActionMoveItemContent );
|
mMoveContentTool->setAction( mActionMoveItemContent );
|
||||||
mToolsActionGroup->addAction( mActionMoveItemContent );
|
mToolsActionGroup->addAction( mActionMoveItemContent );
|
||||||
connect( mActionMoveItemContent, &QAction::triggered, mMoveContentTool, [=] { mView->setTool( mMoveContentTool ); } );
|
connect( mActionMoveItemContent, &QAction::triggered, mMoveContentTool, [this] { mView->setTool( mMoveContentTool ); } );
|
||||||
|
|
||||||
//Ctrl+= should also trigger zoom in
|
//Ctrl+= should also trigger zoom in
|
||||||
QShortcut *ctrlEquals = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+=" ) ), this );
|
QShortcut *ctrlEquals = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+=" ) ), this );
|
||||||
@ -620,26 +620,26 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
|
|
||||||
|
|
||||||
mActionPreviewModeOff->setChecked( true );
|
mActionPreviewModeOff->setChecked( true );
|
||||||
connect( mActionPreviewModeOff, &QAction::triggered, this, [=] {
|
connect( mActionPreviewModeOff, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewModeEnabled( false );
|
mView->setPreviewModeEnabled( false );
|
||||||
} );
|
} );
|
||||||
connect( mActionPreviewModeMono, &QAction::triggered, this, [=] {
|
connect( mActionPreviewModeMono, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewMode( QgsPreviewEffect::PreviewMono );
|
mView->setPreviewMode( QgsPreviewEffect::PreviewMono );
|
||||||
mView->setPreviewModeEnabled( true );
|
mView->setPreviewModeEnabled( true );
|
||||||
} );
|
} );
|
||||||
connect( mActionPreviewModeGrayscale, &QAction::triggered, this, [=] {
|
connect( mActionPreviewModeGrayscale, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewMode( QgsPreviewEffect::PreviewGrayscale );
|
mView->setPreviewMode( QgsPreviewEffect::PreviewGrayscale );
|
||||||
mView->setPreviewModeEnabled( true );
|
mView->setPreviewModeEnabled( true );
|
||||||
} );
|
} );
|
||||||
connect( mActionPreviewProtanope, &QAction::triggered, this, [=] {
|
connect( mActionPreviewProtanope, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewMode( QgsPreviewEffect::PreviewProtanope );
|
mView->setPreviewMode( QgsPreviewEffect::PreviewProtanope );
|
||||||
mView->setPreviewModeEnabled( true );
|
mView->setPreviewModeEnabled( true );
|
||||||
} );
|
} );
|
||||||
connect( mActionPreviewDeuteranope, &QAction::triggered, this, [=] {
|
connect( mActionPreviewDeuteranope, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewMode( QgsPreviewEffect::PreviewDeuteranope );
|
mView->setPreviewMode( QgsPreviewEffect::PreviewDeuteranope );
|
||||||
mView->setPreviewModeEnabled( true );
|
mView->setPreviewModeEnabled( true );
|
||||||
} );
|
} );
|
||||||
connect( mActionPreviewTritanope, &QAction::triggered, this, [=] {
|
connect( mActionPreviewTritanope, &QAction::triggered, this, [this] {
|
||||||
mView->setPreviewMode( QgsPreviewEffect::PreviewTritanope );
|
mView->setPreviewMode( QgsPreviewEffect::PreviewTritanope );
|
||||||
mView->setPreviewModeEnabled( true );
|
mView->setPreviewModeEnabled( true );
|
||||||
} );
|
} );
|
||||||
@ -673,61 +673,61 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
connect( mActionLowerItems, &QAction::triggered, this, &QgsLayoutDesignerDialog::lowerSelectedItems );
|
connect( mActionLowerItems, &QAction::triggered, this, &QgsLayoutDesignerDialog::lowerSelectedItems );
|
||||||
connect( mActionMoveItemsToTop, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToTop );
|
connect( mActionMoveItemsToTop, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToTop );
|
||||||
connect( mActionMoveItemsToBottom, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToBottom );
|
connect( mActionMoveItemsToBottom, &QAction::triggered, this, &QgsLayoutDesignerDialog::moveSelectedItemsToBottom );
|
||||||
connect( mActionAlignLeft, &QAction::triggered, this, [=] {
|
connect( mActionAlignLeft, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignLeft );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignLeft );
|
||||||
} );
|
} );
|
||||||
connect( mActionAlignHCenter, &QAction::triggered, this, [=] {
|
connect( mActionAlignHCenter, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignHCenter );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignHCenter );
|
||||||
} );
|
} );
|
||||||
connect( mActionAlignRight, &QAction::triggered, this, [=] {
|
connect( mActionAlignRight, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignRight );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignRight );
|
||||||
} );
|
} );
|
||||||
connect( mActionAlignTop, &QAction::triggered, this, [=] {
|
connect( mActionAlignTop, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignTop );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignTop );
|
||||||
} );
|
} );
|
||||||
connect( mActionAlignVCenter, &QAction::triggered, this, [=] {
|
connect( mActionAlignVCenter, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignVCenter );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignVCenter );
|
||||||
} );
|
} );
|
||||||
connect( mActionAlignBottom, &QAction::triggered, this, [=] {
|
connect( mActionAlignBottom, &QAction::triggered, this, [this] {
|
||||||
mView->alignSelectedItems( QgsLayoutAligner::AlignBottom );
|
mView->alignSelectedItems( QgsLayoutAligner::AlignBottom );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeLeft, &QAction::triggered, this, [=] {
|
connect( mActionDistributeLeft, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeLeft );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeLeft );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeHCenter, &QAction::triggered, this, [=] {
|
connect( mActionDistributeHCenter, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHCenter );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHCenter );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeHSpace, &QAction::triggered, this, [=] {
|
connect( mActionDistributeHSpace, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHSpace );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeHSpace );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeRight, &QAction::triggered, this, [=] {
|
connect( mActionDistributeRight, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeRight );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeRight );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeTop, &QAction::triggered, this, [=] {
|
connect( mActionDistributeTop, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeTop );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeTop );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeVCenter, &QAction::triggered, this, [=] {
|
connect( mActionDistributeVCenter, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVCenter );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVCenter );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeVSpace, &QAction::triggered, this, [=] {
|
connect( mActionDistributeVSpace, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVSpace );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeVSpace );
|
||||||
} );
|
} );
|
||||||
connect( mActionDistributeBottom, &QAction::triggered, this, [=] {
|
connect( mActionDistributeBottom, &QAction::triggered, this, [this] {
|
||||||
mView->distributeSelectedItems( QgsLayoutAligner::DistributeBottom );
|
mView->distributeSelectedItems( QgsLayoutAligner::DistributeBottom );
|
||||||
} );
|
} );
|
||||||
connect( mActionResizeNarrowest, &QAction::triggered, this, [=] {
|
connect( mActionResizeNarrowest, &QAction::triggered, this, [this] {
|
||||||
mView->resizeSelectedItems( QgsLayoutAligner::ResizeNarrowest );
|
mView->resizeSelectedItems( QgsLayoutAligner::ResizeNarrowest );
|
||||||
} );
|
} );
|
||||||
connect( mActionResizeWidest, &QAction::triggered, this, [=] {
|
connect( mActionResizeWidest, &QAction::triggered, this, [this] {
|
||||||
mView->resizeSelectedItems( QgsLayoutAligner::ResizeWidest );
|
mView->resizeSelectedItems( QgsLayoutAligner::ResizeWidest );
|
||||||
} );
|
} );
|
||||||
connect( mActionResizeShortest, &QAction::triggered, this, [=] {
|
connect( mActionResizeShortest, &QAction::triggered, this, [this] {
|
||||||
mView->resizeSelectedItems( QgsLayoutAligner::ResizeShortest );
|
mView->resizeSelectedItems( QgsLayoutAligner::ResizeShortest );
|
||||||
} );
|
} );
|
||||||
connect( mActionResizeTallest, &QAction::triggered, this, [=] {
|
connect( mActionResizeTallest, &QAction::triggered, this, [this] {
|
||||||
mView->resizeSelectedItems( QgsLayoutAligner::ResizeTallest );
|
mView->resizeSelectedItems( QgsLayoutAligner::ResizeTallest );
|
||||||
} );
|
} );
|
||||||
connect( mActionResizeToSquare, &QAction::triggered, this, [=] {
|
connect( mActionResizeToSquare, &QAction::triggered, this, [this] {
|
||||||
mView->resizeSelectedItems( QgsLayoutAligner::ResizeToSquare );
|
mView->resizeSelectedItems( QgsLayoutAligner::ResizeToSquare );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -749,16 +749,16 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mActionHidePanels->setChecked( !docksTitle.isEmpty() );
|
mActionHidePanels->setChecked( !docksTitle.isEmpty() );
|
||||||
connect( mActionHidePanels, &QAction::toggled, this, &QgsLayoutDesignerDialog::setPanelVisibility );
|
connect( mActionHidePanels, &QAction::toggled, this, &QgsLayoutDesignerDialog::setPanelVisibility );
|
||||||
|
|
||||||
connect( mActionDeleteSelection, &QAction::triggered, this, [=] {
|
connect( mActionDeleteSelection, &QAction::triggered, this, [this] {
|
||||||
if ( mView->tool() == mNodesTool )
|
if ( mView->tool() == mNodesTool )
|
||||||
mNodesTool->deleteSelectedNode();
|
mNodesTool->deleteSelectedNode();
|
||||||
else
|
else
|
||||||
mView->deleteSelectedItems();
|
mView->deleteSelectedItems();
|
||||||
} );
|
} );
|
||||||
connect( mActionGroupItems, &QAction::triggered, this, [=] {
|
connect( mActionGroupItems, &QAction::triggered, this, [this] {
|
||||||
mView->groupSelectedItems();
|
mView->groupSelectedItems();
|
||||||
} );
|
} );
|
||||||
connect( mActionUngroupItems, &QAction::triggered, this, [=] {
|
connect( mActionUngroupItems, &QAction::triggered, this, [this] {
|
||||||
mView->ungroupSelectedItems();
|
mView->ungroupSelectedItems();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -768,7 +768,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mActionCut->setShortcuts( QKeySequence::Cut );
|
mActionCut->setShortcuts( QKeySequence::Cut );
|
||||||
mActionCut->setStatusTip( tr( "Cut" ) );
|
mActionCut->setStatusTip( tr( "Cut" ) );
|
||||||
mActionCut->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCut.svg" ) ) );
|
mActionCut->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCut.svg" ) ) );
|
||||||
connect( mActionCut, &QAction::triggered, this, [=] {
|
connect( mActionCut, &QAction::triggered, this, [this] {
|
||||||
mView->copySelectedItems( QgsLayoutView::ClipboardCut );
|
mView->copySelectedItems( QgsLayoutView::ClipboardCut );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -776,7 +776,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mActionCopy->setShortcuts( QKeySequence::Copy );
|
mActionCopy->setShortcuts( QKeySequence::Copy );
|
||||||
mActionCopy->setStatusTip( tr( "Copy" ) );
|
mActionCopy->setStatusTip( tr( "Copy" ) );
|
||||||
mActionCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCopy.svg" ) ) );
|
mActionCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionEditCopy.svg" ) ) );
|
||||||
connect( mActionCopy, &QAction::triggered, this, [=] {
|
connect( mActionCopy, &QAction::triggered, this, [this] {
|
||||||
mView->copySelectedItems( QgsLayoutView::ClipboardCopy );
|
mView->copySelectedItems( QgsLayoutView::ClipboardCopy );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -854,7 +854,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
connect( mHorizontalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
|
connect( mHorizontalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
|
||||||
connect( mVerticalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
|
connect( mVerticalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );
|
||||||
|
|
||||||
connect( mView, &QgsLayoutView::itemFocused, this, [=]( QgsLayoutItem *item ) {
|
connect( mView, &QgsLayoutView::itemFocused, this, [this]( QgsLayoutItem *item ) {
|
||||||
showItemOptions( item, false );
|
showItemOptions( item, false );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -880,7 +880,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mGeneralPropertiesStack = new QgsPanelWidgetStack();
|
mGeneralPropertiesStack = new QgsPanelWidgetStack();
|
||||||
mGeneralDock->setWidget( mGeneralPropertiesStack );
|
mGeneralDock->setWidget( mGeneralPropertiesStack );
|
||||||
mPanelsMenu->addAction( mGeneralDock->toggleViewAction() );
|
mPanelsMenu->addAction( mGeneralDock->toggleViewAction() );
|
||||||
connect( mActionLayoutProperties, &QAction::triggered, this, [=] {
|
connect( mActionLayoutProperties, &QAction::triggered, this, [this] {
|
||||||
mGeneralDock->setUserVisible( true );
|
mGeneralDock->setUserVisible( true );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -897,7 +897,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
|
|||||||
mGuideStack = new QgsPanelWidgetStack();
|
mGuideStack = new QgsPanelWidgetStack();
|
||||||
mGuideDock->setWidget( mGuideStack );
|
mGuideDock->setWidget( mGuideStack );
|
||||||
mPanelsMenu->addAction( mGuideDock->toggleViewAction() );
|
mPanelsMenu->addAction( mGuideDock->toggleViewAction() );
|
||||||
connect( mActionManageGuides, &QAction::triggered, this, [=] {
|
connect( mActionManageGuides, &QAction::triggered, this, [this] {
|
||||||
mGuideDock->setUserVisible( true );
|
mGuideDock->setUserVisible( true );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -1132,7 +1132,7 @@ void QgsLayoutDesignerDialog::setMasterLayout( QgsMasterLayoutInterface *layout
|
|||||||
|
|
||||||
QObject *obj = dynamic_cast<QObject *>( mMasterLayout );
|
QObject *obj = dynamic_cast<QObject *>( mMasterLayout );
|
||||||
if ( obj )
|
if ( obj )
|
||||||
connect( obj, &QObject::destroyed, this, [=] {
|
connect( obj, &QObject::destroyed, this, [this] {
|
||||||
this->close();
|
this->close();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -1241,7 +1241,7 @@ void QgsLayoutDesignerDialog::setCurrentLayout( QgsLayout *layout )
|
|||||||
mLayoutToolbar->addAction( mRedoAction );
|
mLayoutToolbar->addAction( mRedoAction );
|
||||||
|
|
||||||
connect( mLayout->undoStack(), &QgsLayoutUndoStack::undoRedoOccurredForItems, this, &QgsLayoutDesignerDialog::undoRedoOccurredForItems );
|
connect( mLayout->undoStack(), &QgsLayoutUndoStack::undoRedoOccurredForItems, this, &QgsLayoutDesignerDialog::undoRedoOccurredForItems );
|
||||||
connect( mActionClearGuides, &QAction::triggered, &mLayout->guides(), [=] {
|
connect( mActionClearGuides, &QAction::triggered, &mLayout->guides(), [this] {
|
||||||
mLayout->guides().clear();
|
mLayout->guides().clear();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -1370,7 +1370,7 @@ void QgsLayoutDesignerDialog::open()
|
|||||||
// zoomFull() does not work properly until window has fully shown.
|
// 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
|
// 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...!
|
// resized to its final size until a little later...!
|
||||||
QTimer::singleShot( 100, this, [=] {
|
QTimer::singleShot( 100, this, [this] {
|
||||||
mView->zoomFull();
|
mView->zoomFull();
|
||||||
mView->setPaintingEnabled( true );
|
mView->setPaintingEnabled( true );
|
||||||
} );
|
} );
|
||||||
@ -2061,7 +2061,7 @@ void QgsLayoutDesignerDialog::showManager()
|
|||||||
// NOTE: Avoid crash where composer that spawned modal manager from toolbar ends up
|
// 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
|
// 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)
|
// (does not seem to be an issue for menu action)
|
||||||
QTimer::singleShot( 0, this, [=] {
|
QTimer::singleShot( 0, this, [] {
|
||||||
QgisApp::instance()->showLayoutManager();
|
QgisApp::instance()->showLayoutManager();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -3977,7 +3977,7 @@ void QgsLayoutDesignerDialog::createAtlasWidget()
|
|||||||
|
|
||||||
mPanelsMenu->addAction( mAtlasDock->toggleViewAction() );
|
mPanelsMenu->addAction( mAtlasDock->toggleViewAction() );
|
||||||
|
|
||||||
connect( atlas, &QgsLayoutAtlas::messagePushed, mStatusBar, [=]( const QString &message ) {
|
connect( atlas, &QgsLayoutAtlas::messagePushed, mStatusBar, [this]( const QString &message ) {
|
||||||
mStatusBar->showMessage( message );
|
mStatusBar->showMessage( message );
|
||||||
} );
|
} );
|
||||||
connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutDesignerDialog::toggleAtlasControls );
|
connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutDesignerDialog::toggleAtlasControls );
|
||||||
|
@ -59,7 +59,7 @@ QgsLayoutManagerDialog::QgsLayoutManagerDialog( QWidget *parent, Qt::WindowFlags
|
|||||||
mTemplateFileWidget->setDefaultRoot( settings.value( QStringLiteral( "lastComposerTemplateDir" ), QString(), QgsSettings::App ).toString() );
|
mTemplateFileWidget->setDefaultRoot( settings.value( QStringLiteral( "lastComposerTemplateDir" ), QString(), QgsSettings::App ).toString() );
|
||||||
mTemplateFileWidget->setFilePath( settings.value( QStringLiteral( "ComposerManager/templatePath" ), QString(), QgsSettings::App ).toString() );
|
mTemplateFileWidget->setFilePath( settings.value( QStringLiteral( "ComposerManager/templatePath" ), QString(), QgsSettings::App ).toString() );
|
||||||
|
|
||||||
connect( mTemplateFileWidget, &QgsFileWidget::fileChanged, this, [=] {
|
connect( mTemplateFileWidget, &QgsFileWidget::fileChanged, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "ComposerManager/templatePath" ), mTemplateFileWidget->filePath(), QgsSettings::App );
|
settings.setValue( QStringLiteral( "ComposerManager/templatePath" ), mTemplateFileWidget->filePath(), QgsSettings::App );
|
||||||
QFileInfo tmplFileInfo( mTemplateFileWidget->filePath() );
|
QFileInfo tmplFileInfo( mTemplateFileWidget->filePath() );
|
||||||
|
@ -116,7 +116,7 @@ void QgsReportOrganizerWidget::removeSection()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
std::function<void( QgsAbstractReportSection * section )> cleanup;
|
std::function<void( QgsAbstractReportSection * section )> cleanup;
|
||||||
cleanup = [=, &cleanup]( QgsAbstractReportSection *section ) {
|
cleanup = [this, &cleanup]( QgsAbstractReportSection *section ) {
|
||||||
if ( mDesigner->currentLayout() == section->header() || mDesigner->currentLayout() == section->footer() )
|
if ( mDesigner->currentLayout() == section->header() || mDesigner->currentLayout() == section->footer() )
|
||||||
mDesigner->setCurrentLayout( nullptr );
|
mDesigner->setCurrentLayout( nullptr );
|
||||||
if ( section->type() == QLatin1String( "SectionFieldGroup" ) )
|
if ( section->type() == QLatin1String( "SectionFieldGroup" ) )
|
||||||
|
@ -108,7 +108,7 @@ QWidget *QgsLocatorFiltersModel::configButton( const QModelIndex &index, QWidget
|
|||||||
layout->addWidget( bt );
|
layout->addWidget( bt );
|
||||||
w->setLayout( layout );
|
w->setLayout( layout );
|
||||||
|
|
||||||
connect( bt, &QToolButton::clicked, this, [=]() { filter->openConfigWidget( bt ); } );
|
connect( bt, &QToolButton::clicked, this, [filter, bt]() { filter->openConfigWidget( bt ); } );
|
||||||
bt->setMaximumSize( mIconSize, mIconSize );
|
bt->setMaximumSize( mIconSize, mIconSize );
|
||||||
bt->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
bt->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||||
bt->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/settings.svg" ) ) );
|
bt->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/settings.svg" ) ) );
|
||||||
|
@ -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." ) );
|
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( tr( "The Nominatim geocoder data is made available by OpenStreetMap Foundation and contributors." ) );
|
||||||
QPushButton *learnMoreButton = new QPushButton( tr( "Learn more" ) );
|
QPushButton *learnMoreButton = new QPushButton( tr( "Learn more" ) );
|
||||||
connect( learnMoreButton, &QPushButton::clicked, learnMoreButton, [=] {
|
connect( learnMoreButton, &QPushButton::clicked, learnMoreButton, [] {
|
||||||
QDesktopServices::openUrl( QStringLiteral( "https://nominatim.org/" ) );
|
QDesktopServices::openUrl( QStringLiteral( "https://nominatim.org/" ) );
|
||||||
} );
|
} );
|
||||||
messageWidget->layout()->addWidget( learnMoreButton );
|
messageWidget->layout()->addWidget( learnMoreButton );
|
||||||
|
@ -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." ) );
|
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" ) );
|
QPushButton *restoreButton = new QPushButton( tr( "Restore others" ) );
|
||||||
QPointer<QgsVectorLayer> layerPtr( layer );
|
QPointer<QgsVectorLayer> layerPtr( layer );
|
||||||
connect( restoreButton, &QPushButton::clicked, restoreButton, [=] {
|
connect( restoreButton, &QPushButton::clicked, restoreButton, [layerPtr, removedFeatures] {
|
||||||
if ( !layerPtr )
|
if ( !layerPtr )
|
||||||
return;
|
return;
|
||||||
layerPtr->beginEditCommand( tr( "Restored geometry parts removed by avoid overlaps" ) );
|
layerPtr->beginEditCommand( tr( "Restored geometry parts removed by avoid overlaps" ) );
|
||||||
|
@ -74,7 +74,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupToolBars()
|
|||||||
actionGroup->addAction( it.value() );
|
actionGroup->addAction( it.value() );
|
||||||
}
|
}
|
||||||
QgisApp::instance()->mActionStreamDigitize->setShortcut( tr( "R", "Keyboard shortcut: toggle stream digitizing" ) );
|
QgisApp::instance()->mActionStreamDigitize->setShortcut( tr( "R", "Keyboard shortcut: toggle stream digitizing" ) );
|
||||||
connect( digitizeMenu, &QMenu::triggered, this, [=]( QAction *action ) {
|
connect( digitizeMenu, &QMenu::triggered, this, [this]( QAction *action ) {
|
||||||
Qgis::CaptureTechnique technique = mTechniqueActions.key( action, Qgis::CaptureTechnique::StraightSegments );
|
Qgis::CaptureTechnique technique = mTechniqueActions.key( action, Qgis::CaptureTechnique::StraightSegments );
|
||||||
if ( mDigitizeModeToolButton->defaultAction() != action )
|
if ( mDigitizeModeToolButton->defaultAction() != action )
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupToolBars()
|
|||||||
shapeButton->setMenu( new QMenu() );
|
shapeButton->setMenu( new QMenu() );
|
||||||
|
|
||||||
QgisApp::instance()->mShapeDigitizeToolBar->addWidget( shapeButton );
|
QgisApp::instance()->mShapeDigitizeToolBar->addWidget( shapeButton );
|
||||||
QObject::connect( shapeButton, &QToolButton::triggered, this, [=]( QAction *action ) { setShapeTool( action->data().toString() ); } );
|
QObject::connect( shapeButton, &QToolButton::triggered, this, [this]( QAction *action ) { setShapeTool( action->data().toString() ); } );
|
||||||
|
|
||||||
mShapeCategoryButtons.insert( metadata->category(), shapeButton );
|
mShapeCategoryButtons.insert( metadata->category(), shapeButton );
|
||||||
}
|
}
|
||||||
@ -245,7 +245,7 @@ void QgsMapToolsDigitizingTechniqueManager::setupTool( QgsMapToolCapture *tool )
|
|||||||
}
|
}
|
||||||
|
|
||||||
mInitializedTools.insert( tool );
|
mInitializedTools.insert( tool );
|
||||||
connect( tool, &QObject::destroyed, this, [=] {
|
connect( tool, &QObject::destroyed, this, [this, tool] {
|
||||||
mInitializedTools.remove( tool );
|
mInitializedTools.remove( tool );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@ QgsStreamDigitizingSettingsAction::QgsStreamDigitizingSettingsAction( QWidget *p
|
|||||||
QLabel *label = new QLabel( tr( "Streaming Tolerance" ) );
|
QLabel *label = new QLabel( tr( "Streaming Tolerance" ) );
|
||||||
gLayout->addWidget( label, 1, 0 );
|
gLayout->addWidget( label, 1, 0 );
|
||||||
gLayout->addWidget( mStreamToleranceSpinBox, 1, 1 );
|
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 );
|
QgsSettingsRegistryCore::settingsDigitizingStreamTolerance->setValue( value );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ QgsMeshCalculatorDialog::QgsMeshCalculatorDialog( QgsMeshLayer *meshLayer, QgsMa
|
|||||||
|
|
||||||
repopulateTimeCombos();
|
repopulateTimeCombos();
|
||||||
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
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" ) );
|
QgsHelp::openHelp( QStringLiteral( "working_with_mesh/mesh_properties.html#mesh-calculator" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ QgsMeshElevationPropertiesWidget::QgsMeshElevationPropertiesWidget( QgsMeshLayer
|
|||||||
connect( mElevationLimitSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, &QgsMeshElevationPropertiesWidget::onChanged );
|
connect( mElevationLimitSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, &QgsMeshElevationPropertiesWidget::onChanged );
|
||||||
connect( mLineStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
|
connect( mLineStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
|
||||||
connect( mFillStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
|
connect( mFillStyleButton, &QgsSymbolButton::changed, this, &QgsMeshElevationPropertiesWidget::onChanged );
|
||||||
connect( mStyleComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
|
connect( mStyleComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
|
||||||
switch ( static_cast<Qgis::ProfileSurfaceSymbology>( mStyleComboBox->currentData().toInt() ) )
|
switch ( static_cast<Qgis::ProfileSurfaceSymbology>( mStyleComboBox->currentData().toInt() ) )
|
||||||
{
|
{
|
||||||
case Qgis::ProfileSurfaceSymbology::Line:
|
case Qgis::ProfileSurfaceSymbology::Line:
|
||||||
|
@ -57,11 +57,11 @@ QgsMeshTransformCoordinatesDockWidget::QgsMeshTransformCoordinatesDockWidget( QW
|
|||||||
connect( mButtonApply, &QPushButton::clicked, this, &QgsMeshTransformCoordinatesDockWidget::apply );
|
connect( mButtonApply, &QPushButton::clicked, this, &QgsMeshTransformCoordinatesDockWidget::apply );
|
||||||
connect( mButtonImport, &QToolButton::toggled, this, &QgsMeshTransformCoordinatesDockWidget::onImportVertexClicked );
|
connect( mButtonImport, &QToolButton::toggled, this, &QgsMeshTransformCoordinatesDockWidget::onImportVertexClicked );
|
||||||
|
|
||||||
connect( mCheckBoxZ, &QCheckBox::toggled, this, [=]( const bool checked ) {
|
connect( mCheckBoxZ, &QCheckBox::toggled, this, [this]( const bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
mCheckBoxZFromProjectTerrain->setChecked( false );
|
mCheckBoxZFromProjectTerrain->setChecked( false );
|
||||||
} );
|
} );
|
||||||
connect( mCheckBoxZFromProjectTerrain, &QCheckBox::toggled, this, [=]( const bool checked ) {
|
connect( mCheckBoxZFromProjectTerrain, &QCheckBox::toggled, this, [this]( const bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
mCheckBoxZ->setChecked( false );
|
mCheckBoxZ->setChecked( false );
|
||||||
} );
|
} );
|
||||||
|
@ -69,7 +69,7 @@ QgsNewMeshLayerDialog::QgsNewMeshLayerDialog( QWidget *parent, Qt::WindowFlags f
|
|||||||
connect( mMeshFromFileWidget, &QgsFileWidget::fileChanged, this, &QgsNewMeshLayerDialog::updateDialog );
|
connect( mMeshFromFileWidget, &QgsFileWidget::fileChanged, this, &QgsNewMeshLayerDialog::updateDialog );
|
||||||
connect( mMeshProjectComboBox, &QgsMapLayerComboBox::layerChanged, 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" ) );
|
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#creating-a-new-mesh-layer" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ QgsAdvancedSettingsWidget::QgsAdvancedSettingsWidget( QWidget *parent )
|
|||||||
{
|
{
|
||||||
createSettingsTreeWidget( true, true, true );
|
createSettingsTreeWidget( true, true, true );
|
||||||
|
|
||||||
connect( mAdvancedSettingsEnableButton, &QPushButton::clicked, this, [=] {
|
connect( mAdvancedSettingsEnableButton, &QPushButton::clicked, this, [this] {
|
||||||
settingsUseNewTreeWidget->setValue( mUseNewSettingsTree->isChecked() );
|
settingsUseNewTreeWidget->setValue( mUseNewSettingsTree->isChecked() );
|
||||||
mAdvancedSettingsWarning->hide();
|
mAdvancedSettingsWarning->hide();
|
||||||
if ( settingsUseNewTreeWidget->value() )
|
if ( settingsUseNewTreeWidget->value() )
|
||||||
|
@ -114,7 +114,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
|
|||||||
mColorSchemeComboBox->setCurrentIndex( mColorSchemeComboBox->findData( QStringLiteral( "custom" ) ) );
|
mColorSchemeComboBox->setCurrentIndex( mColorSchemeComboBox->findData( QStringLiteral( "custom" ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mColorSchemeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
|
connect( mColorSchemeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
|
||||||
const QString theme = mColorSchemeComboBox->currentData().toString();
|
const QString theme = mColorSchemeComboBox->currentData().toString();
|
||||||
if ( theme != QLatin1String( "custom" ) )
|
if ( theme != QLatin1String( "custom" ) )
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
|
|||||||
|
|
||||||
for ( auto it = mColorButtonMap.constBegin(); it != mColorButtonMap.constEnd(); ++it )
|
for ( auto it = mColorButtonMap.constBegin(); it != mColorButtonMap.constEnd(); ++it )
|
||||||
{
|
{
|
||||||
connect( it.value(), &QgsColorButton::colorChanged, this, [=] {
|
connect( it.value(), &QgsColorButton::colorChanged, this, [this] {
|
||||||
if ( mBlockCustomColorChange )
|
if ( mBlockCustomColorChange )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -147,13 +147,13 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
|
|||||||
mSizeSpin->setValue( font.pointSize() );
|
mSizeSpin->setValue( font.pointSize() );
|
||||||
mOverrideFontGroupBox->setChecked( !settings.value( QStringLiteral( "codeEditor/fontfamily" ), QString(), QgsSettings::Gui ).toString().isEmpty() );
|
mOverrideFontGroupBox->setChecked( !settings.value( QStringLiteral( "codeEditor/fontfamily" ), QString(), QgsSettings::Gui ).toString().isEmpty() );
|
||||||
|
|
||||||
connect( mFontComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
|
connect( mFontComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
|
||||||
updatePreview();
|
updatePreview();
|
||||||
} );
|
} );
|
||||||
connect( mSizeSpin, qOverload<int>( &QSpinBox::valueChanged ), this, [=] {
|
connect( mSizeSpin, qOverload<int>( &QSpinBox::valueChanged ), this, [this] {
|
||||||
updatePreview();
|
updatePreview();
|
||||||
} );
|
} );
|
||||||
connect( mOverrideFontGroupBox, &QGroupBox::toggled, this, [=] {
|
connect( mOverrideFontGroupBox, &QGroupBox::toggled, this, [this] {
|
||||||
updatePreview();
|
updatePreview();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
|
|||||||
mListLanguage->addItem( tr( "Bash" ) );
|
mListLanguage->addItem( tr( "Bash" ) );
|
||||||
mListLanguage->addItem( tr( "Batch" ) );
|
mListLanguage->addItem( tr( "Batch" ) );
|
||||||
|
|
||||||
connect( mListLanguage, &QListWidget::currentRowChanged, this, [=] {
|
connect( mListLanguage, &QListWidget::currentRowChanged, this, [this] {
|
||||||
mPreviewStackedWidget->setCurrentIndex( mListLanguage->currentRow() );
|
mPreviewStackedWidget->setCurrentIndex( mListLanguage->currentRow() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ QgsCustomProjectionOptionsWidget::QgsCustomProjectionOptionsWidget( QWidget *par
|
|||||||
leNameList->hideColumn( QgisCrsIdColumn );
|
leNameList->hideColumn( QgisCrsIdColumn );
|
||||||
|
|
||||||
connect( leName, &QLineEdit::textChanged, this, &QgsCustomProjectionOptionsWidget::updateListFromCurrentItem );
|
connect( leName, &QLineEdit::textChanged, this, &QgsCustomProjectionOptionsWidget::updateListFromCurrentItem );
|
||||||
connect( mCrsDefinitionWidget, &QgsCrsDefinitionWidget::crsChanged, this, [=] {
|
connect( mCrsDefinitionWidget, &QgsCrsDefinitionWidget::crsChanged, this, [this] {
|
||||||
if ( !mBlockUpdates )
|
if ( !mBlockUpdates )
|
||||||
updateListFromCurrentItem();
|
updateListFromCurrentItem();
|
||||||
} );
|
} );
|
||||||
|
@ -47,13 +47,13 @@ QgsFontOptionsWidget::QgsFontOptionsWidget( QWidget *parent )
|
|||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mButtonAddReplacement, &QToolButton::clicked, this, [=] {
|
connect( mButtonAddReplacement, &QToolButton::clicked, this, [this] {
|
||||||
mTableReplacements->setRowCount( mTableReplacements->rowCount() + 1 );
|
mTableReplacements->setRowCount( mTableReplacements->rowCount() + 1 );
|
||||||
mTableReplacements->setFocus();
|
mTableReplacements->setFocus();
|
||||||
mTableReplacements->setCurrentCell( mTableReplacements->rowCount() - 1, 0 );
|
mTableReplacements->setCurrentCell( mTableReplacements->rowCount() - 1, 0 );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mButtonRemoveReplacement, &QToolButton::clicked, this, [=] {
|
connect( mButtonRemoveReplacement, &QToolButton::clicked, this, [this] {
|
||||||
const QModelIndexList selection = mTableReplacements->selectionModel()->selectedRows();
|
const QModelIndexList selection = mTableReplacements->selectionModel()->selectedRows();
|
||||||
QList<int> selectedRows;
|
QList<int> selectedRows;
|
||||||
for ( const QModelIndex &index : selection )
|
for ( const QModelIndex &index : selection )
|
||||||
@ -86,7 +86,7 @@ QgsFontOptionsWidget::QgsFontOptionsWidget( QWidget *parent )
|
|||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mButtonRemoveUserFont, &QToolButton::clicked, this, [=] {
|
connect( mButtonRemoveUserFont, &QToolButton::clicked, this, [this] {
|
||||||
const QModelIndexList selection = mTableUserFonts->selectionModel()->selectedRows();
|
const QModelIndexList selection = mTableUserFonts->selectionModel()->selectedRows();
|
||||||
QList<int> selectedRows;
|
QList<int> selectedRows;
|
||||||
for ( const QModelIndex &index : selection )
|
for ( const QModelIndex &index : selection )
|
||||||
|
@ -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
|
// 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
|
// 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)
|
// (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();
|
const QString driver = changedItem->data( 0, Qt::UserRole ).toString();
|
||||||
for ( int i = 0; i < otherTree->topLevelItemCount(); ++i )
|
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, [=]( QTreeWidgetItem *item, int ) {
|
connect( lstRasterDrivers, &QTreeWidget::itemChanged, this, [this, syncItem]( QTreeWidgetItem *item, int ) {
|
||||||
syncItem( item, lstVectorDrivers );
|
syncItem( item, lstVectorDrivers );
|
||||||
} );
|
} );
|
||||||
connect( lstVectorDrivers, &QTreeWidget::itemChanged, this, [=]( QTreeWidgetItem *item, int ) {
|
connect( lstVectorDrivers, &QTreeWidget::itemChanged, this, [this, syncItem]( QTreeWidgetItem *item, int ) {
|
||||||
syncItem( item, lstRasterDrivers );
|
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( mCustomVariablesChkBx, &QCheckBox::toggled, this, &QgsOptions::mCustomVariablesChkBx_toggled );
|
||||||
connect( mCurrentVariablesQGISChxBx, &QCheckBox::toggled, this, &QgsOptions::mCurrentVariablesQGISChxBx_toggled );
|
connect( mCurrentVariablesQGISChxBx, &QCheckBox::toggled, this, &QgsOptions::mCurrentVariablesQGISChxBx_toggled );
|
||||||
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOptions::showHelp );
|
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOptions::showHelp );
|
||||||
connect( cboGlobalLocale, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=]( int ) { updateSampleLocaleText(); } );
|
connect( cboGlobalLocale, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this]( int ) { updateSampleLocaleText(); } );
|
||||||
connect( cbShowGroupSeparator, &QCheckBox::toggled, this, [=]( bool ) { updateSampleLocaleText(); } );
|
connect( cbShowGroupSeparator, &QCheckBox::toggled, this, [this]( bool ) { updateSampleLocaleText(); } );
|
||||||
|
|
||||||
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
|
// 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),
|
// 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
|
// disconnect default connection setup by initOptionsBase for accepting dialog, and insert logic
|
||||||
// to validate widgets before allowing dialog to be closed
|
// to validate widgets before allowing dialog to be closed
|
||||||
disconnect( mOptButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
|
disconnect( mOptButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
|
||||||
connect( mOptButtonBox, &QDialogButtonBox::accepted, this, [=] {
|
connect( mOptButtonBox, &QDialogButtonBox::accepted, this, [this] {
|
||||||
for ( QgsOptionsPageWidget *widget : std::as_const( mAdditionalOptionWidgets ) )
|
for ( QgsOptionsPageWidget *widget : std::as_const( mAdditionalOptionWidgets ) )
|
||||||
{
|
{
|
||||||
if ( !widget->isValid() )
|
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() );
|
mAutoClearAccessCache->setChecked( mSettings->value( QStringLiteral( "clear_auth_cache_on_errors" ), true, QgsSettings::Section::Auth ).toBool() );
|
||||||
connect( mClearAccessCache, &QAbstractButton::clicked, this, &QgsOptions::clearAccessCache );
|
connect( mClearAccessCache, &QAbstractButton::clicked, this, &QgsOptions::clearAccessCache );
|
||||||
|
|
||||||
connect( mAutoClearAccessCache, &QCheckBox::clicked, this, [=]( bool checked ) {
|
connect( mAutoClearAccessCache, &QCheckBox::clicked, this, [this]( bool checked ) {
|
||||||
mSettings->setValue( QStringLiteral( "clear_auth_cache_on_errors" ), checked, QgsSettings::Section::Auth );
|
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( mButtonImportColors, &QAbstractButton::clicked, mTreeCustomColors, &QgsColorSchemeList::showImportColorsDialog );
|
||||||
connect( mButtonExportColors, &QAbstractButton::clicked, mTreeCustomColors, &QgsColorSchemeList::showExportColorsDialog );
|
connect( mButtonExportColors, &QAbstractButton::clicked, mTreeCustomColors, &QgsColorSchemeList::showExportColorsDialog );
|
||||||
|
|
||||||
connect( mActionImportPalette, &QAction::triggered, this, [=] {
|
connect( mActionImportPalette, &QAction::triggered, this, [this] {
|
||||||
if ( QgsCompoundColorWidget::importUserPaletteFromFile( this ) )
|
if ( QgsCompoundColorWidget::importUserPaletteFromFile( this ) )
|
||||||
{
|
{
|
||||||
//refresh combobox
|
//refresh combobox
|
||||||
@ -894,7 +894,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
|||||||
mColorSchemesComboBox->setCurrentIndex( mColorSchemesComboBox->count() - 1 );
|
mColorSchemesComboBox->setCurrentIndex( mColorSchemesComboBox->count() - 1 );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
connect( mActionRemovePalette, &QAction::triggered, this, [=] {
|
connect( mActionRemovePalette, &QAction::triggered, this, [this] {
|
||||||
//get current scheme
|
//get current scheme
|
||||||
QList<QgsColorScheme *> schemeList = QgsApplication::colorSchemeRegistry()->schemes();
|
QList<QgsColorScheme *> schemeList = QgsApplication::colorSchemeRegistry()->schemes();
|
||||||
int prevIndex = mColorSchemesComboBox->currentIndex();
|
int prevIndex = mColorSchemesComboBox->currentIndex();
|
||||||
@ -917,7 +917,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
|||||||
mColorSchemesComboBox->setCurrentIndex( prevIndex );
|
mColorSchemesComboBox->setCurrentIndex( prevIndex );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
connect( mActionNewPalette, &QAction::triggered, this, [=] {
|
connect( mActionNewPalette, &QAction::triggered, this, [this] {
|
||||||
if ( QgsCompoundColorWidget::createNewUserPalette( this ) )
|
if ( QgsCompoundColorWidget::createNewUserPalette( this ) )
|
||||||
{
|
{
|
||||||
//refresh combobox
|
//refresh combobox
|
||||||
@ -926,7 +926,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mActionShowInButtons, &QAction::toggled, this, [=]( bool state ) {
|
connect( mActionShowInButtons, &QAction::toggled, this, [this]( bool state ) {
|
||||||
QgsUserColorScheme *scheme = dynamic_cast<QgsUserColorScheme *>( mTreeCustomColors->scheme() );
|
QgsUserColorScheme *scheme = dynamic_cast<QgsUserColorScheme *>( mTreeCustomColors->scheme() );
|
||||||
if ( 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() ) );
|
mColorSchemesComboBox->setCurrentIndex( mColorSchemesComboBox->findText( customSchemes.at( 0 )->schemeName() ) );
|
||||||
updateActionsForCurrentColorScheme( customSchemes.at( 0 ) );
|
updateActionsForCurrentColorScheme( customSchemes.at( 0 ) );
|
||||||
}
|
}
|
||||||
connect( mColorSchemesComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int index ) {
|
connect( mColorSchemesComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this]( int index ) {
|
||||||
//save changes to scheme
|
//save changes to scheme
|
||||||
if ( mTreeCustomColors->isDirty() )
|
if ( mTreeCustomColors->isDirty() )
|
||||||
{
|
{
|
||||||
@ -1221,7 +1221,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
|
|||||||
|
|
||||||
// Setup OpenCL Acceleration widget
|
// Setup OpenCL Acceleration widget
|
||||||
|
|
||||||
connect( mGPUEnableCheckBox, &QCheckBox::toggled, this, [=]( bool checked ) {
|
connect( mGPUEnableCheckBox, &QCheckBox::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
// Since this may crash and lock users out of the settings, let's disable opencl setting before entering
|
// 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 ) );
|
mOpenClDevicesCombo->addItem( QgsOpenClUtils::deviceInfo( QgsOpenClUtils::Info::Name, dev ), QgsOpenClUtils::deviceId( dev ) );
|
||||||
}
|
}
|
||||||
// Info updater
|
// Info updater
|
||||||
std::function<void( int )> infoUpdater = [=]( int ) {
|
std::function<void( int )> infoUpdater = [this]( int ) {
|
||||||
mGPUInfoTextBrowser->setText( QgsOpenClUtils::deviceDescription( mOpenClDevicesCombo->currentData().toString() ) );
|
mGPUInfoTextBrowser->setText( QgsOpenClUtils::deviceDescription( mOpenClDevicesCombo->currentData().toString() ) );
|
||||||
};
|
};
|
||||||
connect( mOpenClDevicesCombo, qOverload<int>( &QComboBox::currentIndexChanged ), infoUpdater );
|
connect( mOpenClDevicesCombo, qOverload<int>( &QComboBox::currentIndexChanged ), infoUpdater );
|
||||||
|
@ -59,7 +59,7 @@ QgsProjectElevationSettingsWidget::QgsProjectElevationSettingsWidget( QWidget *p
|
|||||||
mStackedWidget->setSizeMode( QgsStackedWidget::SizeMode::CurrentPageOnly );
|
mStackedWidget->setSizeMode( QgsStackedWidget::SizeMode::CurrentPageOnly );
|
||||||
|
|
||||||
mStackedWidget->setCurrentWidget( mPageFlat );
|
mStackedWidget->setCurrentWidget( mPageFlat );
|
||||||
connect( mComboTerrainType, qOverload<int>( &QComboBox::currentIndexChanged ), this, [=] {
|
connect( mComboTerrainType, qOverload<int>( &QComboBox::currentIndexChanged ), this, [this] {
|
||||||
const QString terrainType = mComboTerrainType->currentData().toString();
|
const QString terrainType = mComboTerrainType->currentData().toString();
|
||||||
if ( terrainType == QLatin1String( "flat" ) )
|
if ( terrainType == QLatin1String( "flat" ) )
|
||||||
{
|
{
|
||||||
|
@ -849,7 +849,7 @@ void QgisApp::annotationItemTypeAdded( int id )
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect( tool->mapTool(), &QgsMapTool::deactivated, tool->mapTool(), &QObject::deleteLater );
|
connect( tool->mapTool(), &QgsMapTool::deactivated, tool->mapTool(), &QObject::deleteLater );
|
||||||
connect( tool->handler(), &QgsCreateAnnotationItemMapToolHandler::itemCreated, this, [=] {
|
connect( tool->handler(), &QgsCreateAnnotationItemMapToolHandler::itemCreated, this, [this, tool] {
|
||||||
QgsAnnotationItem *item = tool->handler()->takeCreatedItem();
|
QgsAnnotationItem *item = tool->handler()->takeCreatedItem();
|
||||||
QgsAnnotationLayer *targetLayer = qobject_cast<QgsAnnotationLayer *>( activeLayer() );
|
QgsAnnotationLayer *targetLayer = qobject_cast<QgsAnnotationLayer *>( activeLayer() );
|
||||||
if ( !targetLayer )
|
if ( !targetLayer )
|
||||||
@ -1217,7 +1217,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
showBookmarksDock->setWhatsThis( tr( "Show Bookmarks Panel" ) );
|
showBookmarksDock->setWhatsThis( tr( "Show Bookmarks Panel" ) );
|
||||||
mBookMarksDockWidget->setToggleVisibilityAction( mActionShowBookmarkManager );
|
mBookMarksDockWidget->setToggleVisibilityAction( mActionShowBookmarkManager );
|
||||||
|
|
||||||
connect( mActionShowBookmarks, &QAction::triggered, this, [=] { showBookmarks(); } );
|
connect( mActionShowBookmarks, &QAction::triggered, this, [this] { showBookmarks(); } );
|
||||||
|
|
||||||
endProfile();
|
endProfile();
|
||||||
|
|
||||||
@ -1346,7 +1346,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
mMapStyleWidget = new QgsLayerStylingWidget( mMapCanvas, mInfoBar, mMapLayerPanelFactories );
|
mMapStyleWidget = new QgsLayerStylingWidget( mMapCanvas, mInfoBar, mMapLayerPanelFactories );
|
||||||
mMapStylingDock->setWidget( mMapStyleWidget );
|
mMapStylingDock->setWidget( mMapStyleWidget );
|
||||||
connect( mMapStyleWidget, &QgsLayerStylingWidget::styleChanged, this, &QgisApp::updateLabelToolButtons );
|
connect( mMapStyleWidget, &QgsLayerStylingWidget::styleChanged, this, &QgisApp::updateLabelToolButtons );
|
||||||
connect( mMapStyleWidget, &QgsLayerStylingWidget::layerStyleChanged, this, [=]( const QString &styleName ) {
|
connect( mMapStyleWidget, &QgsLayerStylingWidget::layerStyleChanged, this, [this]( const QString &styleName ) {
|
||||||
if ( !QgsMapLayerStyleManager::isDefault( styleName ) && !styleName.isEmpty() )
|
if ( !QgsMapLayerStyleManager::isDefault( styleName ) && !styleName.isEmpty() )
|
||||||
{
|
{
|
||||||
mMapStylingDock->setWindowTitle( tr( "Layer Styling (%1)" ).arg( styleName ) );
|
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" ) );
|
startProfile( tr( "Snapping dialog" ) );
|
||||||
mSnappingDialog = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, this );
|
mSnappingDialog = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, this );
|
||||||
connect( mSnappingDialog, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [=] { QgsProject::instance()->setSnappingConfig( mSnappingDialog->config() ); } );
|
connect( mSnappingDialog, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [this] { QgsProject::instance()->setSnappingConfig( mSnappingDialog->config() ); } );
|
||||||
QString mainSnappingWidgetMode = QgsSettings().value( QStringLiteral( "/qgis/mainSnappingWidgetMode" ), "dialog" ).toString();
|
QString mainSnappingWidgetMode = QgsSettings().value( QStringLiteral( "/qgis/mainSnappingWidgetMode" ), "dialog" ).toString();
|
||||||
if ( mainSnappingWidgetMode == QLatin1String( "dock" ) )
|
if ( mainSnappingWidgetMode == QLatin1String( "dock" ) )
|
||||||
{
|
{
|
||||||
@ -1448,11 +1448,11 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget );
|
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget );
|
||||||
mBrowserWidget->hide();
|
mBrowserWidget->hide();
|
||||||
// Only connect the first widget: the model is shared, there is no need to refresh multiple times.
|
// Only connect the first widget: the model is shared, there is no need to refresh multiple times.
|
||||||
connect( this, &QgisApp::connectionsChanged, mBrowserWidget, [=] {
|
connect( this, &QgisApp::connectionsChanged, mBrowserWidget, [this] {
|
||||||
if ( !mBlockBrowser1Refresh && !mBlockBrowser2Refresh )
|
if ( !mBlockBrowser1Refresh && !mBlockBrowser2Refresh )
|
||||||
mBrowserWidget->refresh();
|
mBrowserWidget->refresh();
|
||||||
} );
|
} );
|
||||||
connect( mBrowserWidget, &QgsBrowserDockWidget::connectionsChanged, this, [=] {
|
connect( mBrowserWidget, &QgsBrowserDockWidget::connectionsChanged, this, [this] {
|
||||||
mBlockBrowser1Refresh++;
|
mBlockBrowser1Refresh++;
|
||||||
emit connectionsChanged();
|
emit connectionsChanged();
|
||||||
mBlockBrowser1Refresh--;
|
mBlockBrowser1Refresh--;
|
||||||
@ -1464,7 +1464,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
mBrowserWidget2->setObjectName( QStringLiteral( "Browser2" ) );
|
mBrowserWidget2->setObjectName( QStringLiteral( "Browser2" ) );
|
||||||
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget2 );
|
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget2 );
|
||||||
mBrowserWidget2->hide();
|
mBrowserWidget2->hide();
|
||||||
connect( mBrowserWidget2, &QgsBrowserDockWidget::connectionsChanged, this, [=] {
|
connect( mBrowserWidget2, &QgsBrowserDockWidget::connectionsChanged, this, [this] {
|
||||||
mBlockBrowser2Refresh++;
|
mBlockBrowser2Refresh++;
|
||||||
emit connectionsChanged();
|
emit connectionsChanged();
|
||||||
mBlockBrowser2Refresh--;
|
mBlockBrowser2Refresh--;
|
||||||
@ -1510,7 +1510,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::nmeaLogFileChanged, mGpsLogging, &QgsAppGpsLogging::setNmeaLogFile );
|
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::nmeaLogFileChanged, mGpsLogging, &QgsAppGpsLogging::setNmeaLogFile );
|
||||||
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::gpkgLogDestinationChanged, mGpsLogging, &QgsAppGpsLogging::setGpkgLogFile );
|
connect( mGpsSettingsMenu, &QgsAppGpsSettingsMenu::gpkgLogDestinationChanged, mGpsLogging, &QgsAppGpsLogging::setGpkgLogFile );
|
||||||
connect( mGpsLogging, &QgsAppGpsLogging::gpkgLoggingFailed, mGpsSettingsMenu, &QgsAppGpsSettingsMenu::onGpkgLoggingFailed );
|
connect( mGpsLogging, &QgsAppGpsLogging::gpkgLoggingFailed, mGpsSettingsMenu, &QgsAppGpsSettingsMenu::onGpkgLoggingFailed );
|
||||||
connect( mGpsDigitizing, &QgsAppGpsDigitizing::trackIsEmptyChanged, mGpsToolBar, [=]( bool isEmpty ) { mGpsToolBar->setResetTrackButtonEnabled( !isEmpty ); } );
|
connect( mGpsDigitizing, &QgsAppGpsDigitizing::trackIsEmptyChanged, mGpsToolBar, [this]( bool isEmpty ) { mGpsToolBar->setResetTrackButtonEnabled( !isEmpty ); } );
|
||||||
|
|
||||||
mpGpsWidget = new QgsGpsInformationWidget( mGpsConnection, mMapCanvas, mGpsDigitizing );
|
mpGpsWidget = new QgsGpsInformationWidget( mGpsConnection, mMapCanvas, mGpsDigitizing );
|
||||||
QgsPanelWidgetStack *gpsStack = new QgsPanelWidgetStack();
|
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 );
|
// QgsMessageLog::logMessage( tr( "QGIS starting…" ), QString(), Qgis::MessageLevel::Info );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, [=] { setTitleBarText_( *this ); } );
|
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, [this] { setTitleBarText_( *this ); } );
|
||||||
|
|
||||||
// set QGIS specific srs validation
|
// set QGIS specific srs validation
|
||||||
connect( this, &QgisApp::customCrsValidation, this, &QgisApp::validateCrs );
|
connect( this, &QgisApp::customCrsValidation, this, &QgisApp::validateCrs );
|
||||||
@ -1594,7 +1594,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
new QgsCredentialDialog( this );
|
new QgsCredentialDialog( this );
|
||||||
|
|
||||||
mLocatorWidget->setMapCanvas( mMapCanvas );
|
mLocatorWidget->setMapCanvas( mMapCanvas );
|
||||||
connect( mLocatorWidget, &QgsLocatorWidget::configTriggered, this, [=] { showOptionsDialog( this, QStringLiteral( "mOptionsLocatorSettings" ) ); } );
|
connect( mLocatorWidget, &QgsLocatorWidget::configTriggered, this, [this] { showOptionsDialog( this, QStringLiteral( "mOptionsLocatorSettings" ) ); } );
|
||||||
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
@ -1863,7 +1863,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
QgsGui::shortcutsManager()->registerAllChildren( mSnappingWidget );
|
QgsGui::shortcutsManager()->registerAllChildren( mSnappingWidget );
|
||||||
|
|
||||||
// register additional action
|
// register additional action
|
||||||
auto registerShortcuts = [=]( const QString &sequence, const QString &objectName, const QString &whatsThis ) {
|
auto registerShortcuts = [this]( const QString &sequence, const QString &objectName, const QString &whatsThis ) {
|
||||||
QShortcut *sc = new QShortcut( QKeySequence( sequence ), this );
|
QShortcut *sc = new QShortcut( QKeySequence( sequence ), this );
|
||||||
sc->setContext( Qt::ApplicationShortcut );
|
sc->setContext( Qt::ApplicationShortcut );
|
||||||
sc->setObjectName( objectName );
|
sc->setObjectName( objectName );
|
||||||
@ -1929,13 +1929,13 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
|
|
||||||
mStartupProfilerWidgetFactory.reset( std::make_unique<QgsProfilerWidgetFactory>( profiler ) );
|
mStartupProfilerWidgetFactory.reset( std::make_unique<QgsProfilerWidgetFactory>( profiler ) );
|
||||||
|
|
||||||
auto toggleRevert = [=] {
|
auto toggleRevert = [this] {
|
||||||
mActionRevertProject->setEnabled( QgsProject::instance()->isDirty() && !QgsProject::instance()->fileName().isEmpty() );
|
mActionRevertProject->setEnabled( QgsProject::instance()->isDirty() && !QgsProject::instance()->fileName().isEmpty() );
|
||||||
};
|
};
|
||||||
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, mActionRevertProject, toggleRevert );
|
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, mActionRevertProject, toggleRevert );
|
||||||
connect( QgsProject::instance(), &QgsProject::fileNameChanged, mActionRevertProject, toggleRevert );
|
connect( QgsProject::instance(), &QgsProject::fileNameChanged, mActionRevertProject, toggleRevert );
|
||||||
|
|
||||||
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [=] {
|
connect( QgsProject::instance()->displaySettings(), &QgsProjectDisplaySettings::bearingFormatChanged, this, [this] {
|
||||||
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
|
mBearingNumericFormat.reset( QgsProject::instance()->displaySettings()->bearingFormat()->clone() );
|
||||||
} );
|
} );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::panDistanceBearingChanged, this, &QgisApp::showPanMessage );
|
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 = new QgsAppCanvasFiltering( this );
|
||||||
mAppCanvasFiltering->setupElevationControllerAction( mActionElevationController, mMapCanvas );
|
mAppCanvasFiltering->setupElevationControllerAction( mActionElevationController, mMapCanvas );
|
||||||
|
|
||||||
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloaded, this, [=]( const QStringList &families, const QString &licenseDetails ) {
|
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloaded, this, [this]( const QStringList &families, const QString &licenseDetails ) {
|
||||||
const QString shortMessage = tr( "Installed font %1" ).arg( families.join( QLatin1String( ", " ) ) );
|
const QString shortMessage = tr( "Installed font %1" ).arg( families.join( QLatin1String( ", " ) ) );
|
||||||
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
|
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
|
||||||
if ( !licenseDetails.isEmpty() )
|
if ( !licenseDetails.isEmpty() )
|
||||||
@ -1992,7 +1992,7 @@ QgisApp::QgisApp( QSplashScreen *splash, AppOptions options, const QString &root
|
|||||||
canvas->refreshAllLayers();
|
canvas->refreshAllLayers();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloadErrorOccurred, this, [=]( const QUrl &, const QString &identifier, const QString &error ) {
|
connect( QgsApplication::fontManager(), &QgsFontManager::fontDownloadErrorOccurred, this, [this]( const QUrl &, const QString &identifier, const QString &error ) {
|
||||||
const QString shortMessage = identifier.isEmpty() ? tr( "Font installation failed" )
|
const QString shortMessage = identifier.isEmpty() ? tr( "Font installation failed" )
|
||||||
: tr( "%1 font installation failed" ).arg( identifier );
|
: tr( "%1 font installation failed" ).arg( identifier );
|
||||||
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
|
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( QString(), shortMessage );
|
||||||
@ -2426,10 +2426,10 @@ QList<QgsMapLayer *> QgisApp::handleDropUriList( const QgsMimeDataUtils::UriList
|
|||||||
QgsScopedProxyProgressTask task( tr( "Loading layers" ) );
|
QgsScopedProxyProgressTask task( tr( "Loading layers" ) );
|
||||||
|
|
||||||
|
|
||||||
auto showLayerLoadWarnings = [=]( const QString &title, const QString &shortMessage, const QString &longMessage, Qgis::MessageLevel level ) {
|
auto showLayerLoadWarnings = [this]( const QString &title, const QString &shortMessage, const QString &longMessage, Qgis::MessageLevel level ) {
|
||||||
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( title, shortMessage );
|
QgsMessageBarItem *messageWidget = QgsMessageBar::createMessage( title, shortMessage );
|
||||||
QPushButton *detailsButton = new QPushButton( tr( "Details" ) );
|
QPushButton *detailsButton = new QPushButton( tr( "Details" ) );
|
||||||
connect( detailsButton, &QPushButton::clicked, this, [=] {
|
connect( detailsButton, &QPushButton::clicked, this, [title, longMessage] {
|
||||||
if ( QgsMessageViewer *dialog = dynamic_cast<QgsMessageViewer *>( QgsMessageOutput::createMessageOutput() ) )
|
if ( QgsMessageViewer *dialog = dynamic_cast<QgsMessageViewer *>( QgsMessageOutput::createMessageOutput() ) )
|
||||||
{
|
{
|
||||||
dialog->setTitle( title );
|
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;
|
bool ok = false;
|
||||||
QList<QgsMapLayer *> addedLayers = QgsAppLayerHandling::addGdalRasterLayers( layersList, ok );
|
QList<QgsMapLayer *> addedLayers = QgsAppLayerHandling::addGdalRasterLayers( layersList, ok );
|
||||||
if ( ok )
|
if ( ok )
|
||||||
@ -2890,15 +2890,15 @@ void QgisApp::createActions()
|
|||||||
|
|
||||||
// Project Menu Items
|
// Project Menu Items
|
||||||
|
|
||||||
connect( mActionNewProject, &QAction::triggered, this, [=] { fileNew(); } );
|
connect( mActionNewProject, &QAction::triggered, this, [this] { fileNew(); } );
|
||||||
connect( mActionNewBlankProject, &QAction::triggered, this, &QgisApp::fileNewBlank );
|
connect( mActionNewBlankProject, &QAction::triggered, this, &QgisApp::fileNewBlank );
|
||||||
connect( mActionOpenProject, &QAction::triggered, this, &QgisApp::fileOpen );
|
connect( mActionOpenProject, &QAction::triggered, this, &QgisApp::fileOpen );
|
||||||
connect( mActionRevertProject, &QAction::triggered, this, &QgisApp::fileRevert );
|
connect( mActionRevertProject, &QAction::triggered, this, &QgisApp::fileRevert );
|
||||||
connect( mActionSaveProject, &QAction::triggered, this, &QgisApp::fileSave );
|
connect( mActionSaveProject, &QAction::triggered, this, &QgisApp::fileSave );
|
||||||
connect( mActionCloseProject, &QAction::triggered, this, &QgisApp::fileClose );
|
connect( mActionCloseProject, &QAction::triggered, this, &QgisApp::fileClose );
|
||||||
connect( mActionSaveProjectAs, &QAction::triggered, this, &QgisApp::fileSaveAs );
|
connect( mActionSaveProjectAs, &QAction::triggered, this, &QgisApp::fileSaveAs );
|
||||||
connect( mActionSaveMapAsImage, &QAction::triggered, this, [=] { saveMapAsImage(); } );
|
connect( mActionSaveMapAsImage, &QAction::triggered, this, [this] { saveMapAsImage(); } );
|
||||||
connect( mActionSaveMapAsPdf, &QAction::triggered, this, [=] { saveMapAsPdf(); } );
|
connect( mActionSaveMapAsPdf, &QAction::triggered, this, [this] { saveMapAsPdf(); } );
|
||||||
connect( mActionNewMapCanvas, &QAction::triggered, this, &QgisApp::newMapCanvas );
|
connect( mActionNewMapCanvas, &QAction::triggered, this, &QgisApp::newMapCanvas );
|
||||||
connect( mActionNew3DMapCanvas, &QAction::triggered, this, &QgisApp::new3DMapCanvas );
|
connect( mActionNew3DMapCanvas, &QAction::triggered, this, &QgisApp::new3DMapCanvas );
|
||||||
connect( mActionNew3DMapCanvasGlobe, &QAction::triggered, this, &QgisApp::new3DMapCanvasGlobe );
|
connect( mActionNew3DMapCanvasGlobe, &QAction::triggered, this, &QgisApp::new3DMapCanvasGlobe );
|
||||||
@ -2913,13 +2913,13 @@ void QgisApp::createActions()
|
|||||||
|
|
||||||
connect( mActionUndo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::undo );
|
connect( mActionUndo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::undo );
|
||||||
connect( mActionRedo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::redo );
|
connect( mActionRedo, &QAction::triggered, mUndoWidget, &QgsUndoWidget::redo );
|
||||||
connect( mActionCutFeatures, &QAction::triggered, this, [=] { cutSelectionToClipboard(); } );
|
connect( mActionCutFeatures, &QAction::triggered, this, [this] { cutSelectionToClipboard(); } );
|
||||||
connect( mActionCopyFeatures, &QAction::triggered, this, [=] { copySelectionToClipboard(); } );
|
connect( mActionCopyFeatures, &QAction::triggered, this, [this] { copySelectionToClipboard(); } );
|
||||||
connect( mActionPasteFeatures, &QAction::triggered, this, [=] { pasteFromClipboard(); } );
|
connect( mActionPasteFeatures, &QAction::triggered, this, [this] { pasteFromClipboard(); } );
|
||||||
connect( mActionPasteAsNewVector, &QAction::triggered, this, &QgisApp::pasteAsNewVector );
|
connect( mActionPasteAsNewVector, &QAction::triggered, this, &QgisApp::pasteAsNewVector );
|
||||||
connect( mActionPasteAsNewMemoryVector, &QAction::triggered, this, [=] { pasteAsNewMemoryVector(); } );
|
connect( mActionPasteAsNewMemoryVector, &QAction::triggered, this, [this] { pasteAsNewMemoryVector(); } );
|
||||||
connect( mActionCopyStyle, &QAction::triggered, this, [=] { copyStyle(); } );
|
connect( mActionCopyStyle, &QAction::triggered, this, [this] { copyStyle(); } );
|
||||||
connect( mActionPasteStyle, &QAction::triggered, this, [=] { applyStyleToGroup(); } );
|
connect( mActionPasteStyle, &QAction::triggered, this, [this] { applyStyleToGroup(); } );
|
||||||
connect( mActionCopyLayer, &QAction::triggered, this, &QgisApp::copyLayer );
|
connect( mActionCopyLayer, &QAction::triggered, this, &QgisApp::copyLayer );
|
||||||
connect( mActionPasteLayer, &QAction::triggered, this, &QgisApp::pasteLayer );
|
connect( mActionPasteLayer, &QAction::triggered, this, &QgisApp::pasteLayer );
|
||||||
connect( mActionAddFeature, &QAction::triggered, this, &QgisApp::addFeature );
|
connect( mActionAddFeature, &QAction::triggered, this, &QgisApp::addFeature );
|
||||||
@ -2931,7 +2931,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionReshapeFeatures, &QAction::triggered, this, &QgisApp::reshapeFeatures );
|
connect( mActionReshapeFeatures, &QAction::triggered, this, &QgisApp::reshapeFeatures );
|
||||||
connect( mActionSplitFeatures, &QAction::triggered, this, &QgisApp::splitFeatures );
|
connect( mActionSplitFeatures, &QAction::triggered, this, &QgisApp::splitFeatures );
|
||||||
connect( mActionSplitParts, &QAction::triggered, this, &QgisApp::splitParts );
|
connect( mActionSplitParts, &QAction::triggered, this, &QgisApp::splitParts );
|
||||||
connect( mActionDeleteSelected, &QAction::triggered, this, [=] { deleteSelected( nullptr, nullptr, true ); } );
|
connect( mActionDeleteSelected, &QAction::triggered, this, [this] { deleteSelected( nullptr, nullptr, true ); } );
|
||||||
connect( mActionAddRing, &QAction::triggered, this, &QgisApp::addRing );
|
connect( mActionAddRing, &QAction::triggered, this, &QgisApp::addRing );
|
||||||
connect( mActionFillRing, &QAction::triggered, this, &QgisApp::fillRing );
|
connect( mActionFillRing, &QAction::triggered, this, &QgisApp::fillRing );
|
||||||
connect( mActionAddPart, &QAction::triggered, this, &QgisApp::addPart );
|
connect( mActionAddPart, &QAction::triggered, this, &QgisApp::addPart );
|
||||||
@ -2948,7 +2948,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionSnappingOptions, &QAction::triggered, this, &QgisApp::snappingOptions );
|
connect( mActionSnappingOptions, &QAction::triggered, this, &QgisApp::snappingOptions );
|
||||||
connect( mActionOffsetCurve, &QAction::triggered, this, &QgisApp::offsetCurve );
|
connect( mActionOffsetCurve, &QAction::triggered, this, &QgisApp::offsetCurve );
|
||||||
connect( mActionReverseLine, &QAction::triggered, this, &QgisApp::reverseLine );
|
connect( mActionReverseLine, &QAction::triggered, this, &QgisApp::reverseLine );
|
||||||
connect( mActionTrimExtendFeature, &QAction::triggered, this, [=] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::TrimExtendFeature ) ); } );
|
connect( mActionTrimExtendFeature, &QAction::triggered, this, [this] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::TrimExtendFeature ) ); } );
|
||||||
|
|
||||||
// View Menu Items
|
// View Menu Items
|
||||||
connect( mActionPan, &QAction::triggered, this, &QgisApp::pan );
|
connect( mActionPan, &QAction::triggered, this, &QgisApp::pan );
|
||||||
@ -2962,7 +2962,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionDeselectAll, &QAction::triggered, this, &QgisApp::deselectAll );
|
connect( mActionDeselectAll, &QAction::triggered, this, &QgisApp::deselectAll );
|
||||||
connect( mActionDeselectActiveLayer, &QAction::triggered, this, &QgisApp::deselectActiveLayer );
|
connect( mActionDeselectActiveLayer, &QAction::triggered, this, &QgisApp::deselectActiveLayer );
|
||||||
connect( mActionSelectAll, &QAction::triggered, this, &QgisApp::selectAll );
|
connect( mActionSelectAll, &QAction::triggered, this, &QgisApp::selectAll );
|
||||||
connect( mActionReselect, &QAction::triggered, this, [=] {
|
connect( mActionReselect, &QAction::triggered, this, [this] {
|
||||||
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
|
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
|
||||||
if ( !vlayer )
|
if ( !vlayer )
|
||||||
{
|
{
|
||||||
@ -2984,7 +2984,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionMeasure, &QAction::triggered, this, &QgisApp::measure );
|
connect( mActionMeasure, &QAction::triggered, this, &QgisApp::measure );
|
||||||
connect( mActionMeasureArea, &QAction::triggered, this, &QgisApp::measureArea );
|
connect( mActionMeasureArea, &QAction::triggered, this, &QgisApp::measureArea );
|
||||||
connect( mActionMeasureAngle, &QAction::triggered, this, &QgisApp::measureAngle );
|
connect( mActionMeasureAngle, &QAction::triggered, this, &QgisApp::measureAngle );
|
||||||
connect( mActionMeasureBearing, &QAction::triggered, this, [=] { setMapTool( mMapTools->mapTool( QgsAppMapTools::MeasureBearing ) ); } );
|
connect( mActionMeasureBearing, &QAction::triggered, this, [this] { setMapTool( mMapTools->mapTool( QgsAppMapTools::MeasureBearing ) ); } );
|
||||||
connect( mActionZoomFullExtent, &QAction::triggered, this, &QgisApp::zoomFull );
|
connect( mActionZoomFullExtent, &QAction::triggered, this, &QgisApp::zoomFull );
|
||||||
connect( mActionZoomToLayer, &QAction::triggered, this, &QgisApp::zoomToLayerExtent );
|
connect( mActionZoomToLayer, &QAction::triggered, this, &QgisApp::zoomToLayerExtent );
|
||||||
connect( mActionZoomToLayers, &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( mActionZoomNext, &QAction::triggered, this, &QgisApp::zoomToNext );
|
||||||
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
|
connect( mActionZoomActualSize, &QAction::triggered, this, &QgisApp::zoomActualSize );
|
||||||
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
|
connect( mActionMapTips, &QAction::toggled, this, &QgisApp::toggleMapTips );
|
||||||
connect( mActionNewBookmark, &QAction::triggered, this, [=] { newBookmark( true ); } );
|
connect( mActionNewBookmark, &QAction::triggered, this, [this] { newBookmark( true ); } );
|
||||||
connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } );
|
connect( mActionDraw, &QAction::triggered, this, [this] { refreshMapCanvas( true ); } );
|
||||||
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
|
connect( mActionFormAnnotation, &QAction::triggered, this, &QgisApp::addFormAnnotation );
|
||||||
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
|
connect( mActionHtmlAnnotation, &QAction::triggered, this, &QgisApp::addHtmlAnnotation );
|
||||||
@ -3004,7 +3004,7 @@ void QgisApp::createActions()
|
|||||||
|
|
||||||
// Layer Menu Items
|
// Layer Menu Items
|
||||||
|
|
||||||
connect( mActionDataSourceManager, &QAction::triggered, this, [=]() { dataSourceManager(); } );
|
connect( mActionDataSourceManager, &QAction::triggered, this, [this]() { dataSourceManager(); } );
|
||||||
connect( mActionNewVectorLayer, &QAction::triggered, this, &QgisApp::newVectorLayer );
|
connect( mActionNewVectorLayer, &QAction::triggered, this, &QgisApp::newVectorLayer );
|
||||||
#ifdef HAVE_SPATIALITE
|
#ifdef HAVE_SPATIALITE
|
||||||
connect( mActionNewSpatiaLiteLayer, &QAction::triggered, this, &QgisApp::newSpatialiteLayer );
|
connect( mActionNewSpatiaLiteLayer, &QAction::triggered, this, &QgisApp::newSpatialiteLayer );
|
||||||
@ -3018,56 +3018,56 @@ void QgisApp::createActions()
|
|||||||
connect( mActionShowMeshCalculator, &QAction::triggered, this, &QgisApp::showMeshCalculator );
|
connect( mActionShowMeshCalculator, &QAction::triggered, this, &QgisApp::showMeshCalculator );
|
||||||
connect( mActionEmbedLayers, &QAction::triggered, this, &QgisApp::embedLayers );
|
connect( mActionEmbedLayers, &QAction::triggered, this, &QgisApp::embedLayers );
|
||||||
connect( mActionAddLayerDefinition, &QAction::triggered, this, &QgisApp::addLayerDefinition );
|
connect( mActionAddLayerDefinition, &QAction::triggered, this, &QgisApp::addLayerDefinition );
|
||||||
connect( mActionAddOgrLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "ogr" ) ); } );
|
connect( mActionAddOgrLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "ogr" ) ); } );
|
||||||
connect( mActionAddRasterLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "gdal" ) ); } );
|
connect( mActionAddRasterLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "gdal" ) ); } );
|
||||||
connect( mActionAddMeshLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "mdal" ) ); } );
|
connect( mActionAddMeshLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "mdal" ) ); } );
|
||||||
connect( mActionAddPgLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "postgres" ) ); } );
|
connect( mActionAddPgLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "postgres" ) ); } );
|
||||||
#ifdef HAVE_SPATIALITE
|
#ifdef HAVE_SPATIALITE
|
||||||
connect( mActionAddSpatiaLiteLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "spatialite" ) ); } );
|
connect( mActionAddSpatiaLiteLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "spatialite" ) ); } );
|
||||||
#endif
|
#endif
|
||||||
connect( mActionAddMssqlLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "mssql" ) ); } );
|
connect( mActionAddMssqlLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "mssql" ) ); } );
|
||||||
connect( mActionAddOracleLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "oracle" ) ); } );
|
connect( mActionAddOracleLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "oracle" ) ); } );
|
||||||
connect( mActionAddHanaLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "hana" ) ); } );
|
connect( mActionAddHanaLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "hana" ) ); } );
|
||||||
connect( mActionAddWmsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "wms" ) ); } );
|
connect( mActionAddWmsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "wms" ) ); } );
|
||||||
connect( mActionAddXyzLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
|
connect( mActionAddXyzLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
|
||||||
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
|
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
|
||||||
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
|
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
|
||||||
connect( mActionAddGpsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "gpx" ) ); } );
|
connect( mActionAddGpsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "gpx" ) ); } );
|
||||||
connect( mActionAddWcsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
|
connect( mActionAddWcsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
|
||||||
connect( mActionAddStacLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "stac" ) ); } );
|
connect( mActionAddStacLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "stac" ) ); } );
|
||||||
#ifdef HAVE_SPATIALITE
|
#ifdef HAVE_SPATIALITE
|
||||||
connect( mActionAddWfsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
|
connect( mActionAddWfsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
|
||||||
#endif
|
#endif
|
||||||
connect( mActionAddAfsLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
|
connect( mActionAddAfsLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
|
||||||
connect( mActionAddDelimitedText, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "delimitedtext" ) ); } );
|
connect( mActionAddDelimitedText, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "delimitedtext" ) ); } );
|
||||||
connect( mActionAddVirtualLayer, &QAction::triggered, this, [=] { dataSourceManager( QStringLiteral( "virtual" ) ); } );
|
connect( mActionAddVirtualLayer, &QAction::triggered, this, [this] { dataSourceManager( QStringLiteral( "virtual" ) ); } );
|
||||||
connect( mActionOpenTable, &QAction::triggered, this, [=] {
|
connect( mActionOpenTable, &QAction::triggered, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
|
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
|
||||||
attributeTable( initialMode );
|
attributeTable( initialMode );
|
||||||
} );
|
} );
|
||||||
connect( mActionOpenTableSelected, &QAction::triggered, this, [=] {
|
connect( mActionOpenTableSelected, &QAction::triggered, this, [this] {
|
||||||
attributeTable( QgsAttributeTableFilterModel::ShowSelected );
|
attributeTable( QgsAttributeTableFilterModel::ShowSelected );
|
||||||
} );
|
} );
|
||||||
connect( mActionOpenTableVisible, &QAction::triggered, this, [=] {
|
connect( mActionOpenTableVisible, &QAction::triggered, this, [this] {
|
||||||
attributeTable( QgsAttributeTableFilterModel::ShowVisible );
|
attributeTable( QgsAttributeTableFilterModel::ShowVisible );
|
||||||
} );
|
} );
|
||||||
connect( mActionOpenTableEdited, &QAction::triggered, this, [=] {
|
connect( mActionOpenTableEdited, &QAction::triggered, this, [this] {
|
||||||
attributeTable( QgsAttributeTableFilterModel::ShowEdited );
|
attributeTable( QgsAttributeTableFilterModel::ShowEdited );
|
||||||
} );
|
} );
|
||||||
connect( mActionOpenFieldCalc, &QAction::triggered, this, &QgisApp::fieldCalculator );
|
connect( mActionOpenFieldCalc, &QAction::triggered, this, &QgisApp::fieldCalculator );
|
||||||
connect( mActionToggleEditing, &QAction::triggered, this, [=] { toggleEditing(); } );
|
connect( mActionToggleEditing, &QAction::triggered, this, [this] { toggleEditing(); } );
|
||||||
connect( mActionSaveLayerEdits, &QAction::triggered, this, &QgisApp::saveActiveLayerEdits );
|
connect( mActionSaveLayerEdits, &QAction::triggered, this, &QgisApp::saveActiveLayerEdits );
|
||||||
connect( mActionSaveEdits, &QAction::triggered, this, [=] { saveEdits(); } );
|
connect( mActionSaveEdits, &QAction::triggered, this, [this] { saveEdits(); } );
|
||||||
connect( mActionSaveAllEdits, &QAction::triggered, this, [=] { saveAllEdits(); } );
|
connect( mActionSaveAllEdits, &QAction::triggered, this, [this] { saveAllEdits(); } );
|
||||||
connect( mActionRollbackEdits, &QAction::triggered, this, &QgisApp::rollbackEdits );
|
connect( mActionRollbackEdits, &QAction::triggered, this, &QgisApp::rollbackEdits );
|
||||||
connect( mActionRollbackAllEdits, &QAction::triggered, this, [=] { rollbackAllEdits(); } );
|
connect( mActionRollbackAllEdits, &QAction::triggered, this, [this] { rollbackAllEdits(); } );
|
||||||
connect( mActionCancelEdits, &QAction::triggered, this, [=] { cancelEdits(); } );
|
connect( mActionCancelEdits, &QAction::triggered, this, [this] { cancelEdits(); } );
|
||||||
connect( mActionCancelAllEdits, &QAction::triggered, this, [=] { cancelAllEdits(); } );
|
connect( mActionCancelAllEdits, &QAction::triggered, this, [this] { cancelAllEdits(); } );
|
||||||
connect( mActionLayerSaveAs, &QAction::triggered, this, [=] { saveAsFile(); } );
|
connect( mActionLayerSaveAs, &QAction::triggered, this, [this] { saveAsFile(); } );
|
||||||
connect( mActionSaveLayerDefinition, &QAction::triggered, this, &QgisApp::saveAsLayerDefinition );
|
connect( mActionSaveLayerDefinition, &QAction::triggered, this, &QgisApp::saveAsLayerDefinition );
|
||||||
connect( mActionRemoveLayer, &QAction::triggered, this, &QgisApp::removeLayer );
|
connect( mActionRemoveLayer, &QAction::triggered, this, &QgisApp::removeLayer );
|
||||||
connect( mActionDuplicateLayer, &QAction::triggered, this, [=] { duplicateLayers(); } );
|
connect( mActionDuplicateLayer, &QAction::triggered, this, [this] { duplicateLayers(); } );
|
||||||
connect( mActionSetLayerScaleVisibility, &QAction::triggered, this, &QgisApp::setLayerScaleVisibility );
|
connect( mActionSetLayerScaleVisibility, &QAction::triggered, this, &QgisApp::setLayerScaleVisibility );
|
||||||
connect( mActionSetLayerCRS, &QAction::triggered, this, &QgisApp::setLayerCrs );
|
connect( mActionSetLayerCRS, &QAction::triggered, this, &QgisApp::setLayerCrs );
|
||||||
connect( mActionSetProjectCRSFromLayer, &QAction::triggered, this, &QgisApp::setProjectCrsFromLayer );
|
connect( mActionSetProjectCRSFromLayer, &QAction::triggered, this, &QgisApp::setProjectCrsFromLayer );
|
||||||
@ -3094,7 +3094,7 @@ void QgisApp::createActions()
|
|||||||
connect( mActionToggleFullScreen, &QAction::triggered, this, &QgisApp::toggleFullScreen );
|
connect( mActionToggleFullScreen, &QAction::triggered, this, &QgisApp::toggleFullScreen );
|
||||||
connect( mActionTogglePanelsVisibility, &QAction::triggered, this, &QgisApp::togglePanelsVisibility );
|
connect( mActionTogglePanelsVisibility, &QAction::triggered, this, &QgisApp::togglePanelsVisibility );
|
||||||
connect( mActionToggleMapOnly, &QAction::triggered, this, &QgisApp::toggleMapOnly );
|
connect( mActionToggleMapOnly, &QAction::triggered, this, &QgisApp::toggleMapOnly );
|
||||||
connect( mActionProjectProperties, &QAction::triggered, this, [=] { projectProperties( QString() ); } );
|
connect( mActionProjectProperties, &QAction::triggered, this, [this] { projectProperties( QString() ); } );
|
||||||
connect( mActionOptions, &QAction::triggered, this, &QgisApp::options );
|
connect( mActionOptions, &QAction::triggered, this, &QgisApp::options );
|
||||||
connect( mActionCustomProjection, &QAction::triggered, this, &QgisApp::customProjection );
|
connect( mActionCustomProjection, &QAction::triggered, this, &QgisApp::customProjection );
|
||||||
connect( mActionConfigureShortcuts, &QAction::triggered, this, &QgisApp::configureShortcuts );
|
connect( mActionConfigureShortcuts, &QAction::triggered, this, &QgisApp::configureShortcuts );
|
||||||
@ -3175,13 +3175,13 @@ void QgisApp::createActions()
|
|||||||
connect( mActionSponsors, &QAction::triggered, this, &QgisApp::sponsors );
|
connect( mActionSponsors, &QAction::triggered, this, &QgisApp::sponsors );
|
||||||
|
|
||||||
connect( mActionShowPinnedLabels, &QAction::toggled, this, &QgisApp::showPinnedLabels );
|
connect( mActionShowPinnedLabels, &QAction::toggled, this, &QgisApp::showPinnedLabels );
|
||||||
connect( mActionShowUnplacedLabels, &QAction::toggled, this, [=]( bool active ) {
|
connect( mActionShowUnplacedLabels, &QAction::toggled, this, [this]( bool active ) {
|
||||||
QgsLabelingEngineSettings engineSettings = QgsProject::instance()->labelingEngineSettings();
|
QgsLabelingEngineSettings engineSettings = QgsProject::instance()->labelingEngineSettings();
|
||||||
engineSettings.setFlag( Qgis::LabelingFlag::DrawUnplacedLabels, active );
|
engineSettings.setFlag( Qgis::LabelingFlag::DrawUnplacedLabels, active );
|
||||||
QgsProject::instance()->setLabelingEngineSettings( engineSettings );
|
QgsProject::instance()->setLabelingEngineSettings( engineSettings );
|
||||||
refreshMapCanvas( true );
|
refreshMapCanvas( true );
|
||||||
} );
|
} );
|
||||||
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, this, [this] {
|
||||||
whileBlocking( mActionShowUnplacedLabels )->setChecked( QgsProject::instance()->labelingEngineSettings().testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) );
|
whileBlocking( mActionShowUnplacedLabels )->setChecked( QgsProject::instance()->labelingEngineSettings().testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) );
|
||||||
} );
|
} );
|
||||||
connect( mActionPinLabels, &QAction::triggered, this, &QgisApp::pinLabels );
|
connect( mActionPinLabels, &QAction::triggered, this, &QgisApp::pinLabels );
|
||||||
@ -3193,8 +3193,8 @@ void QgisApp::createActions()
|
|||||||
connect( mActionDiagramProperties, &QAction::triggered, this, &QgisApp::diagramProperties );
|
connect( mActionDiagramProperties, &QAction::triggered, this, &QgisApp::diagramProperties );
|
||||||
|
|
||||||
connect( mActionCreateAnnotationLayer, &QAction::triggered, this, &QgisApp::createAnnotationLayer );
|
connect( mActionCreateAnnotationLayer, &QAction::triggered, this, &QgisApp::createAnnotationLayer );
|
||||||
connect( mActionModifyAnnotation, &QAction::triggered, this, [=] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::AnnotationEdit ) ); } );
|
connect( mActionModifyAnnotation, &QAction::triggered, this, [this] { mMapCanvas->setMapTool( mMapTools->mapTool( QgsAppMapTools::AnnotationEdit ) ); } );
|
||||||
connect( mMainAnnotationLayerProperties, &QAction::triggered, this, [=] {
|
connect( mMainAnnotationLayerProperties, &QAction::triggered, this, [this] {
|
||||||
showLayerProperties( QgsProject::instance()->mainAnnotationLayer() );
|
showLayerProperties( QgsProject::instance()->mainAnnotationLayer() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -3207,15 +3207,15 @@ void QgisApp::createActions()
|
|||||||
{
|
{
|
||||||
QShortcut *copyShortcut = new QShortcut( QKeySequence::Copy, widget );
|
QShortcut *copyShortcut = new QShortcut( QKeySequence::Copy, widget );
|
||||||
copyShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
copyShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
||||||
connect( copyShortcut, &QShortcut::activated, this, [=] { copySelectionToClipboard(); } );
|
connect( copyShortcut, &QShortcut::activated, this, [this] { copySelectionToClipboard(); } );
|
||||||
|
|
||||||
QShortcut *cutShortcut = new QShortcut( QKeySequence::Cut, widget );
|
QShortcut *cutShortcut = new QShortcut( QKeySequence::Cut, widget );
|
||||||
cutShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
cutShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
||||||
connect( cutShortcut, &QShortcut::activated, this, [=] { cutSelectionToClipboard(); } );
|
connect( cutShortcut, &QShortcut::activated, this, [this] { cutSelectionToClipboard(); } );
|
||||||
|
|
||||||
QShortcut *pasteShortcut = new QShortcut( QKeySequence::Paste, widget );
|
QShortcut *pasteShortcut = new QShortcut( QKeySequence::Paste, widget );
|
||||||
pasteShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
pasteShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
||||||
connect( pasteShortcut, &QShortcut::activated, this, [=] { pasteFromClipboard(); } );
|
connect( pasteShortcut, &QShortcut::activated, this, [this] { pasteFromClipboard(); } );
|
||||||
|
|
||||||
QShortcut *selectAllShortcut = new QShortcut( QKeySequence::SelectAll, widget );
|
QShortcut *selectAllShortcut = new QShortcut( QKeySequence::SelectAll, widget );
|
||||||
selectAllShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
selectAllShortcut->setContext( Qt::WidgetWithChildrenShortcut );
|
||||||
@ -3547,13 +3547,13 @@ void QgisApp::createToolBars()
|
|||||||
|
|
||||||
mSnappingWidget = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, mSnappingToolBar );
|
mSnappingWidget = new QgsSnappingWidget( QgsProject::instance(), mMapCanvas, mSnappingToolBar );
|
||||||
mSnappingWidget->setObjectName( QStringLiteral( "mSnappingWidget" ) );
|
mSnappingWidget->setObjectName( QStringLiteral( "mSnappingWidget" ) );
|
||||||
connect( mSnappingWidget, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [=] { QgsProject::instance()->setSnappingConfig( mSnappingWidget->config() ); } );
|
connect( mSnappingWidget, &QgsSnappingWidget::snappingConfigChanged, QgsProject::instance(), [this] { QgsProject::instance()->setSnappingConfig( mSnappingWidget->config() ); } );
|
||||||
mSnappingToolBar->addWidget( mSnappingWidget );
|
mSnappingToolBar->addWidget( mSnappingWidget );
|
||||||
|
|
||||||
mTracer = new QgsMapCanvasTracer( mMapCanvas, messageBar() );
|
mTracer = new QgsMapCanvasTracer( mMapCanvas, messageBar() );
|
||||||
mTracer->setActionEnableTracing( mSnappingWidget->enableTracingAction() );
|
mTracer->setActionEnableTracing( mSnappingWidget->enableTracingAction() );
|
||||||
mTracer->setActionEnableSnapping( mSnappingWidget->enableSnappingAction() );
|
mTracer->setActionEnableSnapping( mSnappingWidget->enableSnappingAction() );
|
||||||
connect( mSnappingWidget->tracingOffsetSpinBox(), static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double v ) { mTracer->setOffset( v ); } );
|
connect( mSnappingWidget->tracingOffsetSpinBox(), static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double v ) { mTracer->setOffset( v ); } );
|
||||||
|
|
||||||
mDigitizingTechniqueManager->setupToolBars();
|
mDigitizingTechniqueManager->setupToolBars();
|
||||||
|
|
||||||
@ -4006,7 +4006,7 @@ void QgisApp::createStatusBar()
|
|||||||
mMagnifierWidget->setFont( statusBarFont );
|
mMagnifierWidget->setFont( statusBarFont );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateMagnification );
|
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateMagnification );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::scaleLockChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateScaleLock );
|
connect( mMapCanvas, &QgsMapCanvas::scaleLockChanged, mMagnifierWidget, &QgsStatusBarMagnifierWidget::updateScaleLock );
|
||||||
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::magnificationChanged, mMapCanvas, [=]( double factor ) { mMapCanvas->setMagnificationFactor( factor ); } );
|
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::magnificationChanged, mMapCanvas, [this]( double factor ) { mMapCanvas->setMagnificationFactor( factor ); } );
|
||||||
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::scaleLockChanged, mMapCanvas, &QgsMapCanvas::setScaleLocked );
|
connect( mMagnifierWidget, &QgsStatusBarMagnifierWidget::scaleLockChanged, mMapCanvas, &QgsMapCanvas::setScaleLocked );
|
||||||
mMagnifierWidget->updateMagnification( QSettings().value( QStringLiteral( "/qgis/magnifier_factor_default" ), 1.0 ).toDouble() );
|
mMagnifierWidget->updateMagnification( QSettings().value( QStringLiteral( "/qgis/magnifier_factor_default" ), 1.0 ).toDouble() );
|
||||||
mStatusBar->addPermanentWidget( mMagnifierWidget, 0 );
|
mStatusBar->addPermanentWidget( mMagnifierWidget, 0 );
|
||||||
@ -4079,7 +4079,7 @@ void QgisApp::createStatusBar()
|
|||||||
mLocatorWidget = new QgsLocatorWidget( mStatusBar );
|
mLocatorWidget = new QgsLocatorWidget( mStatusBar );
|
||||||
mStatusBar->addPermanentWidget( mLocatorWidget, 0, QgsStatusBar::AnchorLeft );
|
mStatusBar->addPermanentWidget( mLocatorWidget, 0, QgsStatusBar::AnchorLeft );
|
||||||
QShortcut *locatorShortCut = new QShortcut( QKeySequence( tr( "Ctrl+K" ) ), this );
|
QShortcut *locatorShortCut = new QShortcut( QKeySequence( tr( "Ctrl+K" ) ), this );
|
||||||
connect( locatorShortCut, &QShortcut::activated, mLocatorWidget, [=] { mLocatorWidget->search( QString() ); } );
|
connect( locatorShortCut, &QShortcut::activated, mLocatorWidget, [this] { mLocatorWidget->search( QString() ); } );
|
||||||
locatorShortCut->setObjectName( QStringLiteral( "Locator" ) );
|
locatorShortCut->setObjectName( QStringLiteral( "Locator" ) );
|
||||||
locatorShortCut->setWhatsThis( tr( "Trigger Locator" ) );
|
locatorShortCut->setWhatsThis( tr( "Trigger Locator" ) );
|
||||||
|
|
||||||
@ -4358,7 +4358,7 @@ void QgisApp::setupConnections()
|
|||||||
connect( mMapCanvas, &QgsMapCanvas::zoomLastStatusChanged, mActionZoomLast, &QAction::setEnabled );
|
connect( mMapCanvas, &QgsMapCanvas::zoomLastStatusChanged, mActionZoomLast, &QAction::setEnabled );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::zoomNextStatusChanged, mActionZoomNext, &QAction::setEnabled );
|
connect( mMapCanvas, &QgsMapCanvas::zoomNextStatusChanged, mActionZoomNext, &QAction::setEnabled );
|
||||||
|
|
||||||
connect( mRenderSuppressionCBox, &QAbstractButton::toggled, this, [=]( bool flag ) {
|
connect( mRenderSuppressionCBox, &QAbstractButton::toggled, this, [this]( bool flag ) {
|
||||||
const auto canvases = mapCanvases();
|
const auto canvases = mapCanvases();
|
||||||
for ( QgsMapCanvas *canvas : canvases )
|
for ( QgsMapCanvas *canvas : canvases )
|
||||||
canvas->setRenderFlag( flag );
|
canvas->setRenderFlag( flag );
|
||||||
@ -4377,18 +4377,18 @@ void QgisApp::setupConnections()
|
|||||||
// mOnTheFlyProjectionStatusButton with the correct icon, see https://github.com/qgis/QGIS/issues/53768
|
// mOnTheFlyProjectionStatusButton with the correct icon, see https://github.com/qgis/QGIS/issues/53768
|
||||||
connect( QgsProject::instance(), &QgsProject::cleared, this, &QgisApp::updateCrsStatusBar );
|
connect( QgsProject::instance(), &QgsProject::cleared, this, &QgisApp::updateCrsStatusBar );
|
||||||
|
|
||||||
connect( QgsProject::instance()->viewSettings(), &QgsProjectViewSettings::mapScalesChanged, this, [=] { mScaleWidget->updateScales(); } );
|
connect( QgsProject::instance()->viewSettings(), &QgsProjectViewSettings::mapScalesChanged, this, [this] { mScaleWidget->updateScales(); } );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::missingDatumTransforms, this, [=]( const QStringList &transforms ) {
|
connect( QgsProject::instance(), &QgsProject::missingDatumTransforms, this, [this]( const QStringList &transforms ) {
|
||||||
QString message = tr( "Transforms are not installed: %1 " ).arg( transforms.join( QLatin1String( " ," ) ) );
|
QString message = tr( "Transforms are not installed: %1 " ).arg( transforms.join( QLatin1String( " ," ) ) );
|
||||||
messageBar()->pushWarning( tr( "Missing datum transforms" ), message );
|
messageBar()->pushWarning( tr( "Missing datum transforms" ), message );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, mMapCanvas, [=] {
|
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, mMapCanvas, [this] {
|
||||||
mMapCanvas->setLabelingEngineSettings( QgsProject::instance()->labelingEngineSettings() );
|
mMapCanvas->setLabelingEngineSettings( QgsProject::instance()->labelingEngineSettings() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::backgroundColorChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::backgroundColorChanged, this, [this] {
|
||||||
const QColor backgroundColor = QgsProject::instance()->backgroundColor();
|
const QColor backgroundColor = QgsProject::instance()->backgroundColor();
|
||||||
const auto constMapCanvases = mapCanvases();
|
const auto constMapCanvases = mapCanvases();
|
||||||
for ( QgsMapCanvas *canvas : constMapCanvases )
|
for ( QgsMapCanvas *canvas : constMapCanvases )
|
||||||
@ -4402,7 +4402,7 @@ void QgisApp::setupConnections()
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::selectionColorChanged, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::selectionColorChanged, this, [this] {
|
||||||
const QColor selectionColor = QgsProject::instance()->selectionColor();
|
const QColor selectionColor = QgsProject::instance()->selectionColor();
|
||||||
const auto constMapCanvases = mapCanvases();
|
const auto constMapCanvases = mapCanvases();
|
||||||
for ( QgsMapCanvas *canvas : constMapCanvases )
|
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::markDirty );
|
||||||
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::removedChildren, this, &QgisApp::updateNewLayerInsertionPoint );
|
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::removedChildren, this, &QgisApp::updateNewLayerInsertionPoint );
|
||||||
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::visibilityChanged, this, &QgisApp::markDirty );
|
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::visibilityChanged, this, &QgisApp::markDirty );
|
||||||
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::customPropertyChanged, this, [=]( QgsLayerTreeNode *, const QString &key ) {
|
connect( mLayerTreeView->layerTreeModel()->rootGroup(), &QgsLayerTreeNode::customPropertyChanged, this, [this]( QgsLayerTreeNode *, const QString &key ) {
|
||||||
// only mark dirty for non-view only changes
|
// only mark dirty for non-view only changes
|
||||||
if ( !QgsLayerTreeView::viewOnlyCustomProperties().contains( key ) )
|
if ( !QgsLayerTreeView::viewOnlyCustomProperties().contains( key ) )
|
||||||
QgisApp::markDirty();
|
QgisApp::markDirty();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mLayerTreeView, &QgsLayerTreeView::datasetsDropped, this, [=]( QDropEvent *event ) {
|
connect( mLayerTreeView, &QgsLayerTreeView::datasetsDropped, this, [this]( QDropEvent *event ) {
|
||||||
mLayerTreeDrop = true;
|
mLayerTreeDrop = true;
|
||||||
dropEvent( event );
|
dropEvent( event );
|
||||||
} );
|
} );
|
||||||
@ -4476,7 +4476,7 @@ void QgisApp::setupConnections()
|
|||||||
connect( QgsProject::instance(), &QgsProject::transactionGroupsChanged, this, &QgisApp::onTransactionGroupsChanged );
|
connect( QgsProject::instance(), &QgsProject::transactionGroupsChanged, this, &QgisApp::onTransactionGroupsChanged );
|
||||||
|
|
||||||
// Handle dirty raster attribute tables
|
// Handle dirty raster attribute tables
|
||||||
connect( QgsProject::instance(), qOverload<const QList<QgsMapLayer *> &>( &QgsProject::layersWillBeRemoved ), this, [=]( const QList<QgsMapLayer *> &layers ) {
|
connect( QgsProject::instance(), qOverload<const QList<QgsMapLayer *> &>( &QgsProject::layersWillBeRemoved ), this, [this]( const QList<QgsMapLayer *> &layers ) {
|
||||||
checkUnsavedRasterAttributeTableEdits( layers, false );
|
checkUnsavedRasterAttributeTableEdits( layers, false );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -4925,12 +4925,12 @@ void QgisApp::initLayerTreeView()
|
|||||||
|
|
||||||
mFilterLegendToggleShowPrivateLayersAction = new QAction( tr( "Show Private Layers" ), this );
|
mFilterLegendToggleShowPrivateLayersAction = new QAction( tr( "Show Private Layers" ), this );
|
||||||
mFilterLegendToggleShowPrivateLayersAction->setCheckable( true );
|
mFilterLegendToggleShowPrivateLayersAction->setCheckable( true );
|
||||||
connect( mFilterLegendToggleShowPrivateLayersAction, &QAction::toggled, this, [=]( bool showPrivateLayers ) { layerTreeView()->setShowPrivateLayers( showPrivateLayers ); } );
|
connect( mFilterLegendToggleShowPrivateLayersAction, &QAction::toggled, this, [this]( bool showPrivateLayers ) { layerTreeView()->setShowPrivateLayers( showPrivateLayers ); } );
|
||||||
filterLegendMenu->addAction( mFilterLegendToggleShowPrivateLayersAction );
|
filterLegendMenu->addAction( mFilterLegendToggleShowPrivateLayersAction );
|
||||||
|
|
||||||
mFilterLegendToggleHideValidLayersAction = new QAction( tr( "Show Broken Layers Only" ), this );
|
mFilterLegendToggleHideValidLayersAction = new QAction( tr( "Show Broken Layers Only" ), this );
|
||||||
mFilterLegendToggleHideValidLayersAction->setCheckable( true );
|
mFilterLegendToggleHideValidLayersAction->setCheckable( true );
|
||||||
connect( mFilterLegendToggleHideValidLayersAction, &QAction::toggled, this, [=]( bool hideValidLayers ) { layerTreeView()->setHideValidLayers( hideValidLayers ); } );
|
connect( mFilterLegendToggleHideValidLayersAction, &QAction::toggled, this, [this]( bool hideValidLayers ) { layerTreeView()->setHideValidLayers( hideValidLayers ); } );
|
||||||
filterLegendMenu->addAction( mFilterLegendToggleHideValidLayersAction );
|
filterLegendMenu->addAction( mFilterLegendToggleHideValidLayersAction );
|
||||||
|
|
||||||
mLegendExpressionFilterButton = new QgsLegendFilterButton( this );
|
mLegendExpressionFilterButton = new QgsLegendFilterButton( this );
|
||||||
@ -5234,7 +5234,7 @@ void QgisApp::updateRecentProjectPaths()
|
|||||||
{
|
{
|
||||||
mRecentProjectsMenu->addSeparator();
|
mRecentProjectsMenu->addSeparator();
|
||||||
QAction *clearRecentProjectsAction = mRecentProjectsMenu->addAction( tr( "Clear List" ) );
|
QAction *clearRecentProjectsAction = mRecentProjectsMenu->addAction( tr( "Clear List" ) );
|
||||||
connect( clearRecentProjectsAction, &QAction::triggered, mWelcomePage, [=]() { mWelcomePage->clearRecentProjects(); } );
|
connect( clearRecentProjectsAction, &QAction::triggered, mWelcomePage, [this]() { mWelcomePage->clearRecentProjects(); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<QgsNative::RecentProjectProperties> recentProjects;
|
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
|
// we have to delay the thumbnail creation until after the canvas has refreshed for the first time
|
||||||
QMetaObject::Connection *connection = new QMetaObject::Connection();
|
QMetaObject::Connection *connection = new QMetaObject::Connection();
|
||||||
*connection = connect( mMapCanvas, &QgsMapCanvas::mapCanvasRefreshed, this, [=]() {
|
*connection = connect( mMapCanvas, &QgsMapCanvas::mapCanvasRefreshed, this, [this, connection, customHandlerIcon]() {
|
||||||
QObject::disconnect( *connection );
|
QObject::disconnect( *connection );
|
||||||
delete connection;
|
delete connection;
|
||||||
saveRecentProjectPath( true, customHandlerIcon );
|
saveRecentProjectPath( true, customHandlerIcon );
|
||||||
@ -8104,7 +8104,7 @@ QString QgisApp::saveAsRasterFile( QgsRasterLayer *rasterLayer, const bool defau
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// when an error occurs:
|
// when an error occurs:
|
||||||
connect( writerTask, qOverload<int, const QString &>( &QgsRasterFileWriterTask::errorOccurred ), this, [=]( int errorInt, const QString &errorMessage ) {
|
connect( writerTask, qOverload<int, const QString &>( &QgsRasterFileWriterTask::errorOccurred ), this, [this]( int errorInt, const QString &errorMessage ) {
|
||||||
const Qgis::RasterFileWriterResult error = static_cast<Qgis::RasterFileWriterResult>( errorInt );
|
const Qgis::RasterFileWriterResult error = static_cast<Qgis::RasterFileWriterResult>( errorInt );
|
||||||
if ( error != Qgis::RasterFileWriterResult::Canceled )
|
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.setConflictingNameWarning( tr( "Title already exists!" ) );
|
||||||
|
|
||||||
dlg.buttonBox()->addButton( QDialogButtonBox::Help );
|
dlg.buttonBox()->addButton( QDialogButtonBox::Help );
|
||||||
connect( dlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [=] {
|
connect( dlg.buttonBox(), &QDialogButtonBox::helpRequested, this, [helpPage] {
|
||||||
QgsHelp::openHelp( helpPage );
|
QgsHelp::openHelp( helpPage );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -9007,7 +9007,7 @@ void QgisApp::deleteLayoutDesigners()
|
|||||||
void QgisApp::setupLayoutManagerConnections()
|
void QgisApp::setupLayoutManagerConnections()
|
||||||
{
|
{
|
||||||
QgsLayoutManager *manager = QgsProject::instance()->layoutManager();
|
QgsLayoutManager *manager = QgsProject::instance()->layoutManager();
|
||||||
connect( manager, &QgsLayoutManager::layoutAdded, this, [=]( const QString &name ) {
|
connect( manager, &QgsLayoutManager::layoutAdded, this, [this]( const QString &name ) {
|
||||||
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
|
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
|
||||||
if ( !l )
|
if ( !l )
|
||||||
return;
|
return;
|
||||||
@ -9035,7 +9035,7 @@ void QgisApp::setupLayoutManagerConnections()
|
|||||||
setupAtlasMapLayerAction( pl, pl->atlas()->enabled() && pl->atlas()->coverageLayer() );
|
setupAtlasMapLayerAction( pl, pl->atlas()->enabled() && pl->atlas()->coverageLayer() );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( manager, &QgsLayoutManager::layoutAboutToBeRemoved, this, [=]( const QString &name ) {
|
connect( manager, &QgsLayoutManager::layoutAboutToBeRemoved, this, [this]( const QString &name ) {
|
||||||
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
|
QgsMasterLayoutInterface *l = QgsProject::instance()->layoutManager()->layoutByName( name );
|
||||||
if ( l )
|
if ( l )
|
||||||
{
|
{
|
||||||
@ -9989,7 +9989,7 @@ void QgisApp::selectByForm()
|
|||||||
dlg->setMessageBar( messageBar() );
|
dlg->setMessageBar( messageBar() );
|
||||||
dlg->setMapCanvas( mapCanvas() );
|
dlg->setMapCanvas( mapCanvas() );
|
||||||
dlg->setAttribute( Qt::WA_DeleteOnClose );
|
dlg->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
connect( dlg, &QgsSelectByFormDialog::showFilteredFeaturesAttributeTable, dlg, [=]( const QString &filter ) {
|
connect( dlg, &QgsSelectByFormDialog::showFilteredFeaturesAttributeTable, dlg, [vlayer]( const QString &filter ) {
|
||||||
if ( !vlayer->dataProvider() )
|
if ( !vlayer->dataProvider() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -10221,7 +10221,7 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )
|
|||||||
|
|
||||||
QgsFixAttributeDialog *dialog = new QgsFixAttributeDialog( pasteVectorLayer, invalidFeatures, this, context );
|
QgsFixAttributeDialog *dialog = new QgsFixAttributeDialog( pasteVectorLayer, invalidFeatures, this, context );
|
||||||
|
|
||||||
connect( dialog, &QgsFixAttributeDialog::finished, this, [=]( int feedback ) {
|
connect( dialog, &QgsFixAttributeDialog::finished, this, [this, pastedFeatures, validFeatures, dialog, pasteVectorLayer, invalidGeometriesCount, nTotalFeatures]( int feedback ) {
|
||||||
QgsFeatureList features = pastedFeatures;
|
QgsFeatureList features = pastedFeatures;
|
||||||
switch ( feedback )
|
switch ( feedback )
|
||||||
{
|
{
|
||||||
@ -10503,7 +10503,7 @@ void QgisApp::canvasRefreshStarted()
|
|||||||
mRenderProgressBarTimer.setSingleShot( true );
|
mRenderProgressBarTimer.setSingleShot( true );
|
||||||
mRenderProgressBarTimer.setInterval( 500 );
|
mRenderProgressBarTimer.setInterval( 500 );
|
||||||
disconnect( mRenderProgressBarTimerConnection );
|
disconnect( mRenderProgressBarTimerConnection );
|
||||||
mRenderProgressBarTimerConnection = connect( &mRenderProgressBarTimer, &QTimer::timeout, this, [=]() {
|
mRenderProgressBarTimerConnection = connect( &mRenderProgressBarTimer, &QTimer::timeout, this, [this]() {
|
||||||
showProgress( -1, 0 );
|
showProgress( -1, 0 );
|
||||||
} );
|
} );
|
||||||
mRenderProgressBarTimer.start();
|
mRenderProgressBarTimer.start();
|
||||||
@ -13160,7 +13160,7 @@ void QgisApp::initLayouts()
|
|||||||
} );
|
} );
|
||||||
auto map3dMetadata = std::make_unique<QgsLayoutItemGuiMetadata>(
|
auto map3dMetadata = std::make_unique<QgsLayoutItemGuiMetadata>(
|
||||||
QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ),
|
QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ),
|
||||||
[=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * {
|
[]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * {
|
||||||
return new QgsLayout3DMapWidget( qobject_cast<QgsLayoutItem3DMap *>( item ) );
|
return new QgsLayout3DMapWidget( qobject_cast<QgsLayoutItem3DMap *>( item ) );
|
||||||
},
|
},
|
||||||
createRubberBand
|
createRubberBand
|
||||||
@ -13173,7 +13173,7 @@ void QgisApp::initLayouts()
|
|||||||
mLayoutImageDropHandler = new QgsLayoutImageDropHandler( this );
|
mLayoutImageDropHandler = new QgsLayoutImageDropHandler( this );
|
||||||
registerCustomLayoutDropHandler( mLayoutImageDropHandler );
|
registerCustomLayoutDropHandler( mLayoutImageDropHandler );
|
||||||
|
|
||||||
QgsLayoutElevationProfileWidget::sBuildCopyMenuFunction = [=]( QgsLayoutElevationProfileWidget *layoutWidget, QMenu *menu ) {
|
QgsLayoutElevationProfileWidget::sBuildCopyMenuFunction = [this]( QgsLayoutElevationProfileWidget *layoutWidget, QMenu *menu ) {
|
||||||
menu->clear();
|
menu->clear();
|
||||||
const QList<QgsElevationProfileWidget *> elevationProfileWidgets = findChildren<QgsElevationProfileWidget *>();
|
const QList<QgsElevationProfileWidget *> elevationProfileWidgets = findChildren<QgsElevationProfileWidget *>();
|
||||||
|
|
||||||
@ -13188,7 +13188,7 @@ void QgisApp::initLayouts()
|
|||||||
for ( QgsElevationProfileWidget *widget : elevationProfileWidgets )
|
for ( QgsElevationProfileWidget *widget : elevationProfileWidgets )
|
||||||
{
|
{
|
||||||
QAction *action = new QAction( tr( "Copy From %1" ).arg( widget->canvasName() ), menu );
|
QAction *action = new QAction( tr( "Copy From %1" ).arg( widget->canvasName() ), menu );
|
||||||
connect( action, &QAction::triggered, widget, [=] {
|
connect( action, &QAction::triggered, widget, [layoutWidget, widget] {
|
||||||
layoutWidget->copySettingsFromProfileCanvas( widget->profileCanvas() );
|
layoutWidget->copySettingsFromProfileCanvas( widget->profileCanvas() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( action );
|
menu->addAction( action );
|
||||||
@ -15887,7 +15887,7 @@ void QgisApp::renameView()
|
|||||||
renameDlg.setOverwriteEnabled( false );
|
renameDlg.setOverwriteEnabled( false );
|
||||||
renameDlg.setConflictingNameWarning( tr( "A view with this name already exists" ) );
|
renameDlg.setConflictingNameWarning( tr( "A view with this name already exists" ) );
|
||||||
renameDlg.buttonBox()->addButton( QDialogButtonBox::Help );
|
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" ) );
|
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 );
|
QgsVectorLayerProperties *vectorLayerPropertiesDialog = new QgsVectorLayerProperties( mMapCanvas, visibleMessageBar(), vlayer, this );
|
||||||
connect(
|
connect(
|
||||||
vectorLayerPropertiesDialog, static_cast<void ( QgsVectorLayerProperties::* )( QgsMapLayer * )>( &QgsVectorLayerProperties::toggleEditing ),
|
vectorLayerPropertiesDialog, static_cast<void ( QgsVectorLayerProperties::* )( QgsMapLayer * )>( &QgsVectorLayerProperties::toggleEditing ),
|
||||||
this, [=]( QgsMapLayer *layer ) { toggleEditing( layer ); }
|
this, [this]( QgsMapLayer *layer ) { toggleEditing( layer ); }
|
||||||
);
|
);
|
||||||
connect( vectorLayerPropertiesDialog, &QgsVectorLayerProperties::exportAuxiliaryLayer, this, [=]( QgsAuxiliaryLayer *layer ) {
|
connect( vectorLayerPropertiesDialog, &QgsVectorLayerProperties::exportAuxiliaryLayer, this, [this]( QgsAuxiliaryLayer *layer ) {
|
||||||
if ( layer )
|
if ( layer )
|
||||||
{
|
{
|
||||||
std::unique_ptr<QgsVectorLayer> clone;
|
std::unique_ptr<QgsVectorLayer> clone;
|
||||||
|
@ -913,7 +913,7 @@ bool QgisAppInterface::openFeatureForm( QgsVectorLayer *vlayer, QgsFeature &f, b
|
|||||||
|
|
||||||
void QgisAppInterface::preloadForm( const QString &uifile )
|
void QgisAppInterface::preloadForm( const QString &uifile )
|
||||||
{
|
{
|
||||||
QTimer::singleShot( 0, this, [=] {
|
QTimer::singleShot( 0, this, [this, uifile] {
|
||||||
cacheloadForm( uifile );
|
cacheloadForm( uifile );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ QgsAnimationExportDialog::QgsAnimationExportDialog( QWidget *parent, QgsMapCanva
|
|||||||
QValidator *validator = new QRegularExpressionValidator( rx, this );
|
QValidator *validator = new QRegularExpressionValidator( rx, this );
|
||||||
mTemplateLineEdit->setValidator( validator );
|
mTemplateLineEdit->setValidator( validator );
|
||||||
|
|
||||||
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [=] {
|
connect( mTemplateLineEdit, &QLineEdit::textChanged, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "ExportAnimation/fileNameTemplate" ), mTemplateLineEdit->text() );
|
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->setDefaultRoot( settings.value( QStringLiteral( "ExportAnimation/lastDir" ), QString(), QgsSettings::App ).toString() );
|
||||||
mOutputDirFileWidget->setFilePath( 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, [=] {
|
connect( mOutputDirFileWidget, &QgsFileWidget::fileChanged, this, [this] {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
settings.setValue( QStringLiteral( "ExportAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
|
settings.setValue( QStringLiteral( "ExportAnimation/lastDir" ), mOutputDirFileWidget->filePath(), QgsSettings::App );
|
||||||
} );
|
} );
|
||||||
@ -114,18 +114,18 @@ QgsAnimationExportDialog::QgsAnimationExportDialog( QWidget *parent, QgsMapCanva
|
|||||||
mFrameDurationSpinBox->setValue( QgsProject::instance()->timeSettings()->timeStep() );
|
mFrameDurationSpinBox->setValue( QgsProject::instance()->timeSettings()->timeStep() );
|
||||||
mTimeStepsComboBox->setCurrentIndex( mTimeStepsComboBox->findData( static_cast<int>( QgsProject::instance()->timeSettings()->timeStepUnit() ) ) );
|
mTimeStepsComboBox->setCurrentIndex( mTimeStepsComboBox->findData( static_cast<int>( QgsProject::instance()->timeSettings()->timeStepUnit() ) ) );
|
||||||
|
|
||||||
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
|
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
|
||||||
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
|
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
|
||||||
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsAnimationExportDialog::updateExtent );
|
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsAnimationExportDialog::updateExtent );
|
||||||
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsAnimationExportDialog::lockChanged );
|
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsAnimationExportDialog::lockChanged );
|
||||||
|
|
||||||
connect( mSetToProjectTimeButton, &QPushButton::clicked, this, &QgsAnimationExportDialog::setToProjectTime );
|
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" ) );
|
QgsHelp::openHelp( QStringLiteral( "map_views/map_view.html#maptimecontrol" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( buttonBox, &QDialogButtonBox::accepted, this, [=] {
|
connect( buttonBox, &QDialogButtonBox::accepted, this, [this] {
|
||||||
emit startExport();
|
emit startExport();
|
||||||
accept();
|
accept();
|
||||||
} );
|
} );
|
||||||
|
@ -239,7 +239,7 @@ bool QgsQptDataItem::handleDoubleClick()
|
|||||||
QList<QAction *> QgsQptDataItem::actions( QWidget *parent )
|
QList<QAction *> QgsQptDataItem::actions( QWidget *parent )
|
||||||
{
|
{
|
||||||
QAction *newLayout = new QAction( tr( "New Layout from Template" ), parent );
|
QAction *newLayout = new QAction( tr( "New Layout from Template" ), parent );
|
||||||
connect( newLayout, &QAction::triggered, this, [=] {
|
connect( newLayout, &QAction::triggered, this, [this] {
|
||||||
QgisApp::instance()->openTemplate( path() );
|
QgisApp::instance()->openTemplate( path() );
|
||||||
} );
|
} );
|
||||||
return QList<QAction *>() << newLayout;
|
return QList<QAction *>() << newLayout;
|
||||||
@ -283,11 +283,11 @@ bool QgsPyDataItem::handleDoubleClick()
|
|||||||
QList<QAction *> QgsPyDataItem::actions( QWidget *parent )
|
QList<QAction *> QgsPyDataItem::actions( QWidget *parent )
|
||||||
{
|
{
|
||||||
QAction *runScript = new QAction( tr( "&Run Script" ), parent );
|
QAction *runScript = new QAction( tr( "&Run Script" ), parent );
|
||||||
connect( runScript, &QAction::triggered, this, [=] {
|
connect( runScript, &QAction::triggered, this, [this] {
|
||||||
QgisApp::instance()->runScript( path() );
|
QgisApp::instance()->runScript( path() );
|
||||||
} );
|
} );
|
||||||
QAction *editScript = new QAction( tr( "Open in External &Editor" ), this );
|
QAction *editScript = new QAction( tr( "Open in External &Editor" ), this );
|
||||||
connect( editScript, &QAction::triggered, this, [=] {
|
connect( editScript, &QAction::triggered, this, [this] {
|
||||||
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
|
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
|
||||||
} );
|
} );
|
||||||
return QList<QAction *>() << runScript << editScript;
|
return QList<QAction *>() << runScript << editScript;
|
||||||
@ -634,7 +634,7 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
|
|||||||
mManager = manager;
|
mManager = manager;
|
||||||
mIconName = QStringLiteral( "/mIconFolder.svg" );
|
mIconName = QStringLiteral( "/mIconFolder.svg" );
|
||||||
|
|
||||||
connect( mManager, &QgsBookmarkManager::bookmarkAdded, this, [=]( const QString &id ) {
|
connect( mManager, &QgsBookmarkManager::bookmarkAdded, this, [this]( const QString &id ) {
|
||||||
const QgsBookmark newDetails = mManager->bookmarkById( id );
|
const QgsBookmark newDetails = mManager->bookmarkById( id );
|
||||||
if ( newDetails.group().isEmpty() )
|
if ( newDetails.group().isEmpty() )
|
||||||
addChildItem( new QgsBookmarkItem( this, newDetails.name(), newDetails, mManager ), true );
|
addChildItem( new QgsBookmarkItem( this, newDetails.name(), newDetails, mManager ), true );
|
||||||
@ -652,7 +652,7 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
connect( mManager, &QgsBookmarkManager::bookmarkChanged, this, [=]( const QString &id ) {
|
connect( mManager, &QgsBookmarkManager::bookmarkChanged, this, [this]( const QString &id ) {
|
||||||
const QgsBookmark newDetails = mManager->bookmarkById( id );
|
const QgsBookmark newDetails = mManager->bookmarkById( id );
|
||||||
|
|
||||||
// have to do a deep dive to find the old item...!
|
// 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, [=]( const QString &id ) {
|
connect( mManager, &QgsBookmarkManager::bookmarkAboutToBeRemoved, this, [this]( const QString &id ) {
|
||||||
const QgsBookmark b = mManager->bookmarkById( id );
|
const QgsBookmark b = mManager->bookmarkById( id );
|
||||||
if ( !b.group().isEmpty() )
|
if ( !b.group().isEmpty() )
|
||||||
{
|
{
|
||||||
@ -970,23 +970,23 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
|
|||||||
if ( qobject_cast<QgsBookmarksItem *>( item ) )
|
if ( qobject_cast<QgsBookmarksItem *>( item ) )
|
||||||
{
|
{
|
||||||
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
||||||
connect( addBookmark, &QAction::triggered, this, [=] {
|
connect( addBookmark, &QAction::triggered, this, [] {
|
||||||
QgisApp::instance()->newBookmark();
|
QgisApp::instance()->newBookmark();
|
||||||
} );
|
} );
|
||||||
menu->addAction( addBookmark );
|
menu->addAction( addBookmark );
|
||||||
QAction *showBookmarksPanel = new QAction( tr( "Show Spatial Bookmarks Manager" ), menu );
|
QAction *showBookmarksPanel = new QAction( tr( "Show Spatial Bookmarks Manager" ), menu );
|
||||||
connect( showBookmarksPanel, &QAction::triggered, this, [=] {
|
connect( showBookmarksPanel, &QAction::triggered, this, [] {
|
||||||
QgisApp::instance()->showBookmarkManager( true );
|
QgisApp::instance()->showBookmarkManager( true );
|
||||||
} );
|
} );
|
||||||
menu->addAction( showBookmarksPanel );
|
menu->addAction( showBookmarksPanel );
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
|
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
|
||||||
connect( importBookmarks, &QAction::triggered, this, [=] {
|
connect( importBookmarks, &QAction::triggered, this, [this, context] {
|
||||||
importBookmarksToManager( QgsApplication::bookmarkManager(), context.messageBar() );
|
importBookmarksToManager( QgsApplication::bookmarkManager(), context.messageBar() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( importBookmarks );
|
menu->addAction( importBookmarks );
|
||||||
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
||||||
connect( exportBookmarks, &QAction::triggered, this, [=] {
|
connect( exportBookmarks, &QAction::triggered, this, [this, context] {
|
||||||
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << QgsApplication::bookmarkManager() << QgsProject::instance()->bookmarkManager(), context.messageBar() );
|
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << QgsApplication::bookmarkManager() << QgsProject::instance()->bookmarkManager(), context.messageBar() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( exportBookmarks );
|
menu->addAction( exportBookmarks );
|
||||||
@ -995,19 +995,19 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
|
|||||||
{
|
{
|
||||||
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
QAction *addBookmark = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
||||||
const bool inProject = managerItem->manager() != QgsApplication::bookmarkManager();
|
const bool inProject = managerItem->manager() != QgsApplication::bookmarkManager();
|
||||||
connect( addBookmark, &QAction::triggered, this, [=] {
|
connect( addBookmark, &QAction::triggered, this, [inProject] {
|
||||||
QgisApp::instance()->newBookmark( inProject );
|
QgisApp::instance()->newBookmark( inProject );
|
||||||
} );
|
} );
|
||||||
menu->addAction( addBookmark );
|
menu->addAction( addBookmark );
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
|
QAction *importBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingImport.svg" ) ), tr( "Import Spatial Bookmarks…" ), menu );
|
||||||
connect( importBookmarks, &QAction::triggered, this, [=] {
|
connect( importBookmarks, &QAction::triggered, this, [this, managerItem, context] {
|
||||||
importBookmarksToManager( managerItem->manager(), context.messageBar() );
|
importBookmarksToManager( managerItem->manager(), context.messageBar() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( importBookmarks );
|
menu->addAction( importBookmarks );
|
||||||
|
|
||||||
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
||||||
connect( exportBookmarks, &QAction::triggered, this, [=] {
|
connect( exportBookmarks, &QAction::triggered, this, [this, managerItem, context] {
|
||||||
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << managerItem->manager(), context.messageBar() );
|
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << managerItem->manager(), context.messageBar() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( exportBookmarks );
|
menu->addAction( exportBookmarks );
|
||||||
@ -1089,7 +1089,7 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
|
|||||||
|
|
||||||
// Export bookmarks
|
// Export bookmarks
|
||||||
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
QAction *exportBookmarks = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSharingExport.svg" ) ), tr( "Export Spatial Bookmarks…" ), menu );
|
||||||
connect( exportBookmarks, &QAction::triggered, this, [=] {
|
connect( exportBookmarks, &QAction::triggered, this, [this, groupItem, context] {
|
||||||
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << groupItem->manager(), context.messageBar(), groupItem->group() );
|
exportBookmarksFromManagers( QList<const QgsBookmarkManager *>() << groupItem->manager(), context.messageBar(), groupItem->group() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( exportBookmarks );
|
menu->addAction( exportBookmarks );
|
||||||
@ -1097,7 +1097,7 @@ void QgsBookmarksItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
|
|||||||
// Add spatial bookmark
|
// Add spatial bookmark
|
||||||
QAction *addBookmarkToGroup = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
QAction *addBookmarkToGroup = new QAction( tr( "New Spatial Bookmark…" ), menu );
|
||||||
const bool inProject = manager != QgsApplication::bookmarkManager();
|
const bool inProject = manager != QgsApplication::bookmarkManager();
|
||||||
connect( addBookmarkToGroup, &QAction::triggered, this, [=] {
|
connect( addBookmarkToGroup, &QAction::triggered, this, [inProject, groupItem] {
|
||||||
QgisApp::instance()->newBookmark( inProject, groupItem->group() );
|
QgisApp::instance()->newBookmark( inProject, groupItem->group() );
|
||||||
} );
|
} );
|
||||||
menu->addAction( addBookmarkToGroup );
|
menu->addAction( addBookmarkToGroup );
|
||||||
@ -1299,7 +1299,7 @@ bool QgsHtmlDataItem::handleDoubleClick()
|
|||||||
QList<QAction *> QgsHtmlDataItem::actions( QWidget *parent )
|
QList<QAction *> QgsHtmlDataItem::actions( QWidget *parent )
|
||||||
{
|
{
|
||||||
QAction *openAction = new QAction( tr( "&Open File…" ), parent );
|
QAction *openAction = new QAction( tr( "&Open File…" ), parent );
|
||||||
connect( openAction, &QAction::triggered, this, [=] {
|
connect( openAction, &QAction::triggered, this, [this] {
|
||||||
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
|
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
|
||||||
} );
|
} );
|
||||||
return QList<QAction *>() << openAction;
|
return QList<QAction *>() << openAction;
|
||||||
|
@ -28,27 +28,27 @@
|
|||||||
QgsAppMissingGridHandler::QgsAppMissingGridHandler( QObject *parent )
|
QgsAppMissingGridHandler::QgsAppMissingGridHandler( QObject *parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
{
|
{
|
||||||
QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::GridDetails &grid ) {
|
QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::GridDetails &grid ) {
|
||||||
emit missingRequiredGrid( sourceCrs, destinationCrs, grid );
|
emit missingRequiredGrid( sourceCrs, destinationCrs, grid );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &preferredOperation, const QgsDatumTransform::TransformDetails &availableOperation ) {
|
QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &preferredOperation, const QgsDatumTransform::TransformDetails &availableOperation ) {
|
||||||
emit missingPreferredGrid( sourceCrs, destinationCrs, preferredOperation, availableOperation );
|
emit missingPreferredGrid( sourceCrs, destinationCrs, preferredOperation, availableOperation );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &error ) {
|
QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &error ) {
|
||||||
emit coordinateOperationCreationError( sourceCrs, destinationCrs, error );
|
emit coordinateOperationCreationError( sourceCrs, destinationCrs, error );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &desired ) {
|
QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QgsDatumTransform::TransformDetails &desired ) {
|
||||||
emit missingGridUsedByContextHandler( sourceCrs, destinationCrs, desired );
|
emit missingGridUsedByContextHandler( sourceCrs, destinationCrs, desired );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QgsCoordinateTransform::setFallbackOperationOccurredHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &desired ) {
|
QgsCoordinateTransform::setFallbackOperationOccurredHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs, const QString &desired ) {
|
||||||
emit fallbackOperationOccurred( sourceCrs, destinationCrs, desired );
|
emit fallbackOperationOccurred( sourceCrs, destinationCrs, desired );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QgsCoordinateTransform::setDynamicCrsToDynamicCrsWarningHandler( [=]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs ) {
|
QgsCoordinateTransform::setDynamicCrsToDynamicCrsWarningHandler( [this]( const QgsCoordinateReferenceSystem &sourceCrs, const QgsCoordinateReferenceSystem &destinationCrs ) {
|
||||||
emit dynamicToDynamicWarning( sourceCrs, 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::fallbackOperationOccurred, this, &QgsAppMissingGridHandler::onFallbackOperationOccurred, Qt::QueuedConnection );
|
||||||
connect( this, &QgsAppMissingGridHandler::dynamicToDynamicWarning, this, &QgsAppMissingGridHandler::onDynamicToDynamicWarning, Qt::QueuedConnection );
|
connect( this, &QgsAppMissingGridHandler::dynamicToDynamicWarning, this, &QgsAppMissingGridHandler::onDynamicToDynamicWarning, Qt::QueuedConnection );
|
||||||
|
|
||||||
connect( QgsProject::instance(), &QgsProject::cleared, this, [=] {
|
connect( QgsProject::instance(), &QgsProject::cleared, this, [this] {
|
||||||
mAlreadyWarnedPairsForProject.clear();
|
mAlreadyWarnedPairsForProject.clear();
|
||||||
mAlreadyWarnedBallparkPairsForProject.clear();
|
mAlreadyWarnedBallparkPairsForProject.clear();
|
||||||
} );
|
} );
|
||||||
|
@ -52,7 +52,7 @@ QgsQueryHistoryDialog::QgsQueryHistoryDialog( QWidget *parent )
|
|||||||
mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
|
mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
|
||||||
|
|
||||||
connect( clearButton, &QPushButton::clicked, this, &QgsQueryHistoryDialog::clearHistory );
|
connect( clearButton, &QPushButton::clicked, this, &QgsQueryHistoryDialog::clearHistory );
|
||||||
connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [=]() { close(); } );
|
connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [this]() { close(); } );
|
||||||
|
|
||||||
vl->addWidget( mButtonBox );
|
vl->addWidget( mButtonBox );
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
{
|
{
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
const QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
|
const QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
|
||||||
const auto lambdaOpenAttributeTable = [=] { QgisApp::instance()->attributeTable( initialMode ); };
|
const auto lambdaOpenAttributeTable = [initialMode] { QgisApp::instance()->attributeTable( initialMode ); };
|
||||||
QAction *attributeTableAction = menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "Open &Attribute Table" ), QgisApp::instance(), lambdaOpenAttributeTable );
|
QAction *attributeTableAction = menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "Open &Attribute Table" ), QgisApp::instance(), lambdaOpenAttributeTable );
|
||||||
attributeTableAction->setEnabled( vlayer->isValid() );
|
attributeTableAction->setEnabled( vlayer->isValid() );
|
||||||
}
|
}
|
||||||
@ -495,7 +495,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connect( a, &QAction::triggered, this, [=] {
|
connect( a, &QAction::triggered, this, [layer] {
|
||||||
QgisApp::instance()->changeDataSource( layer );
|
QgisApp::instance()->changeDataSource( layer );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -517,7 +517,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
{
|
{
|
||||||
if ( target == Qgis::MapLayerActionTarget::SingleFeature )
|
if ( target == Qgis::MapLayerActionTarget::SingleFeature )
|
||||||
{
|
{
|
||||||
actionMenu->addAction( action->text(), action, [=]() {
|
actionMenu->addAction( action->text(), action, [action, vlayer, context]() {
|
||||||
Q_NOWARN_DEPRECATED_PUSH
|
Q_NOWARN_DEPRECATED_PUSH
|
||||||
action->triggerForFeature( vlayer, vlayer->selectedFeatures().at( 0 ) );
|
action->triggerForFeature( vlayer, vlayer->selectedFeatures().at( 0 ) );
|
||||||
Q_NOWARN_DEPRECATED_POP
|
Q_NOWARN_DEPRECATED_POP
|
||||||
@ -526,7 +526,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
}
|
}
|
||||||
else if ( target == Qgis::MapLayerActionTarget::MultipleFeatures )
|
else if ( target == Qgis::MapLayerActionTarget::MultipleFeatures )
|
||||||
{
|
{
|
||||||
actionMenu->addAction( action->text(), action, [=]() {
|
actionMenu->addAction( action->text(), action, [action, vlayer, context]() {
|
||||||
Q_NOWARN_DEPRECATED_PUSH
|
Q_NOWARN_DEPRECATED_PUSH
|
||||||
action->triggerForFeatures( vlayer, vlayer->selectedFeatures() );
|
action->triggerForFeatures( vlayer, vlayer->selectedFeatures() );
|
||||||
Q_NOWARN_DEPRECATED_POP
|
Q_NOWARN_DEPRECATED_POP
|
||||||
@ -600,7 +600,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QAction *action = menuSetCRS->addAction( tr( "Set to %1" ).arg( crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ) );
|
QAction *action = menuSetCRS->addAction( tr( "Set to %1" ).arg( crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ) );
|
||||||
connect( action, &QAction::triggered, this, [=] {
|
connect( action, &QAction::triggered, this, [this, crs] {
|
||||||
setLayerCrs( crs );
|
setLayerCrs( crs );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -632,7 +632,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
if ( vlayer->isTemporary() && mView->selectedLayerNodes().count() == 1 )
|
if ( vlayer->isTemporary() && mView->selectedLayerNodes().count() == 1 )
|
||||||
{
|
{
|
||||||
QAction *actionMakePermanent = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionFileSave.svg" ) ), tr( "Make Permanent…" ), menu );
|
QAction *actionMakePermanent = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionFileSave.svg" ) ), tr( "Make Permanent…" ), menu );
|
||||||
connect( actionMakePermanent, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->makeMemoryLayerPermanent( vlayer ); } );
|
connect( actionMakePermanent, &QAction::triggered, QgisApp::instance(), [vlayer] { QgisApp::instance()->makeMemoryLayerPermanent( vlayer ); } );
|
||||||
menu->addAction( actionMakePermanent );
|
menu->addAction( actionMakePermanent );
|
||||||
}
|
}
|
||||||
// save as vector file
|
// save as vector file
|
||||||
@ -641,11 +641,11 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
if ( mView->selectedLayerNodes().count() == 1 )
|
if ( mView->selectedLayerNodes().count() == 1 )
|
||||||
{
|
{
|
||||||
QAction *actionSaveAs = new QAction( tr( "Save Features &As…" ), menuExportVector );
|
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() );
|
actionSaveAs->setEnabled( vlayer->isValid() );
|
||||||
menuExportVector->addAction( actionSaveAs );
|
menuExportVector->addAction( actionSaveAs );
|
||||||
QAction *actionSaveSelectedFeaturesAs = new QAction( tr( "Save &Selected Features As…" ), menuExportVector );
|
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 );
|
actionSaveSelectedFeaturesAs->setEnabled( vlayer->isValid() && vlayer->selectedFeatureCount() > 0 );
|
||||||
menuExportVector->addAction( actionSaveSelectedFeaturesAs );
|
menuExportVector->addAction( actionSaveSelectedFeaturesAs );
|
||||||
}
|
}
|
||||||
@ -655,7 +655,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
if ( vlayer->isSpatial() )
|
if ( vlayer->isSpatial() )
|
||||||
{
|
{
|
||||||
QAction *actionSaveStyle = new QAction( tr( "Save as &QGIS Layer Style File…" ), menuExportVector );
|
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 );
|
menuExportVector->addAction( actionSaveStyle );
|
||||||
}
|
}
|
||||||
menu->addMenu( menuExportVector );
|
menu->addMenu( menuExportVector );
|
||||||
@ -673,14 +673,14 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
if ( mView->selectedLayerNodes().count() == 1 )
|
if ( mView->selectedLayerNodes().count() == 1 )
|
||||||
{
|
{
|
||||||
QAction *actionSaveAs = new QAction( tr( "Save &As…" ), menuExportRaster );
|
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 );
|
menuExportRaster->addAction( actionSaveAs );
|
||||||
}
|
}
|
||||||
QAction *actionSaveAsDefinitionLayer = new QAction( tr( "Save as Layer &Definition File…" ), menuExportRaster );
|
QAction *actionSaveAsDefinitionLayer = new QAction( tr( "Save as Layer &Definition File…" ), menuExportRaster );
|
||||||
QAction *actionSaveStyle = new QAction( tr( "Save as &QGIS Layer Style File…" ), menuExportRaster );
|
QAction *actionSaveStyle = new QAction( tr( "Save as &QGIS Layer Style File…" ), menuExportRaster );
|
||||||
connect( actionSaveAsDefinitionLayer, &QAction::triggered, QgisApp::instance(), &QgisApp::saveAsLayerDefinition );
|
connect( actionSaveAsDefinitionLayer, &QAction::triggered, QgisApp::instance(), &QgisApp::saveAsLayerDefinition );
|
||||||
menuExportRaster->addAction( actionSaveAsDefinitionLayer );
|
menuExportRaster->addAction( actionSaveAsDefinitionLayer );
|
||||||
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [=] { QgisApp::instance()->saveStyleFile(); } );
|
connect( actionSaveStyle, &QAction::triggered, QgisApp::instance(), [] { QgisApp::instance()->saveStyleFile(); } );
|
||||||
menuExportRaster->addAction( actionSaveStyle );
|
menuExportRaster->addAction( actionSaveStyle );
|
||||||
menu->addMenu( menuExportRaster );
|
menu->addMenu( menuExportRaster );
|
||||||
}
|
}
|
||||||
@ -728,7 +728,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
const QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
|
const QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
|
||||||
QAction *copyAction = new QAction( icon, name, copyStyleMenu );
|
QAction *copyAction = new QAction( icon, name, copyStyleMenu );
|
||||||
copyAction->setToolTip( tooltip );
|
copyAction->setToolTip( tooltip );
|
||||||
connect( copyAction, &QAction::triggered, this, [=]() { app->copyStyle( layer, category ); } );
|
connect( copyAction, &QAction::triggered, this, [app, layer, category]() { app->copyStyle( layer, category ); } );
|
||||||
copyStyleMenu->addAction( copyAction );
|
copyStyleMenu->addAction( copyAction );
|
||||||
if ( category == QgsMapLayer::AllStyleCategories )
|
if ( category == QgsMapLayer::AllStyleCategories )
|
||||||
copyStyleMenu->addSeparator()->setObjectName( QLatin1String( "CopyStyleSeparator" ) );
|
copyStyleMenu->addSeparator()->setObjectName( QLatin1String( "CopyStyleSeparator" ) );
|
||||||
@ -736,7 +736,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menuStyleManager->addAction( tr( "Copy Style" ), app, [=] { app->copyStyle(); } );
|
menuStyleManager->addAction( tr( "Copy Style" ), app, [app] { app->copyStyle(); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( layer && app->clipboard()->hasFormat( QGSCLIPBOARD_STYLE_MIME ) )
|
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>();
|
const QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
|
||||||
QAction *pasteAction = new QAction( icon, name, pasteStyleMenu );
|
QAction *pasteAction = new QAction( icon, name, pasteStyleMenu );
|
||||||
pasteAction->setToolTip( tooltip );
|
pasteAction->setToolTip( tooltip );
|
||||||
connect( pasteAction, &QAction::triggered, this, [=]() { app->pasteStyle( layer, category ); } );
|
connect( pasteAction, &QAction::triggered, this, [app, layer, category]() { app->pasteStyle( layer, category ); } );
|
||||||
pasteStyleMenu->addAction( pasteAction );
|
pasteStyleMenu->addAction( pasteAction );
|
||||||
if ( category == QgsMapLayer::AllStyleCategories )
|
if ( category == QgsMapLayer::AllStyleCategories )
|
||||||
pasteStyleMenu->addSeparator()->setObjectName( QLatin1String( "PasteStyleSeparator" ) );
|
pasteStyleMenu->addSeparator()->setObjectName( QLatin1String( "PasteStyleSeparator" ) );
|
||||||
@ -779,7 +779,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menuStyleManager->addAction( tr( "Paste Style" ), app, [=] { app->pasteStyle(); } );
|
menuStyleManager->addAction( tr( "Paste Style" ), app, [app] { app->pasteStyle(); } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,17 +282,17 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
|
|||||||
connect( mMainView, &QgsDualView::formModeChanged, this, &QgsAttributeTableDialog::viewModeChanged );
|
connect( mMainView, &QgsDualView::formModeChanged, this, &QgsAttributeTableDialog::viewModeChanged );
|
||||||
|
|
||||||
// info from table to application
|
// 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;
|
QgsDockableWidgetHelper::OpeningMode openingMode = QgsDockableWidgetHelper::OpeningMode::RespectSetting;
|
||||||
if ( initiallyDocked )
|
if ( initiallyDocked )
|
||||||
openingMode = *initiallyDocked ? QgsDockableWidgetHelper::OpeningMode::ForceDocked : QgsDockableWidgetHelper::OpeningMode::ForceDialog;
|
openingMode = *initiallyDocked ? QgsDockableWidgetHelper::OpeningMode::ForceDocked : QgsDockableWidgetHelper::OpeningMode::ForceDialog;
|
||||||
mDockableWidgetHelper = new QgsDockableWidgetHelper( windowTitle(), this, QgisApp::instance(), QStringLiteral( "attribute-table" ), QStringList(), openingMode, true, Qt::BottomDockWidgetArea );
|
mDockableWidgetHelper = new QgsDockableWidgetHelper( windowTitle(), this, QgisApp::instance(), QStringLiteral( "attribute-table" ), QStringList(), openingMode, true, Qt::BottomDockWidgetArea );
|
||||||
toggleShortcuts( !mDockableWidgetHelper->isDocked() );
|
toggleShortcuts( !mDockableWidgetHelper->isDocked() );
|
||||||
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
|
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
|
||||||
close();
|
close();
|
||||||
} );
|
} );
|
||||||
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::dockModeToggled, this, [=]( bool docked ) {
|
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::dockModeToggled, this, [this]( bool docked ) {
|
||||||
if ( docked )
|
if ( docked )
|
||||||
{
|
{
|
||||||
toggleShortcuts( mDockableWidgetHelper->dockWidget()->isFloating() );
|
toggleShortcuts( mDockableWidgetHelper->dockWidget()->isFloating() );
|
||||||
|
@ -175,7 +175,7 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
|
|||||||
|
|
||||||
connect( mAddButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::addDatumTransform );
|
connect( mAddButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::addDatumTransform );
|
||||||
connect( mRemoveButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::removeDatumTransform );
|
connect( mRemoveButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::removeDatumTransform );
|
||||||
connect( mEditButton, &QToolButton::clicked, this, [=] {
|
connect( mEditButton, &QToolButton::clicked, this, [this] {
|
||||||
const QModelIndexList selectedIndexes = mTableView->selectionModel()->selectedIndexes();
|
const QModelIndexList selectedIndexes = mTableView->selectionModel()->selectedIndexes();
|
||||||
if ( selectedIndexes.count() > 0 )
|
if ( selectedIndexes.count() > 0 )
|
||||||
{
|
{
|
||||||
@ -185,7 +185,7 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
|
|||||||
|
|
||||||
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDatumTransformTableWidget::selectionChanged );
|
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDatumTransformTableWidget::selectionChanged );
|
||||||
|
|
||||||
connect( mTableView, &QTableView::doubleClicked, this, [=]( const QModelIndex &index ) {
|
connect( mTableView, &QTableView::doubleClicked, this, [this]( const QModelIndex &index ) {
|
||||||
editDatumTransform( index );
|
editDatumTransform( index );
|
||||||
} );
|
} );
|
||||||
mEditButton->setEnabled( false );
|
mEditButton->setEnabled( false );
|
||||||
|
@ -42,7 +42,7 @@ QgsDevToolsPanelWidget::QgsDevToolsPanelWidget( const QList<QgsDevToolWidgetFact
|
|||||||
for ( QgsDevToolWidgetFactory *factory : factories )
|
for ( QgsDevToolWidgetFactory *factory : factories )
|
||||||
addToolFactory( factory );
|
addToolFactory( factory );
|
||||||
|
|
||||||
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, [=]( int row ) {
|
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, [this]( int row ) {
|
||||||
setCurrentTool( row );
|
setCurrentTool( row );
|
||||||
settingLastActiveTab->setValue( mOptionsListWidget->currentItem()->data( Qt::UserRole ).toString() );
|
settingLastActiveTab->setValue( mOptionsListWidget->currentItem()->data( Qt::UserRole ).toString() );
|
||||||
} );
|
} );
|
||||||
|
@ -28,7 +28,7 @@ QgsDiscoverRelationsDialog::QgsDiscoverRelationsDialog( const QList<QgsRelation>
|
|||||||
|
|
||||||
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||||
mButtonBox->addButton( QDialogButtonBox::Help );
|
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" ) );
|
QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#defining-1-n-relation" ) );
|
||||||
} );
|
} );
|
||||||
connect( mRelationsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDiscoverRelationsDialog::onSelectionChanged );
|
connect( mRelationsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDiscoverRelationsDialog::onSelectionChanged );
|
||||||
|
@ -771,7 +771,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
|
|||||||
connect( mDeselectDataDefinedBlocks, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deselectDataDefinedBlocks );
|
connect( mDeselectDataDefinedBlocks, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deselectDataDefinedBlocks );
|
||||||
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDxfExportDialog::showHelp );
|
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDxfExportDialog::showHelp );
|
||||||
|
|
||||||
connect( mFileName, &QgsFileWidget::fileChanged, this, [=]( const QString &filePath ) {
|
connect( mFileName, &QgsFileWidget::fileChanged, this, [this]( const QString &filePath ) {
|
||||||
QgsSettings settings;
|
QgsSettings settings;
|
||||||
QFileInfo tmplFileInfo( filePath );
|
QFileInfo tmplFileInfo( filePath );
|
||||||
settings.setValue( QStringLiteral( "qgis/lastDxfDir" ), tmplFileInfo.absolutePath() );
|
settings.setValue( QStringLiteral( "qgis/lastDxfDir" ), tmplFileInfo.absolutePath() );
|
||||||
|
@ -65,10 +65,10 @@ void QgsFixAttributeDialog::init( QgsVectorLayer *layer, const QgsAttributeEdito
|
|||||||
{
|
{
|
||||||
buttonBox->addButton( cancelAllBtn, QDialogButtonBox::ActionRole );
|
buttonBox->addButton( cancelAllBtn, QDialogButtonBox::ActionRole );
|
||||||
buttonBox->addButton( cancelAllInvalidBtn, QDialogButtonBox::ActionRole );
|
buttonBox->addButton( cancelAllInvalidBtn, QDialogButtonBox::ActionRole );
|
||||||
connect( cancelAllBtn, &QAbstractButton::clicked, this, [=]() {
|
connect( cancelAllBtn, &QAbstractButton::clicked, this, [this]() {
|
||||||
done( DiscardAll );
|
done( DiscardAll );
|
||||||
} );
|
} );
|
||||||
connect( cancelAllInvalidBtn, &QAbstractButton::clicked, this, [=]() {
|
connect( cancelAllInvalidBtn, &QAbstractButton::clicked, this, [this]() {
|
||||||
done( PasteValid );
|
done( PasteValid );
|
||||||
} );
|
} );
|
||||||
buttonBox->button( QDialogButtonBox::Cancel )->setText( tr( "Skip" ) );
|
buttonBox->button( QDialogButtonBox::Cancel )->setText( tr( "Skip" ) );
|
||||||
@ -78,7 +78,7 @@ void QgsFixAttributeDialog::init( QgsVectorLayer *layer, const QgsAttributeEdito
|
|||||||
storeAllInvalidBtn->setText( tr( "Paste Anyway" ) );
|
storeAllInvalidBtn->setText( tr( "Paste Anyway" ) );
|
||||||
}
|
}
|
||||||
buttonBox->addButton( storeAllInvalidBtn, QDialogButtonBox::ActionRole );
|
buttonBox->addButton( storeAllInvalidBtn, QDialogButtonBox::ActionRole );
|
||||||
connect( storeAllInvalidBtn, &QAbstractButton::clicked, this, [=]() {
|
connect( storeAllInvalidBtn, &QAbstractButton::clicked, this, [this]() {
|
||||||
done( PasteAll );
|
done( PasteAll );
|
||||||
} );
|
} );
|
||||||
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsFixAttributeDialog::reject );
|
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsFixAttributeDialog::reject );
|
||||||
|
@ -1721,11 +1721,11 @@ void QgsIdentifyResultsDialog::contextMenuEvent( QContextMenuEvent *event )
|
|||||||
mActionPopup->addAction( tr( "Clear Results" ), this, &QgsIdentifyResultsDialog::clear );
|
mActionPopup->addAction( tr( "Clear Results" ), this, &QgsIdentifyResultsDialog::clear );
|
||||||
mActionPopup->addAction( tr( "Clear Highlights" ), this, &QgsIdentifyResultsDialog::clearHighlights );
|
mActionPopup->addAction( tr( "Clear Highlights" ), this, &QgsIdentifyResultsDialog::clearHighlights );
|
||||||
mActionPopup->addAction( tr( "Highlight All" ), this, &QgsIdentifyResultsDialog::highlightAll );
|
mActionPopup->addAction( tr( "Highlight All" ), this, &QgsIdentifyResultsDialog::highlightAll );
|
||||||
mActionPopup->addAction( tr( "Highlight Layer" ), this, [=] { highlightLayer(); } );
|
mActionPopup->addAction( tr( "Highlight Layer" ), this, [this] { highlightLayer(); } );
|
||||||
if ( layer && QgsProject::instance()->layerIsEmbedded( layer->id() ).isEmpty() )
|
if ( layer && QgsProject::instance()->layerIsEmbedded( layer->id() ).isEmpty() )
|
||||||
{
|
{
|
||||||
mActionPopup->addAction( tr( "Activate Layer" ), this, [=] { activateLayer(); } );
|
mActionPopup->addAction( tr( "Activate Layer" ), this, [this] { activateLayer(); } );
|
||||||
mActionPopup->addAction( tr( "Layer Properties…" ), this, [=] { layerProperties(); } );
|
mActionPopup->addAction( tr( "Layer Properties…" ), this, [this] { layerProperties(); } );
|
||||||
}
|
}
|
||||||
mActionPopup->addSeparator();
|
mActionPopup->addSeparator();
|
||||||
mActionPopup->addAction( tr( "Expand All" ), this, &QgsIdentifyResultsDialog::expandAll );
|
mActionPopup->addAction( tr( "Expand All" ), this, &QgsIdentifyResultsDialog::expandAll );
|
||||||
|
@ -50,7 +50,7 @@ QgsLayerNotesDialog::QgsLayerNotesDialog( QWidget *parent )
|
|||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Save | QDialogButtonBox::Help | QDialogButtonBox::Cancel );
|
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Save | QDialogButtonBox::Help | QDialogButtonBox::Cancel );
|
||||||
connect( buttonBox->button( QDialogButtonBox::Save ), &QPushButton::clicked, this, &QDialog::accept );
|
connect( buttonBox->button( QDialogButtonBox::Save ), &QPushButton::clicked, this, &QDialog::accept );
|
||||||
connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
|
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" ) );
|
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#layer-notes" ) );
|
||||||
} );
|
} );
|
||||||
layout->addWidget( buttonBox );
|
layout->addWidget( buttonBox );
|
||||||
|
@ -101,8 +101,8 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::mapCrsChanged );
|
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::mapCrsChanged );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::updateExtentRect );
|
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsMapCanvasDockWidget::updateExtentRect );
|
||||||
connect( mActionZoomFullExtent, &QAction::triggered, mMapCanvas, &QgsMapCanvas::zoomToProjectExtent );
|
connect( mActionZoomFullExtent, &QAction::triggered, mMapCanvas, &QgsMapCanvas::zoomToProjectExtent );
|
||||||
connect( mActionZoomToLayers, &QAction::triggered, mMapCanvas, [=] { QgisApp::instance()->layerTreeView()->defaultActions()->zoomToLayers( mMapCanvas ); } );
|
connect( mActionZoomToLayers, &QAction::triggered, mMapCanvas, [this] { QgisApp::instance()->layerTreeView()->defaultActions()->zoomToLayers( mMapCanvas ); } );
|
||||||
connect( mActionZoomToSelected, &QAction::triggered, mMapCanvas, [=] { mMapCanvas->zoomToSelected(); } );
|
connect( mActionZoomToSelected, &QAction::triggered, mMapCanvas, [this] { mMapCanvas->zoomToSelected(); } );
|
||||||
mapCrsChanged();
|
mapCrsChanged();
|
||||||
|
|
||||||
QgsMapSettingsAction *settingsAction = new QgsMapSettingsAction( settingsMenu );
|
QgsMapSettingsAction *settingsAction = new QgsMapSettingsAction( settingsMenu );
|
||||||
@ -127,11 +127,11 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
|
|
||||||
connect( mActionRename, &QAction::triggered, this, &QgsMapCanvasDockWidget::renameTriggered );
|
connect( mActionRename, &QAction::triggered, this, &QgsMapCanvasDockWidget::renameTriggered );
|
||||||
mActionShowAnnotations->setChecked( mMapCanvas->annotationsVisible() );
|
mActionShowAnnotations->setChecked( mMapCanvas->annotationsVisible() );
|
||||||
connect( mActionShowAnnotations, &QAction::toggled, this, [=]( bool checked ) { mMapCanvas->setAnnotationsVisible( checked ); } );
|
connect( mActionShowAnnotations, &QAction::toggled, this, [this]( bool checked ) { mMapCanvas->setAnnotationsVisible( checked ); } );
|
||||||
mActionShowCursor->setChecked( true );
|
mActionShowCursor->setChecked( true );
|
||||||
connect( mActionShowCursor, &QAction::toggled, this, [=]( bool checked ) { mXyMarker->setVisible( checked ); } );
|
connect( mActionShowCursor, &QAction::toggled, this, [this]( bool checked ) { mXyMarker->setVisible( checked ); } );
|
||||||
mActionShowExtent->setChecked( false );
|
mActionShowExtent->setChecked( false );
|
||||||
connect( mActionShowExtent, &QAction::toggled, this, [=]( bool checked ) { mExtentRubberBand->setVisible( checked ); updateExtentRect(); } );
|
connect( mActionShowExtent, &QAction::toggled, this, [this]( bool checked ) { mExtentRubberBand->setVisible( checked ); updateExtentRect(); } );
|
||||||
mActionShowLabels->setChecked( true );
|
mActionShowLabels->setChecked( true );
|
||||||
connect( mActionShowLabels, &QAction::toggled, this, &QgsMapCanvasDockWidget::showLabels );
|
connect( mActionShowLabels, &QAction::toggled, this, &QgsMapCanvasDockWidget::showLabels );
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
mSyncScaleCheckBox = settingsAction->syncScaleCheckBox();
|
mSyncScaleCheckBox = settingsAction->syncScaleCheckBox();
|
||||||
mScaleFactorWidget = settingsAction->scaleFactorSpinBox();
|
mScaleFactorWidget = settingsAction->scaleFactorSpinBox();
|
||||||
|
|
||||||
connect( mSyncSelectionCheck, &QCheckBox::toggled, this, [=]( bool checked ) {
|
connect( mSyncSelectionCheck, &QCheckBox::toggled, this, [this]( bool checked ) {
|
||||||
autoZoomToSelection( checked );
|
autoZoomToSelection( checked );
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
@ -154,7 +154,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mSyncExtentCheck, &QCheckBox::toggled, this, [=]( bool checked ) {
|
connect( mSyncExtentCheck, &QCheckBox::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
syncViewCenter( mMainCanvas );
|
syncViewCenter( mMainCanvas );
|
||||||
@ -164,7 +164,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mScaleCombo, &QgsScaleComboBox::scaleChanged, this, [=]( double scale ) {
|
connect( mScaleCombo, &QgsScaleComboBox::scaleChanged, this, [this]( double scale ) {
|
||||||
if ( !mBlockScaleUpdate )
|
if ( !mBlockScaleUpdate )
|
||||||
{
|
{
|
||||||
mBlockScaleUpdate = true;
|
mBlockScaleUpdate = true;
|
||||||
@ -172,7 +172,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
mBlockScaleUpdate = false;
|
mBlockScaleUpdate = false;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
connect( mMapCanvas, &QgsMapCanvas::scaleChanged, this, [=]( double scale ) {
|
connect( mMapCanvas, &QgsMapCanvas::scaleChanged, this, [this]( double scale ) {
|
||||||
if ( !mBlockScaleUpdate )
|
if ( !mBlockScaleUpdate )
|
||||||
{
|
{
|
||||||
mBlockScaleUpdate = true;
|
mBlockScaleUpdate = true;
|
||||||
@ -181,7 +181,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mRotationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double value ) {
|
connect( mRotationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double value ) {
|
||||||
if ( !mBlockRotationUpdate )
|
if ( !mBlockRotationUpdate )
|
||||||
{
|
{
|
||||||
mBlockRotationUpdate = true;
|
mBlockRotationUpdate = true;
|
||||||
@ -191,7 +191,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mMapCanvas, &QgsMapCanvas::rotationChanged, this, [=]( double rotation ) {
|
connect( mMapCanvas, &QgsMapCanvas::rotationChanged, this, [this]( double rotation ) {
|
||||||
if ( !mBlockRotationUpdate )
|
if ( !mBlockRotationUpdate )
|
||||||
{
|
{
|
||||||
mBlockRotationUpdate = true;
|
mBlockRotationUpdate = true;
|
||||||
@ -200,7 +200,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mMagnificationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [=]( double value ) {
|
connect( mMagnificationEdit, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, [this]( double value ) {
|
||||||
if ( !mBlockMagnificationUpdate )
|
if ( !mBlockMagnificationUpdate )
|
||||||
{
|
{
|
||||||
mBlockMagnificationUpdate = true;
|
mBlockMagnificationUpdate = true;
|
||||||
@ -210,7 +210,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, this, [=]( double factor ) {
|
connect( mMapCanvas, &QgsMapCanvas::magnificationChanged, this, [this]( double factor ) {
|
||||||
if ( !mBlockMagnificationUpdate )
|
if ( !mBlockMagnificationUpdate )
|
||||||
{
|
{
|
||||||
mBlockMagnificationUpdate = true;
|
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( mScaleFactorWidget, static_cast<void ( QgsDoubleSpinBox::* )( double )>( &QgsDoubleSpinBox::valueChanged ), this, &QgsMapCanvasDockWidget::mapScaleChanged );
|
||||||
connect( mSyncScaleCheckBox, &QCheckBox::toggled, this, [=]( bool checked ) {
|
connect( mSyncScaleCheckBox, &QCheckBox::toggled, this, [this]( bool checked ) {
|
||||||
if ( checked )
|
if ( checked )
|
||||||
mapScaleChanged();
|
mapScaleChanged();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
mResizeTimer.setSingleShot( true );
|
mResizeTimer.setSingleShot( true );
|
||||||
connect( &mResizeTimer, &QTimer::timeout, this, [=] {
|
connect( &mResizeTimer, &QTimer::timeout, this, [this] {
|
||||||
mBlockExtentSync = false;
|
mBlockExtentSync = false;
|
||||||
|
|
||||||
if ( mSyncScaleCheckBox->isChecked() )
|
if ( mSyncScaleCheckBox->isChecked() )
|
||||||
@ -247,7 +247,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
|
|||||||
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
|
QToolButton *toggleButton = mDockableWidgetHelper->createDockUndockToolButton();
|
||||||
toggleButton->setToolTip( tr( "Dock 2D Map View" ) );
|
toggleButton->setToolTip( tr( "Dock 2D Map View" ) );
|
||||||
mToolbar->addWidget( toggleButton );
|
mToolbar->addWidget( toggleButton );
|
||||||
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
|
connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [this]() {
|
||||||
close();
|
close();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ void QgsMapCanvasDockWidget::menuAboutToShow()
|
|||||||
{
|
{
|
||||||
actionFollowMain->setChecked( true );
|
actionFollowMain->setChecked( true );
|
||||||
}
|
}
|
||||||
connect( actionFollowMain, &QAction::triggered, this, [=] {
|
connect( actionFollowMain, &QAction::triggered, this, [this] {
|
||||||
mMapCanvas->setTheme( QString() );
|
mMapCanvas->setTheme( QString() );
|
||||||
mMapCanvas->refresh();
|
mMapCanvas->refresh();
|
||||||
} );
|
} );
|
||||||
|
@ -88,9 +88,9 @@ QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, co
|
|||||||
}
|
}
|
||||||
mDrawDecorations->setText( tr( "Draw active decorations: %1" ).arg( !activeDecorations.isEmpty() ? activeDecorations : tr( "none" ) ) );
|
mDrawDecorations->setText( tr( "Draw active decorations: %1" ).arg( !activeDecorations.isEmpty() ? activeDecorations : tr( "none" ) ) );
|
||||||
|
|
||||||
connect( mResolutionSpinBox, &QSpinBox::editingFinished, this, [=] { updateDpi( mResolutionSpinBox->value() ); } );
|
connect( mResolutionSpinBox, &QSpinBox::editingFinished, this, [this] { updateDpi( mResolutionSpinBox->value() ); } );
|
||||||
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
|
connect( mOutputWidthSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputWidth( mOutputWidthSpinBox->value() ); } );
|
||||||
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [=] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
|
connect( mOutputHeightSpinBox, &QSpinBox::editingFinished, this, [this] { updateOutputHeight( mOutputHeightSpinBox->value() ); } );
|
||||||
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsMapSaveDialog::updateExtent );
|
connect( mExtentGroupBox, &QgsExtentGroupBox::extentChanged, this, &QgsMapSaveDialog::updateExtent );
|
||||||
connect( mScaleWidget, &QgsScaleWidget::scaleChanged, this, &QgsMapSaveDialog::updateScale );
|
connect( mScaleWidget, &QgsScaleWidget::scaleChanged, this, &QgsMapSaveDialog::updateScale );
|
||||||
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsMapSaveDialog::lockChanged );
|
connect( mLockAspectRatio, &QgsRatioLockButton::lockChanged, this, &QgsMapSaveDialog::lockChanged );
|
||||||
@ -424,7 +424,7 @@ void QgsMapSaveDialog::copyToClipboard()
|
|||||||
mapRendererTask->addDecorations( mDecorations );
|
mapRendererTask->addDecorations( mDecorations );
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, this, [=] {
|
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, this, [this, img, p] {
|
||||||
QApplication::clipboard()->setImage( *img, QClipboard::Clipboard );
|
QApplication::clipboard()->setImage( *img, QClipboard::Clipboard );
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as image" ), tr( "Successfully copied map to clipboard" ) );
|
QgisApp::instance()->messageBar()->pushSuccess( tr( "Save as image" ), tr( "Successfully copied map to clipboard" ) );
|
||||||
@ -433,7 +433,7 @@ void QgsMapSaveDialog::copyToClipboard()
|
|||||||
delete img;
|
delete img;
|
||||||
setEnabled( true );
|
setEnabled( true );
|
||||||
} );
|
} );
|
||||||
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, this, [=]( int ) {
|
connect( mapRendererTask, &QgsMapRendererTask::errorOccurred, this, [this, p, img]( int ) {
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
QgisApp::instance()->messageBar()->pushWarning( tr( "Save as image" ), tr( "Could not copy the map to clipboard" ) );
|
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() );
|
mapRendererTask->setSaveWorldFile( saveWorldFile() );
|
||||||
|
|
||||||
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [=] {
|
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [fileNameAndFilter] {
|
||||||
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 ) ) );
|
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 )
|
switch ( error )
|
||||||
{
|
{
|
||||||
case QgsMapRendererTask::ImageAllocationFail:
|
case QgsMapRendererTask::ImageAllocationFail:
|
||||||
@ -573,10 +573,10 @@ void QgsMapSaveDialog::onAccepted()
|
|||||||
mapRendererTask->setExportMetadata( exportMetadata() );
|
mapRendererTask->setExportMetadata( exportMetadata() );
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [=] {
|
connect( mapRendererTask, &QgsMapRendererTask::renderingComplete, [fileName] {
|
||||||
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 ) ) );
|
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" ) );
|
QgisApp::instance()->messageBar()->pushWarning( tr( "Save as PDF" ), tr( "Could not save the map to PDF" ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ QgsMapThemes::QgsMapThemes()
|
|||||||
mReplaceMenu = new QMenu( tr( "Replace Theme" ) );
|
mReplaceMenu = new QMenu( tr( "Replace Theme" ) );
|
||||||
mMenu->addMenu( mReplaceMenu );
|
mMenu->addMenu( mReplaceMenu );
|
||||||
mActionRenameCurrentPreset = mMenu->addAction( tr( "Rename Current Theme…" ), this, &QgsMapThemes::renameCurrentPreset );
|
mActionRenameCurrentPreset = mMenu->addAction( tr( "Rename Current Theme…" ), this, &QgsMapThemes::renameCurrentPreset );
|
||||||
mActionAddPreset = mMenu->addAction( tr( "Add Theme…" ), this, [=] { addPreset(); } );
|
mActionAddPreset = mMenu->addAction( tr( "Add Theme…" ), this, [this] { addPreset(); } );
|
||||||
mMenuSeparator = mMenu->addSeparator();
|
mMenuSeparator = mMenu->addSeparator();
|
||||||
|
|
||||||
mActionRemoveCurrentPreset = mMenu->addAction( tr( "Remove Current Theme" ), this, &QgsMapThemes::removeCurrentPreset );
|
mActionRemoveCurrentPreset = mMenu->addAction( tr( "Remove Current Theme" ), this, &QgsMapThemes::removeCurrentPreset );
|
||||||
|
@ -149,10 +149,10 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
|
|||||||
featureTitle = FID_TO_STRING( feature.id() );
|
featureTitle = FID_TO_STRING( feature.id() );
|
||||||
|
|
||||||
QAction *featureAction = featureMenu->addAction( featureTitle );
|
QAction *featureAction = featureMenu->addAction( featureTitle );
|
||||||
connect( featureAction, &QAction::triggered, this, [=] { doActionForFeature( layer, feature, point ); } );
|
connect( featureAction, &QAction::triggered, this, [this, layer, feature, point] { doActionForFeature( layer, feature, point ); } );
|
||||||
}
|
}
|
||||||
QAction *allFeatureAction = featureMenu->addAction( tr( "All Features" ) );
|
QAction *allFeatureAction = featureMenu->addAction( tr( "All Features" ) );
|
||||||
connect( allFeatureAction, &QAction::triggered, this, [=] {
|
connect( allFeatureAction, &QAction::triggered, this, [this, features, layer, point] {
|
||||||
for ( const QgsFeature &feature : std::as_const( features ) )
|
for ( const QgsFeature &feature : std::as_const( features ) )
|
||||||
{
|
{
|
||||||
doActionForFeature( layer, feature, point );
|
doActionForFeature( layer, feature, point );
|
||||||
|
@ -606,7 +606,7 @@ void QgsMapToolOffsetCurve::createUserInputWidget()
|
|||||||
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffsetFromWidget );
|
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingFinished, this, &QgsMapToolOffsetCurve::applyOffsetFromWidget );
|
||||||
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingCanceled, this, &QgsMapToolOffsetCurve::cancel );
|
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetEditingCanceled, this, &QgsMapToolOffsetCurve::cancel );
|
||||||
|
|
||||||
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetConfigChanged, this, [=] { updateGeometryAndRubberBand( mUserInputWidget->offset() ); } );
|
connect( mUserInputWidget, &QgsOffsetUserWidget::offsetConfigChanged, this, [this] { updateGeometryAndRubberBand( mUserInputWidget->offset() ); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsMapToolOffsetCurve::deleteUserInputWidget()
|
void QgsMapToolOffsetCurve::deleteUserInputWidget()
|
||||||
@ -710,16 +710,16 @@ QgsOffsetUserWidget::QgsOffsetUserWidget( QWidget *parent )
|
|||||||
mOffsetSpinBox->installEventFilter( this );
|
mOffsetSpinBox->installEventFilter( this );
|
||||||
connect( mOffsetSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsOffsetUserWidget::offsetChanged );
|
connect( mOffsetSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsOffsetUserWidget::offsetChanged );
|
||||||
|
|
||||||
connect( mJoinStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=] { QgsSettingsRegistryCore::settingsDigitizingOffsetJoinStyle->setValue( static_cast< Qgis::JoinStyle >( mJoinStyleComboBox->currentData().toInt() ) ); emit offsetConfigChanged(); } );
|
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, [=]( const int quadSegments ) { QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg->setValue( quadSegments ); 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, [=]( double miterLimit ) { QgsSettingsRegistryCore::settingsDigitizingOffsetMiterLimit->setValue( miterLimit ); 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, [=] { QgsSettingsRegistryCore::settingsDigitizingOffsetCapStyle->setValue( static_cast< Qgis::EndCapStyle >( mCapStyleComboBox->currentData().toInt() ) ); 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(); } );
|
||||||
|
|
||||||
const bool showAdvanced = QgsSettingsRegistryCore::settingsDigitizingOffsetShowAdvanced->value();
|
const bool showAdvanced = QgsSettingsRegistryCore::settingsDigitizingOffsetShowAdvanced->value();
|
||||||
mShowAdvancedButton->setChecked( showAdvanced );
|
mShowAdvancedButton->setChecked( showAdvanced );
|
||||||
mAdvancedConfigWidget->setVisible( showAdvanced );
|
mAdvancedConfigWidget->setVisible( showAdvanced );
|
||||||
connect( mShowAdvancedButton, &QToolButton::clicked, mAdvancedConfigWidget, &QWidget::setVisible );
|
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
|
// config focus
|
||||||
setFocusProxy( mOffsetSpinBox );
|
setFocusProxy( mOffsetSpinBox );
|
||||||
|
@ -207,7 +207,7 @@ void QgsMapToolSelectionHandler::selectFeaturesMoveEvent( QgsMapMouseEvent *e )
|
|||||||
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( e->pos() ) ), e->modifiers() );
|
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( e->pos() ) ), e->modifiers() );
|
||||||
mOnMouseMoveDelayTimer = std::make_unique<QTimer>();
|
mOnMouseMoveDelayTimer = std::make_unique<QTimer>();
|
||||||
mOnMouseMoveDelayTimer->setSingleShot( true );
|
mOnMouseMoveDelayTimer->setSingleShot( true );
|
||||||
connect( mOnMouseMoveDelayTimer.get(), &QTimer::timeout, this, [=] {
|
connect( mOnMouseMoveDelayTimer.get(), &QTimer::timeout, this, [this, e] {
|
||||||
if ( !mMoveLastCursorPos.isNull() )
|
if ( !mMoveLastCursorPos.isNull() )
|
||||||
{
|
{
|
||||||
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( mMoveLastCursorPos ) ), e->modifiers() );
|
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( mMoveLastCursorPos ) ), e->modifiers() );
|
||||||
|
@ -57,16 +57,16 @@ QgsSimplifyUserInputWidget::QgsSimplifyUserInputWidget( QWidget *parent )
|
|||||||
|
|
||||||
// communication with map tool
|
// communication with map tool
|
||||||
connect( mToleranceSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::toleranceChanged );
|
connect( mToleranceSpinBox, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::toleranceChanged );
|
||||||
connect( mToleranceUnitsComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]( int ) { emit toleranceUnitsChanged( mToleranceUnitsComboBox->currentData().value<Qgis::MapToolUnit>() ); } );
|
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, [=]( const int method ) { emit methodChanged( ( QgsMapToolSimplify::Method ) method ); } );
|
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, [=] {
|
connect( mMethodComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this] {
|
||||||
if ( mMethodComboBox->currentData().toInt() != QgsMapToolSimplify::Smooth )
|
if ( mMethodComboBox->currentData().toInt() != QgsMapToolSimplify::Smooth )
|
||||||
mOptionsStackedWidget->setCurrentIndex( 0 );
|
mOptionsStackedWidget->setCurrentIndex( 0 );
|
||||||
else
|
else
|
||||||
mOptionsStackedWidget->setCurrentIndex( 1 );
|
mOptionsStackedWidget->setCurrentIndex( 1 );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
connect( mOffsetSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [=]( const int offset ) { emit smoothOffsetChanged( offset / 100.0 ); } );
|
connect( mOffsetSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, [this]( const int offset ) { emit smoothOffsetChanged( offset / 100.0 ); } );
|
||||||
connect( mIterationsSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::smoothIterationsChanged );
|
connect( mIterationsSpin, static_cast<void ( QSpinBox::* )( int )>( &QSpinBox::valueChanged ), this, &QgsSimplifyUserInputWidget::smoothIterationsChanged );
|
||||||
|
|
||||||
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsSimplifyUserInputWidget::accepted );
|
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsSimplifyUserInputWidget::accepted );
|
||||||
|
@ -455,7 +455,7 @@ QComboBox *QgsMergeAttributesDialog::createMergeComboBox( QMetaType::Type column
|
|||||||
newComboBox->addItem( tr( "Manual Value" ), QStringLiteral( "manual" ) );
|
newComboBox->addItem( tr( "Manual Value" ), QStringLiteral( "manual" ) );
|
||||||
newComboBox->addItem( tr( "Set to NULL" ), QStringLiteral( "null" ) );
|
newComboBox->addItem( tr( "Set to NULL" ), QStringLiteral( "null" ) );
|
||||||
|
|
||||||
connect( newComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [=]() {
|
connect( newComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [this, newComboBox, column]() {
|
||||||
bool isManual = newComboBox->currentData() == QLatin1String( "manual" );
|
bool isManual = newComboBox->currentData() == QLatin1String( "manual" );
|
||||||
updateManualWidget( column, isManual );
|
updateManualWidget( column, isManual );
|
||||||
refreshMergedValue( column );
|
refreshMergedValue( column );
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user