Skip to content
Permalink
Browse files
annot & PC
  • Loading branch information
roya0045 authored and nyalldawson committed Dec 23, 2021
1 parent f41a712 commit d2ff250eda2bf226809c2464928309c36353894d
@@ -78,6 +78,8 @@ QgsAnnotationLayerProperties::QgsAnnotationLayerProperties( QgsAnnotationLayer *

buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );

mBackupCrs = mLayer->crs();

if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
restoreOptionsBaseUi( title );
@@ -113,6 +115,8 @@ void QgsAnnotationLayerProperties::apply()
mLayer->setMaximumScale( mScaleRangeWidget->maximumScale() );
mLayer->setMinimumScale( mScaleRangeWidget->minimumScale() );

mBackupCrs = mLayer->crs();

// set the blend mode and opacity for the layer
mLayer->setBlendMode( mBlendModeComboBox->blendMode() );
mLayer->setOpacity( mOpacityWidget->opacity() );
@@ -128,6 +132,9 @@ void QgsAnnotationLayerProperties::apply()

void QgsAnnotationLayerProperties::onCancel()
{
if ( mBackupCrs != mLayer->crs() )
mLayer->setCrs( mBackupCrs );

if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
{
// need to reset style to previous - style applied directly to the layer (not in apply())
@@ -78,6 +78,8 @@ class QgsAnnotationLayerProperties : public QgsOptionsDialogBase, private Ui::Qg

QList<QgsMapLayerConfigWidget *> mConfigWidgets;

QgsCoordinateReferenceSystem mBackupCrs;

};

#endif // QGSANNOTATIONLAYERPROPERTIES_H
@@ -105,6 +105,8 @@ QgsPointCloudLayerProperties::QgsPointCloudLayerProperties( QgsPointCloudLayer *
mStatisticsTableView->setModel( new QgsPointCloudAttributeStatisticsModel( mLayer, mStatisticsTableView ) );
mStatisticsTableView->verticalHeader()->hide();

mBackupCrs = mLayer->crs();

if ( mLayer->dataProvider() && !mLayer->dataProvider()->metadataClasses( QStringLiteral( "Classification" ) ).isEmpty() )
{
mClassificationStatisticsTableView->setModel( new QgsPointCloudClassificationStatisticsModel( mLayer, QStringLiteral( "Classification" ), mStatisticsTableView ) );
@@ -146,6 +148,7 @@ void QgsPointCloudLayerProperties::apply()
mMetadataWidget->acceptMetadata();

mLayer->setName( mLayerOrigNameLineEdit->text() );
mBackupCrs = mLayer->crs();

for ( QgsMapLayerConfigWidget *w : mConfigWidgets )
w->apply();
@@ -155,6 +158,9 @@ void QgsPointCloudLayerProperties::apply()

void QgsPointCloudLayerProperties::onCancel()
{
if ( mBackupCrs != mLayer->crs() )
mLayer->setCrs( mBackupCrs );

if ( mOldStyle.xmlData() != mLayer->styleManager()->style( mLayer->styleManager()->currentStyle() ).xmlData() )
{
// need to reset style to previous - style applied directly to the layer (not in apply())
@@ -139,6 +139,8 @@ class QgsPointCloudLayerProperties : public QgsOptionsDialogBase, private Ui::Qg

QList<QgsMapLayerConfigWidget *> mConfigWidgets;

QgsCoordinateReferenceSystem mBackupCrs;

};

#endif // QGSPOINTCLOUDLAYERPROPERTIES_H

0 comments on commit d2ff250

Please sign in to comment.