37 #include "qgsnative.h"
76 #include <QDesktopServices>
77 #include <QTableWidgetItem>
78 #include <QHeaderView>
79 #include <QTextStream>
81 #include <QFileDialog>
82 #include <QMessageBox>
84 #include <QLinearGradient>
85 #include <QPainterPath>
87 #include <QColorDialog>
89 #include <QMouseEvent>
94 #include <QRegularExpressionValidator>
95 #include <QRegularExpression>
100 , TRSTRING_NOT_SET( tr(
"Not Set" ) )
101 , mDefaultStandardDeviation( 0 )
102 , mDefaultRedBand( 0 )
103 , mDefaultGreenBand( 0 )
104 , mDefaultBlueBand( 0 )
106 , mGradientHeight( 0.0 )
107 , mGradientWidth( 0.0 )
108 , mMapCanvas( canvas )
109 , mMetadataFilled( false )
111 mGrayMinimumMaximumEstimated =
true;
112 mRGBMinimumMaximumEstimated =
true;
117 mOptsPage_Information->layout()->addWidget( mMetadataViewer );
119 mRasterTransparencyWidget =
new QgsRasterTransparencyWidget( mRasterLayer, canvas,
this );
121 transparencyScrollArea->setWidget( mRasterTransparencyWidget );
123 connect( buttonBuildPyramids, &QPushButton::clicked,
this, &QgsRasterLayerProperties::buttonBuildPyramids_clicked );
125 connect( mRenderTypeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged );
126 connect( mResetColorRenderingBtn, &QToolButton::clicked,
this, &QgsRasterLayerProperties::mResetColorRenderingBtn_clicked );
127 connect( buttonRemoveMetadataUrl, &QPushButton::clicked,
this, &QgsRasterLayerProperties::removeSelectedMetadataUrl );
128 connect( buttonAddMetadataUrl, &QPushButton::clicked,
this, &QgsRasterLayerProperties::addMetadataUrl );
133 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsRasterLayerProperties::showHelp );
135 mSourceGroupBox->hide();
137 mBtnStyle =
new QPushButton( tr(
"Style" ) );
138 QMenu *menuStyle =
new QMenu(
this );
139 menuStyle->addAction( tr(
"Load Style…" ),
this, &QgsRasterLayerProperties::loadStyle_clicked );
140 menuStyle->addAction( tr(
"Save Style…" ),
this, &QgsRasterLayerProperties::saveStyleAs_clicked );
141 menuStyle->addSeparator();
142 menuStyle->addAction( tr(
"Save as Default" ),
this, &QgsRasterLayerProperties::saveDefaultStyle_clicked );
143 menuStyle->addAction( tr(
"Restore Default" ),
this, &QgsRasterLayerProperties::loadDefaultStyle_clicked );
144 mBtnStyle->setMenu( menuStyle );
145 connect( menuStyle, &QMenu::aboutToShow,
this, &QgsRasterLayerProperties::aboutToShowStyleMenu );
146 buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );
148 mBtnMetadata =
new QPushButton( tr(
"Metadata" ),
this );
149 QMenu *menuMetadata =
new QMenu(
this );
150 mActionLoadMetadata = menuMetadata->addAction( tr(
"Load Metadata…" ),
this, &QgsRasterLayerProperties::loadMetadata );
151 mActionSaveMetadataAs = menuMetadata->addAction( tr(
"Save Metadata…" ),
this, &QgsRasterLayerProperties::saveMetadataAs );
152 menuMetadata->addSeparator();
153 menuMetadata->addAction( tr(
"Save as Default" ),
this, &QgsRasterLayerProperties::saveDefaultMetadata );
154 menuMetadata->addAction( tr(
"Restore Default" ),
this, &QgsRasterLayerProperties::loadDefaultMetadata );
155 mBtnMetadata->setMenu( menuMetadata );
156 buttonBox->addButton( mBtnMetadata, QDialogButtonBox::ResetRole );
160 connect(
this, &QDialog::accepted,
this, &QgsRasterLayerProperties::apply );
161 connect(
this, &QDialog::rejected,
this, &QgsRasterLayerProperties::onCancel );
163 connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked,
this, &QgsRasterLayerProperties::apply );
166 connect( mSliderBrightness, &QAbstractSlider::valueChanged, mBrightnessSpinBox, &QSpinBox::setValue );
167 connect( mBrightnessSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mSliderBrightness, &QAbstractSlider::setValue );
168 mBrightnessSpinBox->setClearValue( 0 );
170 connect( mSliderContrast, &QAbstractSlider::valueChanged, mContrastSpinBox, &QSpinBox::setValue );
171 connect( mContrastSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mSliderContrast, &QAbstractSlider::setValue );
172 mContrastSpinBox->setClearValue( 0 );
175 connect( mSliderGamma, &QAbstractSlider::valueChanged,
this, &QgsRasterLayerProperties::updateGammaSpinBox );
176 connect( mGammaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterLayerProperties::updateGammaSlider );
177 mGammaSpinBox->setClearValue( 1.0 );
180 connect( sliderSaturation, &QAbstractSlider::valueChanged, spinBoxSaturation, &QSpinBox::setValue );
181 connect( spinBoxSaturation,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), sliderSaturation, &QAbstractSlider::setValue );
182 spinBoxSaturation->setClearValue( 0 );
185 connect( sliderColorizeStrength, &QAbstractSlider::valueChanged, spinColorizeStrength, &QSpinBox::setValue );
186 connect( spinColorizeStrength,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), sliderColorizeStrength, &QAbstractSlider::setValue );
187 spinColorizeStrength->setClearValue( 100 );
190 connect( comboGrayscale,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterLayerProperties::toggleSaturationControls );
193 connect( mColorizeCheck, &QAbstractButton::toggled,
this, &QgsRasterLayerProperties::toggleColorizeControls );
196 connect( lbxPyramidResolutions, &QListWidget::itemSelectionChanged,
this, &QgsRasterLayerProperties::toggleBuildPyramidsButton );
198 connect( mRefreshLayerCheckBox, &QCheckBox::toggled, mRefreshLayerIntervalSpinBox, &QDoubleSpinBox::setEnabled );
201 mScaleRangeWidget->setMapCanvas( mMapCanvas );
206 tableViewMetadataUrl->setSelectionMode( QAbstractItemView::SingleSelection );
207 tableViewMetadataUrl->setSelectionBehavior( QAbstractItemView::SelectRows );
208 tableViewMetadataUrl->horizontalHeader()->setStretchLastSection(
true );
209 tableViewMetadataUrl->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
211 mMetadataUrlModel =
new QStandardItemModel( tableViewMetadataUrl );
212 mMetadataUrlModel->clear();
213 mMetadataUrlModel->setColumnCount( 3 );
214 QStringList metadataUrlHeaders;
215 metadataUrlHeaders << tr(
"URL" ) << tr(
"Type" ) << tr(
"Format" );
216 mMetadataUrlModel->setHorizontalHeaderLabels( metadataUrlHeaders );
217 tableViewMetadataUrl->setModel( mMetadataUrlModel );
218 tableViewMetadataUrl->setItemDelegate(
new MetadataUrlItemDelegate(
this ) );
225 mRasterTransparencyWidget->pbnAddValuesFromDisplay->setIcon(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionContextHelp.png" ) ) );
228 mRasterTransparencyWidget->pbnImportTransparentPixelValues->setIcon(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionFileOpen.svg" ) ) );
229 mRasterTransparencyWidget->pbnExportTransparentPixelValues->setIcon(
QgsApplication::getThemeIcon( QStringLiteral(
"/mActionFileSave.svg" ) ) );
237 mBackupCrs = mRasterLayer->
crs();
240 if ( mMapCanvas && mRasterTransparencyWidget->pixelSelectorTool() )
252 connect( mRasterTransparencyWidget->pbnAddValuesFromDisplay, &QPushButton::clicked,
this, [ = ]
258 mMapCanvas->window()->raise();
259 mMapCanvas->window()->activateWindow();
260 mMapCanvas->window()->setFocus();
277 cboResamplingMethod->clear();
280 for (
const QPair<QString, QString> &method : std::as_const( constProviderType ) )
282 cboResamplingMethod->addItem( method.second, method.first );
286 QString prefix = provider->
name() +
"/driverOptions/_pyramids/";
288 QString defaultMethod = mySettings.
value( prefix +
"resampling",
"AVERAGE" ).toString();
289 int idx = cboResamplingMethod->findData( defaultMethod );
291 cboResamplingMethod->setCurrentIndex( idx );
295 const QList< QgsRasterPyramid > myPyramidList = provider->
buildPyramidList();
299 if ( pyramid.getExists() )
301 lbxPyramidResolutions->addItem(
new QListWidgetItem( myPyramidPixmap,
302 QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) +
303 QString::number( pyramid.getYDim() ) ) );
307 lbxPyramidResolutions->addItem(
new QListWidgetItem( myNoPyramidPixmap,
308 QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) +
309 QString::number( pyramid.getYDim() ) ) );
316 mOptsPage_Pyramids->setEnabled(
false );
325 mOptsPage_Histogram->setEnabled(
false );
328 QVBoxLayout *layout =
new QVBoxLayout( metadataFrame );
329 layout->setContentsMargins( 0, 0, 0, 0 );
331 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
333 layout->addWidget( mMetadataWidget );
334 metadataFrame->setLayout( layout );
336 QVBoxLayout *temporalLayout =
new QVBoxLayout( temporalFrame );
337 temporalLayout->setContentsMargins( 0, 0, 0, 0 );
339 temporalLayout->addWidget( mTemporalWidget );
343 mCrsSelector->setCrs( mRasterLayer->
crs() );
346 QString pyramidFormat( QStringLiteral(
"<h2>%1</h2><p>%2 %3 %4</p><b><font color='red'><p>%5</p><p>%6</p>" ) );
347 QString pyramidHeader = tr(
"Description" );
348 QString pyramidSentence1 = tr(
"Large resolution raster layers can slow navigation in QGIS." );
349 QString pyramidSentence2 = tr(
"By creating lower resolution copies of the data (pyramids) performance can be considerably improved as QGIS selects the most suitable resolution to use depending on the level of zoom." );
350 QString pyramidSentence3 = tr(
"You must have write access in the directory where the original data is stored to build pyramids." );
351 QString pyramidSentence4 = tr(
"Please note that building internal pyramids may alter the original data file and once created they cannot be removed!" );
352 QString pyramidSentence5 = tr(
"Please note that building internal pyramids could corrupt your image - always make a backup of your data first!" );
354 tePyramidDescription->setHtml( pyramidFormat.arg( pyramidHeader,
359 pyramidSentence5 ) );
362 mResamplingGroupBox->setSaveCheckedState(
true );
363 mResamplingUtils.initWidgets( mRasterLayer, mZoomedInResamplingComboBox, mZoomedOutResamplingComboBox, mMaximumOversamplingSpinBox, mCbEarlyResampling );
364 mResamplingUtils.refreshWidgetsFromLayer();
368 btnColorizeColor->setColorDialogTitle( tr(
"Select Color" ) );
369 btnColorizeColor->setContext( QStringLiteral(
"symbology" ) );
374 if ( hueSaturationFilter )
376 sliderSaturation->setValue( hueSaturationFilter->
saturation() );
377 comboGrayscale->setCurrentIndex( (
int ) hueSaturationFilter->
grayscaleMode() );
380 toggleSaturationControls(
static_cast<int>( hueSaturationFilter->
grayscaleMode() ) );
383 mColorizeCheck->setChecked( hueSaturationFilter->
colorizeOn() );
384 btnColorizeColor->setColor( hueSaturationFilter->
colorizeColor() );
385 toggleColorizeControls( hueSaturationFilter->
colorizeOn() );
386 sliderColorizeStrength->setValue( hueSaturationFilter->
colorizeStrength() );
387 mInvertColorsCheck->setChecked( hueSaturationFilter->
invertColors() );
392 mBlendModeComboBox->setBlendMode( mRasterLayer->
blendMode() );
397 mRasterTransparencyWidget->cboxTransparencyBand->setShowNotSetOption(
true, tr(
"None" ) );
398 mRasterTransparencyWidget->cboxTransparencyBand->setLayer( mRasterLayer );
407 cboxTransparencyBand->setCurrentIndex( cboxTransparencyBand->findData( renderer->
alphaBand() ) );
414 mHistogramWidget =
nullptr;
415 if ( mOptsPage_Histogram->isEnabled() )
418 mHistogramStackedWidget->addWidget( mHistogramWidget );
431 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
433 for (
const QString &name : constRenderersList )
444 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
449 QString rendererType = renderer->
type();
450 widgetIndex = mRenderTypeComboBox->findData( rendererType );
451 if ( widgetIndex != -1 )
453 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
454 mRenderTypeComboBox->setCurrentIndex( widgetIndex );
455 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
458 if ( rendererType == QLatin1String(
"singlebandcolordata" ) && mRenderTypeComboBox->count() == 1 )
461 QSizePolicy sizep = mBandRenderingGrpBx->sizePolicy();
462 sizep.setVerticalStretch( 0 );
463 sizep.setVerticalPolicy( QSizePolicy::Maximum );
464 mBandRenderingGrpBx->setSizePolicy( sizep );
465 mBandRenderingGrpBx->updateGeometry();
468 if ( mRasterLayer->
providerType() != QLatin1String(
"wms" ) )
470 mWMSPrintGroupBox->hide();
471 mPublishDataSourceUrlCheckBox->hide();
472 mBackgroundLayerCheckBox->hide();
479 const int horizontalDpi = logicalDpiX();
482 if ( horizontalDpi > 96 )
484 mMetadataViewer->setZoomFactor( mMetadataViewer->zoomFactor() * 0.9 );
486 mMetadataViewer->page()->setLinkDelegationPolicy( QWebPage::LinkDelegationPolicy::DelegateAllLinks );
487 connect( mMetadataViewer->page(), &QWebPage::linkClicked,
this, &QgsRasterLayerProperties::urlClicked );
488 mMetadataViewer->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled,
true );
489 mMetadataViewer->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled,
true );
495 mRenderTypeComboBox_currentIndexChanged( widgetIndex );
503 if ( !settings.
contains( QStringLiteral(
"/Windows/RasterLayerProperties/tab" ) ) )
505 settings.
setValue( QStringLiteral(
"Windows/RasterLayerProperties/tab" ),
511 QString title = tr(
"Layer Properties — %1" ).arg( lyr->
name() );
519 mOptsPage_Information->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#information-properties" ) );
520 mOptsPage_Source->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#source-properties" ) );
521 mOptsPage_Style->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#symbology-properties" ) );
522 mOptsPage_Transparency->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#transparency-properties" ) );
524 if ( mOptsPage_Histogram )
525 mOptsPage_Histogram->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#histogram-properties" ) );
527 mOptsPage_Rendering->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#rendering-properties" ) );
529 if ( mOptsPage_Pyramids )
530 mOptsPage_Pyramids->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#pyramids-properties" ) );
532 mOptsPage_Metadata->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#metadata-properties" ) );
533 mOptsPage_Legend->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#legend-properties" ) );
534 mOptsPage_Server->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#server-properties" ) );
549 mLayerPropertiesPages << page;
552 if ( beforePage.isEmpty() )
570 void QgsRasterLayerProperties::setRendererWidget(
const QString &rendererName )
583 opacity = oldRenderer->
opacity();
592 QgsDebugMsgLevel( QStringLiteral(
"renderer has widgetCreateFunction" ), 3 );
595 if ( oldWidget && ( !oldRenderer || rendererName != oldRenderer->
type() ) )
597 if ( rendererName == QLatin1String(
"singlebandgray" ) )
600 whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
602 else if ( rendererName == QLatin1String(
"multibandcolor" ) )
605 whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
613 mRendererStackedWidget->addWidget( mRendererWidget );
617 std::unique_ptr<QgsRasterRenderer> oldRenderer;
618 oldRenderer.reset( oldWidget->
renderer() );
619 std::unique_ptr<QgsRasterRenderer> newRenderer;
620 newRenderer.reset( mRendererWidget->
renderer() );
621 const QList<int> oldBands = oldRenderer->
usesBands();
622 const QList<int> newBands = newRenderer->usesBands();
623 if ( oldBands != newBands )
625 mRasterTransparencyWidget->syncToLayer();
631 const int widgetIndex = mRenderTypeComboBox->findData( rendererName );
632 if ( widgetIndex != -1 )
634 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
635 mRenderTypeComboBox->setCurrentIndex( widgetIndex );
636 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
639 if ( mRendererWidget != oldWidget )
642 if ( mHistogramWidget )
648 void QgsRasterLayerProperties::sync()
652 if ( !mSourceWidget )
657 QHBoxLayout *layout =
new QHBoxLayout();
658 layout->addWidget( mSourceWidget );
659 mSourceGroupBox->setLayout( layout );
660 mSourceGroupBox->show();
664 buttonBox->button( QDialogButtonBox::Apply )->setEnabled( isValid );
665 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( isValid );
683 mRasterTransparencyWidget->gboxNoDataValue->setEnabled(
false );
684 mRasterTransparencyWidget->gboxCustomTransparency->setEnabled(
false );
685 mOptionsStackedWidget->setCurrentWidget( mOptsPage_Server );
691 if ( mOptsPage_Pyramids )
693 delete mOptsPage_Pyramids;
694 mOptsPage_Pyramids =
nullptr;
700 if ( mOptsPage_Histogram )
702 delete mOptsPage_Histogram;
703 mOptsPage_Histogram =
nullptr;
704 delete mHistogramWidget;
705 mHistogramWidget =
nullptr;
717 if ( brightnessFilter )
719 mSliderBrightness->setValue( brightnessFilter->
brightness() );
720 mSliderContrast->setValue( brightnessFilter->
contrast() );
721 mGammaSpinBox->setValue( brightnessFilter->
gamma() );
727 if ( hueSaturationFilter )
729 sliderSaturation->setValue( hueSaturationFilter->
saturation() );
730 comboGrayscale->setCurrentIndex( (
int ) hueSaturationFilter->
grayscaleMode() );
733 toggleSaturationControls(
static_cast<int>( hueSaturationFilter->
grayscaleMode() ) );
736 mColorizeCheck->setChecked( hueSaturationFilter->
colorizeOn() );
737 btnColorizeColor->setColor( hueSaturationFilter->
colorizeColor() );
738 toggleColorizeControls( hueSaturationFilter->
colorizeOn() );
739 sliderColorizeStrength->setValue( hueSaturationFilter->
colorizeStrength() );
740 mInvertColorsCheck->setChecked( hueSaturationFilter->
invertColors() );
753 mLayerOrigNameLineEd->setText( mRasterLayer->
name() );
760 updateInformationContent();
763 mLayerShortNameLineEdit->setText( mRasterLayer->
shortName() );
766 mLayerShortNameLineEdit->setValidator( shortNameValidator );
769 mLayerTitleLineEdit->setText( mRasterLayer->
title() );
770 mLayerAbstractTextEdit->setPlainText( mRasterLayer->
abstract() );
771 mLayerKeywordListLineEdit->setText( mRasterLayer->
keywordList() );
772 mLayerDataUrlLineEdit->setText( mRasterLayer->
dataUrl() );
773 mLayerDataUrlFormatComboBox->setCurrentIndex(
774 mLayerDataUrlFormatComboBox->findText(
780 mLayerAttributionLineEdit->setText( mRasterLayer->
attribution() );
781 mLayerAttributionUrlLineEdit->setText( mRasterLayer->
attributionUrl() );
787 const int row = mMetadataUrlModel->rowCount();
788 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( metaUrl.url ) );
789 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( metaUrl.type ) );
790 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( metaUrl.format ) );
794 mLayerLegendUrlLineEdit->setText( mRasterLayer->
legendUrl() );
795 mLayerLegendUrlFormatComboBox->setCurrentIndex( mLayerLegendUrlFormatComboBox->findText( mRasterLayer->
legendUrlFormat() ) );
798 QVariant wmsPrintLayer = mRasterLayer->
customProperty( QStringLiteral(
"WMSPrintLayer" ) );
799 if ( wmsPrintLayer.isValid() )
801 mWMSPrintLayerLineEdit->setText( wmsPrintLayer.toString() );
804 QVariant wmsPublishDataSourceUrl = mRasterLayer->
customProperty( QStringLiteral(
"WMSPublishDataSourceUrl" ),
false );
805 mPublishDataSourceUrlCheckBox->setChecked( wmsPublishDataSourceUrl.toBool() );
807 QVariant wmsBackgroundLayer = mRasterLayer->
customProperty( QStringLiteral(
"WMSBackgroundLayer" ),
false );
808 mBackgroundLayerCheckBox->setChecked( wmsBackgroundLayer.toBool() );
810 mLegendPlaceholderWidget->setLastPathSettingsKey( QStringLiteral(
"lastLegendPlaceholderDir" ) );
812 mLegendConfigEmbeddedWidget->setLayer( mRasterLayer );
817 updateDataDefinedButtons();
821 page->syncToLayer( mRasterLayer );
826 void QgsRasterLayerProperties::apply()
830 const QString newSource = mSourceWidget->
sourceUri();
831 if ( newSource != mRasterLayer->
source() )
838 if ( !mRasterLayer->
isValid() )
852 mLegendConfigEmbeddedWidget->applyToLayer();
873 if (
"" != mRasterTransparencyWidget->leNoDataValue->text() )
875 bool myDoubleOk =
false;
880 myNoDataRangeList << myNoDataRange;
883 for (
int bandNo = 1; bandNo <= mRasterLayer->
dataProvider()->bandCount(); bandNo++ )
891 if ( rendererWidget )
898 mBackupCrs = mRasterLayer->
crs();
900 mMetadataFilled =
false;
904 if ( rasterRenderer )
906 rasterRenderer->
setAlphaBand( mRasterTransparencyWidget->cboxTransparencyBand->currentBand() );
907 rasterRenderer->
setNodataColor( mRasterTransparencyWidget->mNodataColorButton->color() );
911 if ( mRasterTransparencyWidget->tableTransparency->columnCount() == 4 )
914 QList<QgsRasterTransparency::TransparentThreeValuePixel> myTransparentThreeValuePixelList;
915 for (
int myListRunner = 0; myListRunner < mRasterTransparencyWidget->tableTransparency->rowCount(); myListRunner++ )
917 myTransparentPixel.
red = transparencyCellValue( myListRunner, 0 );
918 myTransparentPixel.
green = transparencyCellValue( myListRunner, 1 );
919 myTransparentPixel.
blue = transparencyCellValue( myListRunner, 2 );
921 myTransparentThreeValuePixelList.append( myTransparentPixel );
925 else if ( mRasterTransparencyWidget->tableTransparency->columnCount() == 3 )
928 QList<QgsRasterTransparency::TransparentSingleValuePixel> myTransparentSingleValuePixelList;
929 for (
int myListRunner = 0; myListRunner < mRasterTransparencyWidget->tableTransparency->rowCount(); myListRunner++ )
931 myTransparentPixel.
min = transparencyCellValue( myListRunner, 0 );
932 myTransparentPixel.
max = transparencyCellValue( myListRunner, 1 );
935 myTransparentSingleValuePixelList.append( myTransparentPixel );
946 rasterRenderer->
setOpacity( mRasterTransparencyWidget->mOpacityWidget->opacity() );
953 mRasterLayer->
setName( mLayerOrigNameLineEd->text() );
968 mResamplingUtils.refreshLayerFromWidgets();
972 if ( hueSaturationFilter )
974 hueSaturationFilter->
setSaturation( sliderSaturation->value() );
976 hueSaturationFilter->
setColorizeOn( mColorizeCheck->checkState() );
979 hueSaturationFilter->
setInvertColors( mInvertColorsCheck->isChecked() );
983 mRasterLayer->
setBlendMode( mBlendModeComboBox->blendMode() );
988 mRasterLayer->
setCrs( mCrsSelector->crs() );
990 if ( mRasterLayer->
shortName() != mLayerShortNameLineEdit->text() )
991 mMetadataFilled =
false;
992 mRasterLayer->
setShortName( mLayerShortNameLineEdit->text() );
994 if ( mRasterLayer->
title() != mLayerTitleLineEdit->text() )
995 mMetadataFilled =
false;
996 mRasterLayer->
setTitle( mLayerTitleLineEdit->text() );
998 if ( mRasterLayer->
abstract() != mLayerAbstractTextEdit->toPlainText() )
999 mMetadataFilled =
false;
1000 mRasterLayer->
setAbstract( mLayerAbstractTextEdit->toPlainText() );
1002 if ( mRasterLayer->
keywordList() != mLayerKeywordListLineEdit->text() )
1003 mMetadataFilled =
false;
1004 mRasterLayer->
setKeywordList( mLayerKeywordListLineEdit->text() );
1006 if ( mRasterLayer->
dataUrl() != mLayerDataUrlLineEdit->text() )
1007 mMetadataFilled =
false;
1008 mRasterLayer->
setDataUrl( mLayerDataUrlLineEdit->text() );
1010 if ( mRasterLayer->
dataUrlFormat() != mLayerDataUrlFormatComboBox->currentText() )
1011 mMetadataFilled =
false;
1012 mRasterLayer->
setDataUrlFormat( mLayerDataUrlFormatComboBox->currentText() );
1015 if ( mRasterLayer->
attribution() != mLayerAttributionLineEdit->text() )
1016 mMetadataFilled =
false;
1017 mRasterLayer->
setAttribution( mLayerAttributionLineEdit->text() );
1019 if ( mRasterLayer->
attributionUrl() != mLayerAttributionUrlLineEdit->text() )
1020 mMetadataFilled =
false;
1024 QList<QgsMapLayerServerProperties::MetadataUrl> metaUrls;
1025 for (
int row = 0; row < mMetadataUrlModel->rowCount() ; row++ )
1028 metaUrl.
url = mMetadataUrlModel->item( row, 0 )->text();
1029 metaUrl.
type = mMetadataUrlModel->item( row, 1 )->text();
1030 metaUrl.
format = mMetadataUrlModel->item( row, 2 )->text();
1031 metaUrls.append( metaUrl );
1032 mMetadataFilled =
false;
1036 if ( mRasterLayer->
legendUrl() != mLayerLegendUrlLineEdit->text() )
1037 mMetadataFilled =
false;
1038 mRasterLayer->
setLegendUrl( mLayerLegendUrlLineEdit->text() );
1040 if ( mRasterLayer->
legendUrlFormat() != mLayerLegendUrlFormatComboBox->currentText() )
1041 mMetadataFilled =
false;
1044 if ( !mWMSPrintLayerLineEdit->text().isEmpty() )
1046 mRasterLayer->
setCustomProperty( QStringLiteral(
"WMSPrintLayer" ), mWMSPrintLayerLineEdit->text() );
1049 mRasterLayer->
setCustomProperty(
"WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
1050 mRasterLayer->
setCustomProperty(
"WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );
1064 void QgsRasterLayerProperties::buttonBuildPyramids_clicked()
1076 for (
int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
1078 QListWidgetItem *myItem = lbxPyramidResolutions->item( myCounterInt );
1080 myPyramidList[myCounterInt].setBuild( myItem->isSelected() || myPyramidList[myCounterInt].getExists() );
1084 QString prefix = provider->
name() +
"/driverOptions/_pyramids/";
1086 QString resamplingMethod( cboResamplingMethod->currentData().toString() );
1087 mySettings.
setValue( prefix +
"resampling", resamplingMethod );
1094 QApplication::setOverrideCursor( Qt::WaitCursor );
1101 QApplication::restoreOverrideCursor();
1102 mPyramidProgress->setValue( 0 );
1103 buttonBuildPyramids->setEnabled(
false );
1104 if ( !res.isNull() )
1106 if ( res == QLatin1String(
"CANCELED" ) )
1110 else if ( res == QLatin1String(
"ERROR_WRITE_ACCESS" ) )
1112 QMessageBox::warning(
this, tr(
"Building Pyramids" ),
1113 tr(
"Write access denied. Adjust the file permissions and try again." ) );
1115 else if ( res == QLatin1String(
"ERROR_WRITE_FORMAT" ) )
1117 QMessageBox::warning(
this, tr(
"Building Pyramids" ),
1118 tr(
"The file was not writable. Some formats do not "
1119 "support pyramid overviews. Consult the GDAL documentation if in doubt." ) );
1121 else if ( res == QLatin1String(
"FAILED_NOT_SUPPORTED" ) )
1123 QMessageBox::warning(
this, tr(
"Building Pyramids" ),
1124 tr(
"Building pyramid overviews is not supported on this type of raster." ) );
1126 else if ( res == QLatin1String(
"ERROR_JPEG_COMPRESSION" ) )
1128 QMessageBox::warning(
this, tr(
"Building Pyramids" ),
1129 tr(
"Building internal pyramid overviews is not supported on raster layers with JPEG compression and your current libtiff library." ) );
1131 else if ( res == QLatin1String(
"ERROR_VIRTUAL" ) )
1133 QMessageBox::warning(
this, tr(
"Building Pyramids" ),
1134 tr(
"Building pyramid overviews is not supported on this type of raster." ) );
1142 lbxPyramidResolutions->clear();
1150 if ( pyramid.getExists() )
1152 lbxPyramidResolutions->addItem(
new QListWidgetItem( myPyramidPixmap,
1153 QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) +
1154 QString::number( pyramid.getYDim() ) ) );
1158 lbxPyramidResolutions->addItem(
new QListWidgetItem( myNoPyramidPixmap,
1159 QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) +
1160 QString::number( pyramid.getYDim() ) ) );
1169 updateInformationContent();
1172 void QgsRasterLayerProperties::urlClicked(
const QUrl &url )
1174 QFileInfo file( url.toLocalFile() );
1175 if ( file.exists() && !file.isDir() )
1178 QDesktopServices::openUrl( url );
1181 void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged(
int index )
1183 if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged || ! mRasterLayer->renderer() )
1188 QString rendererName = mRenderTypeComboBox->itemData( index ).toString();
1189 setRendererWidget( rendererName );
1199 void QgsRasterLayerProperties::setTransparencyCell(
int row,
int column,
double value )
1201 QgsDebugMsgLevel( QStringLiteral(
"value = %1" ).arg( value, 0,
'g', 17 ), 3 );
1203 if ( !provider )
return;
1206 if ( !renderer )
return;
1207 int nBands = renderer->
usesBands().size();
1209 QLineEdit *lineEdit =
new QLineEdit();
1210 lineEdit->setFrame(
false );
1212 lineEdit->setContentsMargins( 1, 1, 1, 1 );
1214 if ( column == mRasterTransparencyWidget->tableTransparency->columnCount() - 1 )
1218 lineEdit->setValidator(
new QIntValidator(
nullptr ) );
1219 lineEdit->setText( QString::number(
static_cast<int>( value ) ) );
1224 QString valueString;
1230 if ( !std::isnan( value ) )
1233 valueString = QLocale().toString( v,
'g' ) ;
1237 lineEdit->setValidator(
new QIntValidator(
nullptr ) );
1238 if ( !std::isnan( value ) )
1240 valueString = QLocale().toString(
static_cast<int>( value ) );
1244 lineEdit->setText( valueString );
1246 mRasterTransparencyWidget->tableTransparency->setCellWidget( row, column, lineEdit );
1247 adjustTransparencyCellWidth( row, column );
1249 if ( nBands == 1 && ( column == 0 || column == 1 ) )
1251 connect( lineEdit, &QLineEdit::textEdited,
this, &QgsRasterLayerProperties::transparencyCellTextEdited );
1253 mRasterTransparencyWidget->tableTransparency->resizeColumnsToContents();
1256 void QgsRasterLayerProperties::setTransparencyCellValue(
int row,
int column,
double value )
1258 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( mRasterTransparencyWidget->tableTransparency->cellWidget( row, column ) );
1259 if ( !lineEdit )
return;
1261 lineEdit->setText( QLocale().toString( v,
'g' ) );
1262 lineEdit->adjustSize();
1263 adjustTransparencyCellWidth( row, column );
1264 mRasterTransparencyWidget->tableTransparency->resizeColumnsToContents();
1267 double QgsRasterLayerProperties::transparencyCellValue(
int row,
int column )
1269 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( mRasterTransparencyWidget->tableTransparency->cellWidget( row, column ) );
1270 if ( !lineEdit || lineEdit->text().isEmpty() )
1272 return std::numeric_limits<double>::quiet_NaN();
1274 return QLocale().toDouble( lineEdit->text() );
1277 void QgsRasterLayerProperties::adjustTransparencyCellWidth(
int row,
int column )
1279 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( mRasterTransparencyWidget->tableTransparency->cellWidget( row, column ) );
1280 if ( !lineEdit )
return;
1282 int width = std::max( lineEdit->fontMetrics().boundingRect( lineEdit->text() ).width() + 10, 100 );
1283 width = std::max( width, mRasterTransparencyWidget->tableTransparency->columnWidth( column ) );
1285 lineEdit->setFixedWidth( width );
1288 void QgsRasterLayerProperties::transparencyCellTextEdited(
const QString &text )
1297 int nBands = renderer->
usesBands().size();
1300 QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
1301 if ( !lineEdit )
return;
1304 for (
int r = 0; r < mRasterTransparencyWidget->tableTransparency->rowCount(); r++ )
1306 for (
int c = 0;
c < mRasterTransparencyWidget->tableTransparency->columnCount();
c++ )
1308 if ( mRasterTransparencyWidget->tableTransparency->cellWidget( r,
c ) == sender() )
1315 if ( row != -1 )
break;
1317 QgsDebugMsgLevel( QStringLiteral(
"row = %1 column =%2" ).arg( row ).arg( column ), 3 );
1321 QLineEdit *toLineEdit =
dynamic_cast<QLineEdit *
>( mRasterTransparencyWidget->tableTransparency->cellWidget( row, 1 ) );
1322 if ( !toLineEdit )
return;
1323 bool toChanged = mTransparencyToEdited.value( row );
1324 QgsDebugMsgLevel( QStringLiteral(
"toChanged = %1" ).arg( toChanged ), 3 );
1327 toLineEdit->setText( lineEdit->text() );
1330 else if ( column == 1 )
1332 setTransparencyToEdited( row );
1337 void QgsRasterLayerProperties::aboutToShowStyleMenu()
1341 QMenu *m = qobject_cast<QMenu *>( sender() );
1349 void QgsRasterLayerProperties::syncToLayer()
1354 setRendererWidget( renderer->
type() );
1360 void QgsRasterLayerProperties::setTransparencyToEdited(
int row )
1362 if ( row >= mTransparencyToEdited.size() )
1364 mTransparencyToEdited.resize( row + 1 );
1366 mTransparencyToEdited[row] =
true;
1373 bool isMetadataPanel = ( index ==
mOptStackedWidget->indexOf( mOptsPage_Metadata ) );
1374 mBtnStyle->setVisible( ! isMetadataPanel );
1375 mBtnMetadata->setVisible( isMetadataPanel );
1377 if ( !mHistogramWidget )
1389 if ( index ==
mOptStackedWidget->indexOf( mOptsPage_Information ) || !mMetadataFilled )
1392 updateInformationContent();
1398 button->blockSignals(
true );
1402 button->blockSignals(
false );
1405 void QgsRasterLayerProperties::updateDataDefinedButtons()
1407 const auto propertyOverrideButtons { findChildren< QgsPropertyOverrideButton * >() };
1410 updateDataDefinedButton( button );
1426 void QgsRasterLayerProperties::updateProperty()
1433 void QgsRasterLayerProperties::toggleSaturationControls(
int grayscaleMode )
1436 if ( grayscaleMode == 0 )
1438 sliderSaturation->setEnabled(
true );
1439 spinBoxSaturation->setEnabled(
true );
1443 sliderSaturation->setEnabled(
false );
1444 spinBoxSaturation->setEnabled(
false );
1448 void QgsRasterLayerProperties::toggleColorizeControls(
bool colorizeEnabled )
1451 btnColorizeColor->setEnabled( colorizeEnabled );
1452 sliderColorizeStrength->setEnabled( colorizeEnabled );
1453 spinColorizeStrength->setEnabled( colorizeEnabled );
1457 QLinearGradient QgsRasterLayerProperties::redGradient()
1461 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1462 myGradient.setColorAt( 0.0, QColor( 242, 14, 25, 190 ) );
1463 myGradient.setColorAt( 0.5, QColor( 175, 29, 37, 190 ) );
1464 myGradient.setColorAt( 1.0, QColor( 114, 17, 22, 190 ) );
1467 QLinearGradient QgsRasterLayerProperties::greenGradient()
1471 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1472 myGradient.setColorAt( 0.0, QColor( 48, 168, 5, 190 ) );
1473 myGradient.setColorAt( 0.8, QColor( 36, 122, 4, 190 ) );
1474 myGradient.setColorAt( 1.0, QColor( 21, 71, 2, 190 ) );
1477 QLinearGradient QgsRasterLayerProperties::blueGradient()
1481 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1482 myGradient.setColorAt( 0.0, QColor( 30, 0, 106, 190 ) );
1483 myGradient.setColorAt( 0.2, QColor( 30, 72, 128, 190 ) );
1484 myGradient.setColorAt( 1.0, QColor( 30, 223, 196, 190 ) );
1487 QLinearGradient QgsRasterLayerProperties::grayGradient()
1491 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1492 myGradient.setColorAt( 0.0, QColor( 5, 5, 5, 190 ) );
1493 myGradient.setColorAt( 0.8, QColor( 122, 122, 122, 190 ) );
1494 myGradient.setColorAt( 1.0, QColor( 220, 220, 220, 190 ) );
1497 QLinearGradient QgsRasterLayerProperties::highlightGradient()
1501 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1502 myGradient.setColorAt( 1.0, QColor( 255, 255, 255, 50 ) );
1503 myGradient.setColorAt( 0.5, QColor( 255, 255, 255, 100 ) );
1504 myGradient.setColorAt( 0.0, QColor( 255, 255, 255, 150 ) );
1508 void QgsRasterLayerProperties::addMetadataUrl()
1510 const int row = mMetadataUrlModel->rowCount();
1511 mMetadataUrlModel->setItem( row, 0,
new QStandardItem( QLatin1String() ) );
1512 mMetadataUrlModel->setItem( row, 1,
new QStandardItem( QLatin1String() ) );
1513 mMetadataUrlModel->setItem( row, 2,
new QStandardItem( QLatin1String() ) );
1516 void QgsRasterLayerProperties::removeSelectedMetadataUrl()
1518 const QModelIndexList selectedRows = tableViewMetadataUrl->selectionModel()->selectedRows();
1519 if ( selectedRows.empty() )
1521 mMetadataUrlModel->removeRow( selectedRows[0].row() );
1530 void QgsRasterLayerProperties::loadDefaultStyle_clicked()
1532 bool defaultLoadedFlag =
false;
1535 if ( defaultLoadedFlag )
1542 QMessageBox::information(
this,
1543 tr(
"Default Style" ),
1549 void QgsRasterLayerProperties::saveDefaultStyle_clicked()
1555 bool defaultSavedFlag =
false;
1563 if ( !defaultSavedFlag )
1566 QMessageBox::information(
this,
1567 tr(
"Default Style" ),
1574 void QgsRasterLayerProperties::loadStyle_clicked()
1577 QString lastUsedDir = settings.
value( QStringLiteral(
"style/lastStyleDir" ), QDir::homePath() ).toString();
1579 QString fileName = QFileDialog::getOpenFileName(
1581 tr(
"Load layer properties from style file" ),
1583 tr(
"QGIS Layer Style File" ) +
" (*.qml)" );
1584 if ( fileName.isEmpty() )
1588 if ( !fileName.endsWith( QLatin1String(
".qml" ), Qt::CaseInsensitive ) )
1589 fileName += QLatin1String(
".qml" );
1593 bool defaultLoadedFlag =
false;
1594 QString message = mRasterLayer->
loadNamedStyle( fileName, defaultLoadedFlag );
1595 if ( defaultLoadedFlag )
1597 settings.
setValue( QStringLiteral(
"style/lastStyleDir" ), QFileInfo( fileName ).absolutePath() );
1602 QMessageBox::information(
this, tr(
"Save Style" ), message );
1607 void QgsRasterLayerProperties::saveStyleAs_clicked()
1610 QString lastUsedDir = settings.
value( QStringLiteral(
"style/lastStyleDir" ), QDir::homePath() ).toString();
1612 QString selectedFilter;
1613 QString outputFileName = QFileDialog::getSaveFileName(
1615 tr(
"Save layer properties as style file" ),
1617 tr(
"QGIS Layer Style File" ) +
" (*.qml)" +
";;" + tr(
"Styled Layer Descriptor" ) +
" (*.sld)",
1619 if ( outputFileName.isEmpty() )
1624 if ( selectedFilter.contains( QStringLiteral(
".qml" ), Qt::CaseInsensitive ) )
1627 type = StyleType::QML;
1632 type = StyleType::SLD;
1638 bool defaultLoadedFlag =
false;
1644 message = mRasterLayer->
saveNamedStyle( outputFileName, defaultLoadedFlag );
1649 message = mRasterLayer->
saveSldStyle( outputFileName, defaultLoadedFlag );
1653 if ( defaultLoadedFlag )
1655 settings.
setValue( QStringLiteral(
"style/lastStyleDir" ), QFileInfo( outputFileName ).absolutePath() );
1659 QMessageBox::information(
this, tr(
"Save Style" ), message );
1662 void QgsRasterLayerProperties::restoreWindowModality()
1677 void QgsRasterLayerProperties::loadMetadata()
1680 QString myLastUsedDir = myQSettings.
value( QStringLiteral(
"style/lastStyleDir" ), QDir::homePath() ).toString();
1682 QString myFileName = QFileDialog::getOpenFileName(
this, tr(
"Load layer metadata from metadata file" ), myLastUsedDir,
1683 tr(
"QGIS Layer Metadata File" ) +
" (*.qmd)" );
1684 if ( myFileName.isNull() )
1690 bool defaultLoadedFlag =
false;
1694 if ( defaultLoadedFlag )
1701 QMessageBox::warning(
this, tr(
"Load Metadata" ), myMessage );
1704 QFileInfo myFI( myFileName );
1705 QString myPath = myFI.path();
1706 myQSettings.
setValue( QStringLiteral(
"style/lastStyleDir" ), myPath );
1711 void QgsRasterLayerProperties::saveMetadataAs()
1714 QString myLastUsedDir = myQSettings.
value( QStringLiteral(
"style/lastStyleDir" ), QDir::homePath() ).toString();
1716 QString myOutputFileName = QFileDialog::getSaveFileName(
this, tr(
"Save Layer Metadata as QMD" ),
1717 myLastUsedDir, tr(
"QMD File" ) +
" (*.qmd)" );
1718 if ( myOutputFileName.isNull() )
1731 bool defaultLoadedFlag =
false;
1732 QString message = mRasterLayer->
saveNamedMetadata( myOutputFileName, defaultLoadedFlag );
1733 if ( defaultLoadedFlag )
1734 myQSettings.
setValue( QStringLiteral(
"style/lastStyleDir" ), QFileInfo( myOutputFileName ).absolutePath() );
1736 QMessageBox::information(
this, tr(
"Save Metadata" ), message );
1739 void QgsRasterLayerProperties::saveDefaultMetadata()
1743 bool defaultSavedFlag =
false;
1745 if ( !defaultSavedFlag )
1747 QMessageBox::warning(
this, tr(
"Default Metadata" ), errorMsg );
1751 void QgsRasterLayerProperties::loadDefaultMetadata()
1753 bool defaultLoadedFlag =
false;
1756 if ( defaultLoadedFlag )
1762 QMessageBox::information(
this, tr(
"Default Metadata" ), myMessage );
1767 void QgsRasterLayerProperties::toggleBuildPyramidsButton()
1769 if ( lbxPyramidResolutions->selectedItems().empty() )
1771 buttonBuildPyramids->setEnabled(
false );
1775 buttonBuildPyramids->setEnabled(
true );
1779 void QgsRasterLayerProperties::mResetColorRenderingBtn_clicked()
1781 mBlendModeComboBox->setBlendMode( QPainter::CompositionMode_SourceOver );
1782 mSliderBrightness->setValue( 0 );
1783 mSliderContrast->setValue( 0 );
1784 mGammaSpinBox->setValue( 1.0 );
1785 sliderSaturation->setValue( 0 );
1787 mColorizeCheck->setChecked(
false );
1788 sliderColorizeStrength->setValue( 100 );
1789 mInvertColorsCheck->setChecked(
false );
1792 bool QgsRasterLayerProperties::rasterIsMultiBandColor()
1797 void QgsRasterLayerProperties::updateInformationContent()
1801 const QString html { mRasterLayer->
htmlMetadata().replace( QLatin1String(
"<head>" ), QStringLiteral( R
"raw(<head><style type="text/css">%1</style>)raw" ) ).arg( myStyle ) };
1802 mMetadataViewer->setHtml( html );
1803 mMetadataFilled = true;
1806 void QgsRasterLayerProperties::onCancel()
1812 QDomDocument doc( QStringLiteral(
"qgis" ) );
1813 int errorLine, errorColumn;
1814 doc.setContent( mOldStyle.
xmlData(),
false, &myMessage, &errorLine, &errorColumn );
1818 if ( mBackupCrs != mRasterLayer->
crs() )
1819 mRasterLayer->
setCrs( mBackupCrs );
1822 void QgsRasterLayerProperties::showHelp()
1824 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property(
"helpPage" );
1826 if ( helpPage.isValid() )
1832 QgsHelp::openHelp( QStringLiteral(
"working_with_raster/raster_properties.html" ) );
1836 void QgsRasterLayerProperties::updateGammaSpinBox(
int value )
1841 void QgsRasterLayerProperties::updateGammaSlider(
double value )