74#include "moc_qgsrasterlayerproperties.cpp"
81#include <QDesktopServices>
82#include <QTableWidgetItem>
89#include <QLinearGradient>
90#include <QPainterPath>
92#include <QColorDialog>
99#include <QRegularExpressionValidator>
100#include <QRegularExpression>
105 , TRSTRING_NOT_SET( tr(
"Not Set" ) )
108 mGrayMinimumMaximumEstimated =
true;
109 mRGBMinimumMaximumEstimated =
true;
114 mOptsPage_Information->layout()->addWidget( mMetadataViewer );
118 transparencyScrollArea->setWidget( mRasterTransparencyWidget );
121 QVBoxLayout *vl =
new QVBoxLayout();
122 vl->setContentsMargins( 0, 0, 0, 0 );
123 vl->addWidget( mLabelingWidget );
124 mOptsPage_Labeling->setLayout( vl );
126 connect( buttonBuildPyramids, &QPushButton::clicked,
this, &QgsRasterLayerProperties::buttonBuildPyramids_clicked );
128 connect( mRenderTypeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged );
129 connect( mResetColorRenderingBtn, &QToolButton::clicked,
this, &QgsRasterLayerProperties::mResetColorRenderingBtn_clicked );
134 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsRasterLayerProperties::showHelp );
136 mSourceGroupBox->hide();
138 mBtnStyle =
new QPushButton( tr(
"Style" ) );
139 buttonBox->addButton(
mBtnStyle, QDialogButtonBox::ResetRole );
153 connect( mSliderBrightness, &QAbstractSlider::valueChanged, mBrightnessSpinBox, &QSpinBox::setValue );
154 connect( mBrightnessSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ), mSliderBrightness, &QAbstractSlider::setValue );
155 mBrightnessSpinBox->setClearValue( 0 );
157 connect( mSliderContrast, &QAbstractSlider::valueChanged, mContrastSpinBox, &QSpinBox::setValue );
158 connect( mContrastSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ), mSliderContrast, &QAbstractSlider::setValue );
159 mContrastSpinBox->setClearValue( 0 );
162 connect( mSliderGamma, &QAbstractSlider::valueChanged,
this, &QgsRasterLayerProperties::updateGammaSpinBox );
163 connect( mGammaSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterLayerProperties::updateGammaSlider );
164 mGammaSpinBox->setClearValue( 1.0 );
167 connect( sliderSaturation, &QAbstractSlider::valueChanged, spinBoxSaturation, &QSpinBox::setValue );
168 connect( spinBoxSaturation,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ), sliderSaturation, &QAbstractSlider::setValue );
169 spinBoxSaturation->setClearValue( 0 );
172 connect( sliderColorizeStrength, &QAbstractSlider::valueChanged, spinColorizeStrength, &QSpinBox::setValue );
173 connect( spinColorizeStrength,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ), sliderColorizeStrength, &QAbstractSlider::setValue );
174 spinColorizeStrength->setClearValue( 100 );
177 connect( comboGrayscale,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterLayerProperties::toggleSaturationControls );
180 connect( mColorizeCheck, &QAbstractButton::toggled,
this, &QgsRasterLayerProperties::toggleColorizeControls );
183 connect( lbxPyramidResolutions, &QListWidget::itemSelectionChanged,
this, &QgsRasterLayerProperties::toggleBuildPyramidsButton );
185 mRefreshSettingsWidget->setLayer( mRasterLayer );
186 mMapLayerServerPropertiesWidget->setHasWfsTitle(
false );
187 mMapLayerServerPropertiesWidget->setServerProperties( mRasterLayer->serverProperties() );
190 mScaleRangeWidget->setMapCanvas(
mCanvas );
205 mEnableMapTips->setChecked( mRasterLayer->mapTipsEnabled() );
207 updateRasterAttributeTableOptionsPage();
211 connect( mCreateRasterAttributeTableButton, &QPushButton::clicked,
this, [
this] {
212 if ( mRasterLayer->canCreateRasterAttributeTable() )
217 if ( dlg.exec() == QDialog::Accepted )
219 updateRasterAttributeTableOptionsPage();
224 connect( mLoadRasterAttributeTableFromFileButton, &QPushButton::clicked,
this, [
this] {
228 if ( dlg.exec() == QDialog::Accepted )
230 updateRasterAttributeTableOptionsPage();
234 mBackupCrs = mRasterLayer->crs();
237 if (
mCanvas && mRasterTransparencyWidget->pixelSelectorTool() )
247 connect( mRasterTransparencyWidget->pbnAddValuesFromDisplay, &QPushButton::clicked,
this, [
this] {
252 mCanvas->window()->raise();
253 mCanvas->window()->activateWindow();
254 mCanvas->window()->setFocus();
260 mContext =
mCanvas->createExpressionContext();
274 connect( mInsertExpressionButton, &QAbstractButton::clicked,
this, [
this] {
276 int selectionStart = mMapTipWidget->selectionStart();
277 int selectionEnd = mMapTipWidget->selectionEnd();
281 exprDlg.setWindowTitle( tr(
"Insert Expression" ) );
282 if ( exprDlg.exec() == QDialog::Accepted && !exprDlg.
expressionText().trimmed().isEmpty() )
283 mMapTipWidget->insertText(
"[%" + exprDlg.
expressionText().trimmed() +
"%]" );
285 mMapTipWidget->setLinearSelection( selectionStart, selectionEnd );
294 cboResamplingMethod->clear();
297 for (
const QPair<QString, QString> &method : std::as_const( constProviderType ) )
299 cboResamplingMethod->addItem( method.second, method.first );
303 QString prefix = provider->name() +
"/driverOptions/_pyramids/";
305 QString defaultMethod = mySettings.
value( prefix +
"resampling",
"AVERAGE" ).toString();
306 int idx = cboResamplingMethod->findData( defaultMethod );
308 cboResamplingMethod->setCurrentIndex( idx );
312 const QList<QgsRasterPyramid> myPyramidList = provider->buildPyramidList();
316 if ( pyramid.getExists() )
318 lbxPyramidResolutions->addItem(
new QListWidgetItem( myPyramidPixmap, QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) + QString::number( pyramid.getYDim() ) ) );
322 lbxPyramidResolutions->addItem(
new QListWidgetItem( myNoPyramidPixmap, QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) + QString::number( pyramid.getYDim() ) ) );
329 mOptsPage_Pyramids->setEnabled(
false );
338 mOptsPage_Histogram->setEnabled(
false );
341 QVBoxLayout *layout =
new QVBoxLayout( metadataFrame );
342 layout->setContentsMargins( 0, 0, 0, 0 );
344 mMetadataWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
345 mMetadataWidget->setMapCanvas(
mCanvas );
346 layout->addWidget( mMetadataWidget );
347 metadataFrame->setLayout( layout );
349 QVBoxLayout *temporalLayout =
new QVBoxLayout( temporalFrame );
350 temporalLayout->setContentsMargins( 0, 0, 0, 0 );
352 temporalLayout->addWidget( mTemporalWidget );
355 QgsDebugMsgLevel(
"Setting crs to " + mRasterLayer->crs().userFriendlyIdentifier(), 2 );
356 mCrsSelector->setCrs( mRasterLayer->crs() );
359 QString pyramidFormat( QStringLiteral(
"<h2>%1</h2><p>%2 %3 %4</p><b><font color='red'><p>%5</p><p>%6</p>" ) );
360 QString pyramidHeader = tr(
"Description" );
361 QString pyramidSentence1 = tr(
"Large resolution raster layers can slow navigation in QGIS." );
362 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." );
363 QString pyramidSentence3 = tr(
"You must have write access in the directory where the original data is stored to build pyramids." );
364 QString pyramidSentence4 = tr(
"Please note that building internal pyramids may alter the original data file and once created they cannot be removed!" );
365 QString pyramidSentence5 = tr(
"Please note that building internal pyramids could corrupt your image - always make a backup of your data first!" );
367 tePyramidDescription->setHtml( pyramidFormat.arg( pyramidHeader, pyramidSentence1, pyramidSentence2, pyramidSentence3, pyramidSentence4, pyramidSentence5 ) );
370 mResamplingGroupBox->setSaveCheckedState(
true );
371 mResamplingUtils.initWidgets( mRasterLayer, mZoomedInResamplingComboBox, mZoomedOutResamplingComboBox, mMaximumOversamplingSpinBox, mCbEarlyResampling );
372 mResamplingUtils.refreshWidgetsFromLayer();
376 btnColorizeColor->setColorDialogTitle( tr(
"Select Color" ) );
377 btnColorizeColor->setContext( QStringLiteral(
"symbology" ) );
382 if ( hueSaturationFilter )
384 sliderSaturation->setValue( hueSaturationFilter->
saturation() );
385 comboGrayscale->setCurrentIndex( (
int ) hueSaturationFilter->
grayscaleMode() );
388 toggleSaturationControls(
static_cast<int>( hueSaturationFilter->
grayscaleMode() ) );
391 mColorizeCheck->setChecked( hueSaturationFilter->
colorizeOn() );
392 btnColorizeColor->setColor( hueSaturationFilter->
colorizeColor() );
393 toggleColorizeControls( hueSaturationFilter->
colorizeOn() );
394 sliderColorizeStrength->setValue( hueSaturationFilter->
colorizeStrength() );
395 mInvertColorsCheck->setChecked( hueSaturationFilter->
invertColors() );
400 mBlendModeComboBox->setBlendMode( mRasterLayer->blendMode() );
405 mRasterTransparencyWidget->cboxTransparencyBand->setShowNotSetOption(
true, tr(
"None" ) );
406 mRasterTransparencyWidget->cboxTransparencyBand->setLayer( mRasterLayer );
415 cboxTransparencyBand->setCurrentIndex( cboxTransparencyBand->findData( renderer->
alphaBand() ) );
422 mHistogramWidget =
nullptr;
423 if ( mOptsPage_Histogram->isEnabled() )
426 mHistogramStackedWidget->addWidget( mHistogramWidget );
440 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
442 for (
const QString &name : constRenderersList )
452 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
457 QString rendererType = renderer->
type();
458 widgetIndex = mRenderTypeComboBox->findData( rendererType );
459 if ( widgetIndex != -1 )
461 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
462 mRenderTypeComboBox->setCurrentIndex( widgetIndex );
463 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
466 if ( rendererType == QLatin1String(
"singlebandcolordata" ) && mRenderTypeComboBox->count() == 1 )
469 QSizePolicy sizep = mBandRenderingGrpBx->sizePolicy();
470 sizep.setVerticalStretch( 0 );
471 sizep.setVerticalPolicy( QSizePolicy::Maximum );
472 mBandRenderingGrpBx->setSizePolicy( sizep );
473 mBandRenderingGrpBx->updateGeometry();
476 if ( mRasterLayer->providerType() != QLatin1String(
"wms" ) )
478 mWMSPrintGroupBox->hide();
479 mPublishDataSourceUrlCheckBox->hide();
480 mBackgroundLayerCheckBox->hide();
487 const int horizontalDpi = logicalDpiX();
490 if ( horizontalDpi > 96 )
492 mMetadataViewer->setZoomFactor( mMetadataViewer->zoomFactor() * 0.9 );
494 mMetadataViewer->page()->setLinkDelegationPolicy( QWebPage::LinkDelegationPolicy::DelegateAllLinks );
496 mMetadataViewer->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled,
true );
497 mMetadataViewer->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled,
true );
503 mRenderTypeComboBox_currentIndexChanged( widgetIndex );
507 QMenu *menuStyle =
new QMenu(
this );
510 menuStyle->addSeparator();
514 connect( menuStyle, &QMenu::aboutToShow,
this, &QgsRasterLayerProperties::aboutToShowStyleMenu );
516 mBtnMetadata =
new QPushButton( tr(
"Metadata" ),
this );
517 QMenu *menuMetadata =
new QMenu(
this );
520 menuMetadata->addSeparator();
524 buttonBox->addButton(
mBtnMetadata, QDialogButtonBox::ResetRole );
532 if ( !settings.
contains( QStringLiteral(
"/Windows/RasterLayerProperties/tab" ) ) )
534 settings.
setValue( QStringLiteral(
"Windows/RasterLayerProperties/tab" ),
mOptStackedWidget->indexOf( mOptsPage_Style ) );
542 mOptsPage_Information->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#information-properties" ) );
543 mOptsPage_Source->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#source-properties" ) );
544 mOptsPage_Style->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#symbology-properties" ) );
545 mOptsPage_Transparency->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#transparency-properties" ) );
547 if ( mOptsPage_Histogram )
548 mOptsPage_Histogram->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#histogram-properties" ) );
550 mOptsPage_Rendering->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#rendering-properties" ) );
551 mOptsPage_Temporal->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#temporal-properties" ) );
553 if ( mOptsPage_Pyramids )
554 mOptsPage_Pyramids->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#pyramids-properties" ) );
556 if ( mOptsPage_Display )
557 mOptsPage_Display->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#display-properties" ) );
559 mOptsPage_Metadata->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#metadata-properties" ) );
560 mOptsPage_Legend->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#legend-properties" ) );
561 mOptsPage_Server->setProperty(
"helpPage", QStringLiteral(
"working_with_raster/raster_properties.html#server-properties" ) );
581 if ( beforePage.isEmpty() )
589 mTemporalWidget->addWidget( page );
599void QgsRasterLayerProperties::updateRasterAttributeTableOptionsPage()
601 if ( mRasterAttributeTableWidget )
603 mOptsPage_RasterAttributeTable->layout()->removeWidget( mRasterAttributeTableWidget );
604 mRasterAttributeTableWidget =
nullptr;
608 if ( mRasterLayer->attributeTableCount() > 0 )
610 mRasterAttributeTableWidget =
new QgsRasterAttributeTableWidget(
this, mRasterLayer );
611 mOptsPage_RasterAttributeTable->layout()->addWidget( mRasterAttributeTableWidget );
614 mNoRasterAttributeTableWidget->hide();
618 mNoRasterAttributeTableWidget->show();
619 mCreateRasterAttributeTableButton->setEnabled( mRasterLayer->canCreateRasterAttributeTable() );
623void QgsRasterLayerProperties::setRendererWidget(
const QString &rendererName )
626 QgsRasterRendererWidget *oldWidget = mRendererWidget;
627 QgsRasterRenderer *oldRenderer = mRasterLayer->renderer();
632 const QList<int> oldBands = oldRenderer ? oldRenderer->
usesBands() : QList<int>();
637 opacity = oldRenderer->
opacity();
641 QgsRasterRendererRegistryEntry rendererEntry;
646 QgsDebugMsgLevel( QStringLiteral(
"renderer has widgetCreateFunction" ), 3 );
648 QgsRectangle myExtent =
mCanvas->mapSettings().outputExtentToLayerExtent( mRasterLayer,
mCanvas->extent() );
649 if ( oldWidget && ( !oldRenderer || rendererName != oldRenderer->
type() ) )
651 if ( rendererName == QLatin1String(
"singlebandgray" ) )
654 whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
656 else if ( rendererName == QLatin1String(
"multibandcolor" ) )
659 whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
662 mRasterLayer->renderer()->setAlphaBand( alphaBand );
663 mRasterLayer->renderer()->setOpacity( opacity );
664 mRasterLayer->renderer()->setNodataColor( nodataColor );
666 mRendererWidget->setMapCanvas(
mCanvas );
667 mRendererStackedWidget->addWidget( mRendererWidget );
671 std::unique_ptr<QgsRasterRenderer> newRenderer;
672 newRenderer.reset( mRendererWidget->renderer() );
673 const QList<int> newBands = newRenderer->usesBands();
674 if ( oldBands != newBands )
676 mRasterTransparencyWidget->syncToLayer();
682 const int widgetIndex = mRenderTypeComboBox->findData( rendererName );
683 if ( widgetIndex != -1 )
685 mDisableRenderTypeComboBoxCurrentIndexChanged =
true;
686 mRenderTypeComboBox->setCurrentIndex( widgetIndex );
687 mDisableRenderTypeComboBoxCurrentIndexChanged =
false;
690 if ( mRendererWidget != oldWidget )
693 if ( mHistogramWidget )
695 mHistogramWidget->setRendererWidget( rendererName, mRendererWidget );
699void QgsRasterLayerProperties::sync()
701 QgsSettings myQSettings;
703 if ( !mSourceWidget )
708 QHBoxLayout *layout =
new QHBoxLayout();
709 layout->addWidget( mSourceWidget );
710 mSourceGroupBox->setLayout( layout );
711 if ( !mSourceWidget->groupTitle().isEmpty() )
712 mSourceGroupBox->setTitle( mSourceWidget->groupTitle() );
713 mSourceGroupBox->show();
716 buttonBox->button( QDialogButtonBox::Apply )->setEnabled( isValid );
717 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( isValid );
724 mSourceWidget->setMapCanvas(
mCanvas );
725 mSourceWidget->setSourceUri( mRasterLayer->source() );
728 const QgsRasterDataProvider *provider = mRasterLayer->dataProvider();
732 mRasterTransparencyWidget->syncToLayer();
733 mLabelingWidget->syncToLayer( mRasterLayer );
738 mRasterTransparencyWidget->gboxNoDataValue->setEnabled(
false );
739 mRasterTransparencyWidget->gboxCustomTransparency->setEnabled(
false );
740 mOptionsStackedWidget->setCurrentWidget( mOptsPage_Server );
747 if ( mOptsPage_Pyramids )
749 delete mOptsPage_Pyramids;
750 mOptsPage_Pyramids =
nullptr;
756 if ( mOptsPage_Histogram )
758 delete mOptsPage_Histogram;
759 mOptsPage_Histogram =
nullptr;
760 delete mHistogramWidget;
761 mHistogramWidget =
nullptr;
772 QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter();
773 if ( brightnessFilter )
775 mSliderBrightness->setValue( brightnessFilter->
brightness() );
776 mSliderContrast->setValue( brightnessFilter->
contrast() );
777 mGammaSpinBox->setValue( brightnessFilter->
gamma() );
781 const QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter();
783 if ( hueSaturationFilter )
785 sliderSaturation->setValue( hueSaturationFilter->
saturation() );
786 comboGrayscale->setCurrentIndex( (
int ) hueSaturationFilter->
grayscaleMode() );
789 toggleSaturationControls(
static_cast<int>( hueSaturationFilter->
grayscaleMode() ) );
792 mColorizeCheck->setChecked( hueSaturationFilter->
colorizeOn() );
793 btnColorizeColor->setColor( hueSaturationFilter->
colorizeColor() );
794 toggleColorizeControls( hueSaturationFilter->
colorizeOn() );
795 sliderColorizeStrength->setValue( hueSaturationFilter->
colorizeStrength() );
796 mInvertColorsCheck->setChecked( hueSaturationFilter->
invertColors() );
800 mResamplingUtils.refreshWidgetsFromLayer();
802 mRefreshSettingsWidget->syncToLayer();
803 mMapLayerServerPropertiesWidget->sync();
810 mLayerOrigNameLineEd->setText( mRasterLayer->name() );
817 updateInformationContent();
819 mEnableMapTips->setChecked( mRasterLayer->mapTipsEnabled() );
820 mMapTipWidget->setText( mRasterLayer->mapTipTemplate() );
823 QVariant wmsPrintLayer = mRasterLayer->customProperty( QStringLiteral(
"WMSPrintLayer" ) );
824 if ( wmsPrintLayer.isValid() )
826 mWMSPrintLayerLineEdit->setText( wmsPrintLayer.toString() );
829 QVariant wmsPublishDataSourceUrl = mRasterLayer->customProperty( QStringLiteral(
"WMSPublishDataSourceUrl" ),
false );
830 mPublishDataSourceUrlCheckBox->setChecked( wmsPublishDataSourceUrl.toBool() );
832 QVariant wmsBackgroundLayer = mRasterLayer->customProperty( QStringLiteral(
"WMSBackgroundLayer" ),
false );
833 mBackgroundLayerCheckBox->setChecked( wmsBackgroundLayer.toBool() );
835 mLegendPlaceholderWidget->setLastPathSettingsKey( QStringLiteral(
"lastLegendPlaceholderDir" ) );
836 mLegendPlaceholderWidget->setSource( mRasterLayer->legendPlaceholderImage() );
837 mLegendConfigEmbeddedWidget->setLayer( mRasterLayer );
840 mTemporalWidget->syncToLayer();
842 mPropertyCollection = mRasterLayer->pipe()->dataDefinedProperties();
843 updateDataDefinedButtons();
845 for ( QgsMapLayerConfigWidget *page : std::as_const(
mConfigWidgets ) )
847 page->syncToLayer( mRasterLayer );
855 const QString newSource = mSourceWidget->sourceUri();
856 if ( newSource != mRasterLayer->source() )
863 if ( !mRasterLayer->isValid() )
876 mRasterLayer->setLegendPlaceholderImage( mLegendPlaceholderWidget->source() );
877 mLegendConfigEmbeddedWidget->applyToLayer();
887 mRasterLayer->brightnessFilter()->setBrightness( mSliderBrightness->value() );
888 mRasterLayer->brightnessFilter()->setContrast( mSliderContrast->value() );
889 mRasterLayer->brightnessFilter()->setGamma( mGammaSpinBox->value() );
896 mRasterTransparencyWidget->applyToRasterProvider( mRasterLayer->dataProvider() );
900 if ( rendererWidget )
904 mRasterLayer->setRenderer( rendererWidget->
renderer() );
907 mBackupCrs = mRasterLayer->crs();
908 mMetadataWidget->acceptMetadata();
909 mMetadataFilled =
false;
913 mRasterTransparencyWidget->applyToRasterRenderer( rasterRenderer );
915 mLabelingWidget->apply();
917 if ( rasterRenderer )
920 mRasterLayer->emitStyleChanged();
927 mRasterLayer->setName( mLayerOrigNameLineEd->text() );
930 mRasterLayer->setScaleBasedVisibility( chkUseScaleDependentRendering->isChecked() );
931 mRasterLayer->setMinimumScale( mScaleRangeWidget->minimumScale() );
932 mRasterLayer->setMaximumScale( mScaleRangeWidget->maximumScale() );
934 mRefreshSettingsWidget->saveToLayer();
935 if ( mMapLayerServerPropertiesWidget->save() )
936 mMetadataFilled =
true;
943 mResamplingUtils.refreshLayerFromWidgets();
947 if ( hueSaturationFilter )
949 hueSaturationFilter->
setSaturation( sliderSaturation->value() );
951 hueSaturationFilter->
setColorizeOn( mColorizeCheck->checkState() );
954 hueSaturationFilter->
setInvertColors( mInvertColorsCheck->isChecked() );
958 mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );
961 mTemporalWidget->saveTemporalProperties();
963 mRasterLayer->setCrs( mCrsSelector->crs() );
965 if ( !mWMSPrintLayerLineEdit->text().isEmpty() )
967 mRasterLayer->setCustomProperty( QStringLiteral(
"WMSPrintLayer" ), mWMSPrintLayerLineEdit->text() );
970 mRasterLayer->setCustomProperty(
"WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
971 mRasterLayer->setCustomProperty(
"WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );
973 mRasterLayer->pipe()->setDataDefinedProperties( mPropertyCollection );
975 mRasterLayer->setMapTipsEnabled( mEnableMapTips->isChecked() );
976 mRasterLayer->setMapTipTemplate( mMapTipWidget->text() );
986 mRasterLayer->triggerRepaint();
992void QgsRasterLayerProperties::buttonBuildPyramids_clicked()
996 auto feedback = std::make_unique<QgsRasterBlockFeedback>();
1004 for (
int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
1006 QListWidgetItem *myItem = lbxPyramidResolutions->item( myCounterInt );
1008 myPyramidList[myCounterInt].setBuild( myItem->isSelected() || myPyramidList[myCounterInt].getExists() );
1012 QString prefix = provider->
name() +
"/driverOptions/_pyramids/";
1013 QgsSettings mySettings;
1014 QString resamplingMethod( cboResamplingMethod->currentData().toString() );
1015 mySettings.
setValue( prefix +
"resampling", resamplingMethod );
1022 QApplication::setOverrideCursor( Qt::WaitCursor );
1030 QApplication::restoreOverrideCursor();
1031 mPyramidProgress->setValue( 0 );
1032 buttonBuildPyramids->setEnabled(
false );
1033 if ( !res.isNull() )
1035 if ( res == QLatin1String(
"CANCELED" ) )
1039 else if ( res == QLatin1String(
"ERROR_WRITE_ACCESS" ) )
1041 QMessageBox::warning(
this, tr(
"Building Pyramids" ), tr(
"Write access denied. Adjust the file permissions and try again." ) );
1043 else if ( res == QLatin1String(
"ERROR_WRITE_FORMAT" ) )
1045 QMessageBox::warning(
this, tr(
"Building Pyramids" ), tr(
"The file was not writable. Some formats do not "
1046 "support pyramid overviews. Consult the GDAL documentation if in doubt." ) );
1048 else if ( res == QLatin1String(
"FAILED_NOT_SUPPORTED" ) )
1050 QMessageBox::warning(
this, tr(
"Building Pyramids" ), tr(
"Building pyramid overviews is not supported on this type of raster." ) );
1052 else if ( res == QLatin1String(
"ERROR_JPEG_COMPRESSION" ) )
1054 QMessageBox::warning(
this, tr(
"Building Pyramids" ), tr(
"Building internal pyramid overviews is not supported on raster layers with JPEG compression and your current libtiff library." ) );
1056 else if ( res == QLatin1String(
"ERROR_VIRTUAL" ) )
1058 QMessageBox::warning(
this, tr(
"Building Pyramids" ), tr(
"Building pyramid overviews is not supported on this type of raster." ) );
1065 lbxPyramidResolutions->clear();
1071 for (
const QgsRasterPyramid &pyramid : std::as_const( myPyramidList ) )
1073 if ( pyramid.getExists() )
1075 lbxPyramidResolutions->addItem(
new QListWidgetItem( myPyramidPixmap, QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) + QString::number( pyramid.getYDim() ) ) );
1079 lbxPyramidResolutions->addItem(
new QListWidgetItem( myNoPyramidPixmap, QString::number( pyramid.getXDim() ) + QStringLiteral(
" x " ) + QString::number( pyramid.getYDim() ) ) );
1088 updateInformationContent();
1091void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged(
int index )
1093 if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged || !mRasterLayer->renderer() )
1098 QString rendererName = mRenderTypeComboBox->itemData( index ).toString();
1099 setRendererWidget( rendererName );
1105 mRasterLayer->setCrs( crs );
1106 mMetadataWidget->crsChanged();
1109void QgsRasterLayerProperties::aboutToShowStyleMenu()
1113 QMenu *m = qobject_cast<QMenu *>( sender() );
1123 QgsRasterRenderer *renderer = mRasterLayer->renderer();
1126 setRendererWidget( renderer->
type() );
1129 mRasterLayer->triggerRepaint();
1136 if ( !mHistogramWidget )
1141 mHistogramWidget->setActive(
true );
1145 mHistogramWidget->setActive(
false );
1148 if ( index ==
mOptStackedWidget->indexOf( mOptsPage_Information ) || !mMetadataFilled )
1151 updateInformationContent();
1157 button->blockSignals(
true );
1161 button->blockSignals(
false );
1164void QgsRasterLayerProperties::updateDataDefinedButtons()
1166 const QList<QgsPropertyOverrideButton *> propertyOverrideButtons { findChildren<QgsPropertyOverrideButton *>() };
1167 for ( QgsPropertyOverrideButton *button : propertyOverrideButtons )
1169 updateDataDefinedButton( button );
1185void QgsRasterLayerProperties::updateProperty()
1187 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
1189 mPropertyCollection.setProperty( key, button->
toProperty() );
1192void QgsRasterLayerProperties::toggleSaturationControls(
int grayscaleMode )
1195 if ( grayscaleMode == 0 )
1197 sliderSaturation->setEnabled(
true );
1198 spinBoxSaturation->setEnabled(
true );
1202 sliderSaturation->setEnabled(
false );
1203 spinBoxSaturation->setEnabled(
false );
1207void QgsRasterLayerProperties::toggleColorizeControls(
bool colorizeEnabled )
1210 btnColorizeColor->setEnabled( colorizeEnabled );
1211 sliderColorizeStrength->setEnabled( colorizeEnabled );
1212 spinColorizeStrength->setEnabled( colorizeEnabled );
1216QLinearGradient QgsRasterLayerProperties::redGradient()
1220 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1221 myGradient.setColorAt( 0.0, QColor( 242, 14, 25, 190 ) );
1222 myGradient.setColorAt( 0.5, QColor( 175, 29, 37, 190 ) );
1223 myGradient.setColorAt( 1.0, QColor( 114, 17, 22, 190 ) );
1226QLinearGradient QgsRasterLayerProperties::greenGradient()
1230 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1231 myGradient.setColorAt( 0.0, QColor( 48, 168, 5, 190 ) );
1232 myGradient.setColorAt( 0.8, QColor( 36, 122, 4, 190 ) );
1233 myGradient.setColorAt( 1.0, QColor( 21, 71, 2, 190 ) );
1236QLinearGradient QgsRasterLayerProperties::blueGradient()
1240 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1241 myGradient.setColorAt( 0.0, QColor( 30, 0, 106, 190 ) );
1242 myGradient.setColorAt( 0.2, QColor( 30, 72, 128, 190 ) );
1243 myGradient.setColorAt( 1.0, QColor( 30, 223, 196, 190 ) );
1246QLinearGradient QgsRasterLayerProperties::grayGradient()
1250 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1251 myGradient.setColorAt( 0.0, QColor( 5, 5, 5, 190 ) );
1252 myGradient.setColorAt( 0.8, QColor( 122, 122, 122, 190 ) );
1253 myGradient.setColorAt( 1.0, QColor( 220, 220, 220, 190 ) );
1256QLinearGradient QgsRasterLayerProperties::highlightGradient()
1260 QLinearGradient myGradient = QLinearGradient( mGradientWidth, 0, mGradientWidth, mGradientHeight );
1261 myGradient.setColorAt( 1.0, QColor( 255, 255, 255, 50 ) );
1262 myGradient.setColorAt( 0.5, QColor( 255, 255, 255, 100 ) );
1263 myGradient.setColorAt( 0.0, QColor( 255, 255, 255, 150 ) );
1278void QgsRasterLayerProperties::restoreWindowModality()
1287void QgsRasterLayerProperties::toggleBuildPyramidsButton()
1289 if ( lbxPyramidResolutions->selectedItems().empty() )
1291 buttonBuildPyramids->setEnabled(
false );
1295 buttonBuildPyramids->setEnabled(
true );
1299void QgsRasterLayerProperties::mResetColorRenderingBtn_clicked()
1301 mBlendModeComboBox->setBlendMode( QPainter::CompositionMode_SourceOver );
1302 mSliderBrightness->setValue( 0 );
1303 mSliderContrast->setValue( 0 );
1304 mGammaSpinBox->setValue( 1.0 );
1305 sliderSaturation->setValue( 0 );
1307 mColorizeCheck->setChecked(
false );
1308 sliderColorizeStrength->setValue( 100 );
1309 mInvertColorsCheck->setChecked(
false );
1312bool QgsRasterLayerProperties::rasterIsMultiBandColor()
1314 return mRasterLayer &&
nullptr !=
dynamic_cast<QgsMultiBandColorRenderer *
>( mRasterLayer->renderer() );
1317void QgsRasterLayerProperties::updateInformationContent()
1321 const QString html { mRasterLayer->htmlMetadata().replace( QLatin1String(
"<head>" ), QStringLiteral( R
"raw(<head><style type="text/css">%1</style>)raw" ) ).arg( myStyle ) };
1322 mMetadataViewer->setHtml( html );
1323 mMetadataFilled = true;
1329 if ( mRasterAttributeTableWidget && mRasterAttributeTableWidget->isDirty() )
1331 mRasterAttributeTableWidget->setEditable(
false,
false );
1335 if ( mBackupCrs != mRasterLayer->crs() )
1336 mRasterLayer->setCrs( mBackupCrs );
1339void QgsRasterLayerProperties::showHelp()
1341 const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property(
"helpPage" );
1343 if ( helpPage.isValid() )
1349 QgsHelp::openHelp( QStringLiteral(
"working_with_raster/raster_properties.html" ) );
1353void QgsRasterLayerProperties::updateGammaSpinBox(
int value )
1358void QgsRasterLayerProperties::updateGammaSlider(
double value )
1367 if ( obj == mMapTipPreviewContainer && ev->type() == QEvent::Resize )
1371 return QgsOptionsDialogBase::eventFilter( obj, ev );
1374void QgsRasterLayerProperties::initMapTipPreview()
1377 mMapTipSplitter->setSizes( { 400, 200 } );
1379 mMapTipPreviewContainer->installEventFilter(
this );
1383 mMapTipPreview =
new QgsWebView( mMapTipPreviewContainer );
1384 mMapTipPreviewLayout->addWidget( mMapTipPreview );
1387 mMapTipPreview->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
1388 mMapTipPreview->setContextMenuPolicy( Qt::NoContextMenu );
1389 connect( mMapTipPreview, &QWebView::loadFinished,
this, &QgsRasterLayerProperties::resizeMapTip );
1392 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled,
true );
1393 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled,
true );
1394 mMapTipPreview->page()->settings()->setAttribute( QWebSettings::LocalStorageEnabled,
true );
1397 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
1398 mMapTipPreview->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
1402 connect( mMapTipWidget, &QgsCodeEditorHTML::textChanged,
this, &QgsRasterLayerProperties::updateMapTipPreview );
1405void QgsRasterLayerProperties::updateMapTipPreview()
1407 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
1409 mMapTipPreview->setHtml( htmlContent );
1412void QgsRasterLayerProperties::resizeMapTip()
1415 mMapTipPreview->setMaximumSize( mMapTipPreviewContainer->width(), mMapTipPreviewContainer->height() );
1418 const QWebElement container = mMapTipPreview->page()->mainFrame()->findFirstElement(
1419 QStringLiteral(
"#QgsWebViewContainer" )
1421 const int width = container.geometry().width();
1422 const int height = container.geometry().height();
1423 mMapTipPreview->resize( width, height );
1426 mMapTipPreview->move( ( mMapTipPreviewContainer->width() - mMapTipPreview->width() ) / 2, ( mMapTipPreviewContainer->height() - mMapTipPreview->height() ) / 2 );
1429 mMapTipPreview->adjustSize();
@ BuildPyramids
Supports building of pyramids (overviews) (since QGIS 3.38 – this is a replacement for RasterInterfac...
@ SingleBandColorData
Single band containing color data.
RasterPyramidFormat
Raster pyramid formats.
@ GeoTiff
Geotiff .ovr (external).
@ Erdas
Erdas Image .aux (external).
@ SingleBandGray
A single band image drawn as a range of gray colors.
@ MultiBandColor
A layer containing 2 or more bands, mapped to RGB color space. In the case of a multiband with only t...
@ BuildPyramids
Supports building of pyramids (overviews) (Deprecated since QGIS 3.38 – use RasterProviderCapability:...
@ Size
Original data source size (and thus resolution) is known, it is not always available,...
@ ExcludeByDefault
If set, the layer should not be included in legends by default, and must be manually added by a user.
@ ARGB32_Premultiplied
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.
@ ARGB32
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.
@ Preferred
Preferred format, matching the most recent WKT ISO standard. Currently an alias to WKT2_2019,...
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...
static QgsRasterRendererRegistry * rasterRendererRegistry()
Returns the application's raster renderer registry, used for managing raster layer renderers.
@ WebBrowser
StyleSheet for embedded browsers (QtWebKit), supports full standard CSS.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
int contrast() const
Returns current contrast level.
int brightness() const
Returns current brightness level.
double gamma() const
Returns current gamma value.
Represents a coordinate reference system (CRS).
A dialog which collects the information required to create a new raster attribute table.
void setOpenWhenDoneVisible(bool visible)
Sets the visibility of the "Open newly created raster attribute table" option to visible,...
virtual QString name() const =0
Returns a provider name.
A generic dialog for building expression strings.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
static QgsExpressionContextScope * atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapLayerPositionScope(const QgsPointXY &position)
Sets the expression context variables which are available for expressions triggered by moving the mou...
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QString findAndSelectActiveExpression(QgsCodeEditor *editor, const QString &pattern=QString())
Find the expression under the cursor in the given editor and select it.
void progressChanged(double progress)
Emitted when the feedback object reports a progress change.
static QgsProviderSourceWidgetProviderRegistry * sourceWidgetProviderRegistry()
Returns the registry of provider source widget providers.
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Color and saturation filter pipe for rasters.
void setColorizeOn(bool colorizeOn)
void setSaturation(int saturation)
int colorizeStrength() const
bool invertColors() const
Returns true if the filter inverts colors.
void setGrayscaleMode(QgsHueSaturationFilter::GrayscaleMode grayscaleMode)
void setInvertColors(bool invertColors)
Sets whether the filter will invert colors.
QgsHueSaturationFilter::GrayscaleMode grayscaleMode() const
void setColorizeColor(const QColor &colorizeColor)
void setColorizeStrength(int colorizeStrength)
QColor colorizeColor() const
QPushButton * mBtnStyle
Style button.
void saveMetadataToFile()
Allows the user to save the layer's metadata as a file.
virtual void rollback()
Rolls back changes made to the layer.
void optionsStackedWidget_CurrentChanged(int index) override
void saveStyleAsDefault()
Saves the current layer style as the default for the layer.
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
void setMetadataWidget(QgsMetadataWidget *widget, QWidget *page)
Sets the metadata widget and page associated with the dialog.
void loadDefaultStyle()
Reloads the default style for the layer.
void saveStyleAs()
Saves a style when appriate button is pressed.
virtual void syncToLayer()=0
Resets the dialog to the current layer state.
void loadStyle()
Triggers a dialog to load a saved style.
QgsMapCanvas * mCanvas
Associated map canvas.
void loadDefaultMetadata()
Reloads the default layer metadata for the layer.
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
void loadMetadataFromFile()
Allows the user to load layer metadata from a file.
QPushButton * mBtnMetadata
Metadata button.
void initialize()
Initialize the dialog.
void saveMetadataAsDefault()
Saves the current layer metadata as the default for the layer.
void openUrl(const QUrl &url)
Handles opening a url from the dialog.
A dialog allowing selection of a VAT.DBF file and associating the resulting raster attribute table wi...
void setOpenWhenDoneVisible(bool visible)
Sets the visibility of the "Open newly created raster attribute table" option to visible,...
Map canvas is a class for displaying all GIS data types on a canvas.
An abstract interface for implementations of legends for one map layer.
static QgsMapLayerLegend * defaultRasterLegend(QgsRasterLayer *rl)
Create new legend implementation for raster layer.
void removesExtraMenuSeparators(QMenu *m)
removes extra separators from the menu
void addStyleManagerActions(QMenu *m, QgsMapLayer *layer)
adds actions to the menu in accordance to the layer
static QgsMapLayerStyleGuiUtils * instance()
returns a singleton instance of this class
void currentStyleChanged(const QString ¤tName)
Emitted when the current style has been changed.
Base class for all map layer types.
void rendererChanged()
Signal emitted when renderer is changed.
bool hasScaleBasedVisibility() const
Returns whether scale based visibility is enabled for the layer.
double minimumScale() const
Returns the minimum map scale (i.e.
QgsMapLayerStyleManager * styleManager() const
Gets access to the layer's style manager.
double maximumScale() const
Returns the maximum map scale (i.e.
Contains configuration for rendering maps.
static QString rasterMapTipPreviewText(QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate)
Returns the html that would be displayed in a maptip for a given layer.
void addPage(const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QStringList &path=QStringList(), const QString &key=QString())
Adds a new page to the dialog pages.
QStackedWidget * mOptStackedWidget
void initOptionsBase(bool restoreUi=true, const QString &title=QString())
Set up the base ui connections for vertical tabs.
void insertPage(const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QString &before, const QStringList &path=QStringList(), const QString &key=QString())
Inserts a new page into the dialog pages.
static bool layerIsContainedInGroupLayer(QgsProject *project, QgsMapLayer *layer)
Returns true if the specified layer is a child layer from any QgsGroupLayer in the given project.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void setDirty(bool b=true)
Flag the project as dirty (modified).
Base class for raster data providers.
virtual QString buildPyramids(const QList< QgsRasterPyramid > &pyramidList, const QString &resamplingMethod="NEAREST", Qgis::RasterPyramidFormat format=Qgis::RasterPyramidFormat::GeoTiff, const QStringList &configOptions=QStringList(), QgsRasterBlockFeedback *feedback=nullptr)
Creates pyramid overviews.
Qgis::DataType dataType(int bandNo) const override=0
Returns data type for the band specified by number.
virtual Qgis::RasterProviderCapabilities providerCapabilities() const
Returns flags containing the supported capabilities of the data provider.
static QList< QPair< QString, QString > > pyramidResamplingMethods(const QString &providerKey)
Returns a list of pyramid resampling method name and label pairs for given provider.
virtual QList< QgsRasterPyramid > buildPyramidList(const QList< int > &overviewList=QList< int >())
Returns the raster layers pyramid list.
virtual Qgis::RasterInterfaceCapabilities capabilities() const
Returns the capabilities supported by the interface.
void addPropertiesPageFactory(const QgsMapLayerConfigWidgetFactory *factory) final
Adds properties page from a factory.
Q_DECL_DEPRECATED void saveDefaultStyle()
Saves the default style when appropriate button is pressed.
QgsRasterLayerProperties(QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent=nullptr, Qt::WindowFlags=QgsGuiUtils::ModalDialogFlags)
Constructor.
bool eventFilter(QObject *obj, QEvent *ev) override
void optionsStackedWidget_CurrentChanged(int index) final
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Represents a raster layer.
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
Property
Data definable properties.
@ RendererOpacity
Raster renderer global opacity.
static QgsPropertiesDefinition propertyDefinitions()
Returns the definitions for data defined properties available for use in raster pipes.
This struct is used to store pyramid info for the raster layer.
void insertWidgetFunction(const QString &rendererName, QgsRasterRendererWidgetCreateFunc func)
Sets the widget creation function for a renderer.
QStringList renderersList() const
Returns a list of the names of registered renderers.
Raster renderer pipe that applies colors to a raster.
QColor nodataColor() const
Returns the color to use for shading nodata pixels.
virtual QString type() const
Returns a unique string representation of the renderer type.
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
Stores settings for use within QGIS.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
A collection of stubs to mimic the API of QWebView on systems where the real library is not available...
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
#define QgsDebugMsgLevel(str, level)
Setting options for creating vector data providers.
Registry for raster renderer entries.
QgsRasterRendererWidgetCreateFunc widgetCreateFunction