Skip to content
Permalink
Browse files

Merge pull request #8126 from elpaso/bugfix-18608-raster-legend-embed…

…ded-widgets

Force legend update when raster properties changes
  • Loading branch information
elpaso committed Oct 8, 2018
2 parents 8c2afa6 + 12fd51e commit f6b80205e8f4e35fcdf588f76e358817ff4ab4ba
@@ -55,6 +55,7 @@
#include "qgshuesaturationfilter.h"
#include "qgshillshaderendererwidget.h"
#include "qgssettings.h"
#include "qgsmaplayerlegend.h"

#include <QDesktopServices>
#include <QTableWidgetItem>
@@ -1052,8 +1053,14 @@ void QgsRasterLayerProperties::apply()
mRasterLayer->setCustomProperty( "WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
mRasterLayer->setCustomProperty( "WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );

// update symbology

// update symbology (this is now deprecated and disconnected)
Q_NOWARN_DEPRECATED_PUSH
emit refreshLegend( mRasterLayer->id(), false );
Q_NOWARN_DEPRECATED_POP

// Force a redraw of the legend
mRasterLayer->setLegend( QgsMapLayerLegend::defaultRasterLegend( mRasterLayer ) );

//make sure the layer is redrawn
mRasterLayer->triggerRepaint();
@@ -141,7 +141,7 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private

signals:
//! Emitted when changes to layer were saved to update legend
void refreshLegend( const QString &layerID, bool expandItem );
Q_DECL_DEPRECATED void refreshLegend( const QString &layerID, bool expandItem ) SIP_DEPRECATED;

private:
QPushButton *mBtnStyle = nullptr;
@@ -754,8 +754,10 @@ void QgsVectorLayerProperties::apply()
mLayer->geometryOptions()->setRemoveDuplicateNodes( mRemoveDuplicateNodesCheckbox->isChecked() );
mLayer->geometryOptions()->setGeometryPrecision( mGeometryPrecisionSpinBox->value() );

// update symbology
// update symbology (this is now deprecated and disconnected)
Q_NOWARN_DEPRECATED_PUSH
emit refreshLegend( mLayer->id() );
Q_NOWARN_DEPRECATED_POP

mLayer->triggerRepaint();
// notify the project we've made a change
@@ -133,8 +133,8 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
signals:

//! Emitted when changes to layer were saved to update legend
void refreshLegend( const QString &layerID, bool expandItem );
void refreshLegend( const QString &layerID );
Q_DECL_DEPRECATED void refreshLegend( const QString &layerID, bool expandItem ) SIP_DEPRECATED;
Q_DECL_DEPRECATED void refreshLegend( const QString &layerID ) SIP_DEPRECATED;

void toggleEditing( QgsMapLayer * );

0 comments on commit f6b8020

Please sign in to comment.
You can’t perform that action at this time.