Skip to content

Commit 56149ff

Browse files
committed
Force legend update when raster properties changes
Fixes #18608 - Layer tree embedded widgets do not show up unless you move layer
1 parent 81db005 commit 56149ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/qgsrasterlayerproperties.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "qgshuesaturationfilter.h"
5656
#include "qgshillshaderendererwidget.h"
5757
#include "qgssettings.h"
58+
#include "qgsmaplayerlegend.h"
5859

5960
#include <QDesktopServices>
6061
#include <QTableWidgetItem>
@@ -1052,9 +1053,13 @@ void QgsRasterLayerProperties::apply()
10521053
mRasterLayer->setCustomProperty( "WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
10531054
mRasterLayer->setCustomProperty( "WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );
10541055

1055-
// update symbology
1056+
1057+
// update symbology (this is now disconnected)
10561058
emit refreshLegend( mRasterLayer->id(), false );
10571059

1060+
// Force a redraw of the legend
1061+
mRasterLayer->setLegend( QgsMapLayerLegend::defaultRasterLegend( mRasterLayer ) );
1062+
10581063
//make sure the layer is redrawn
10591064
mRasterLayer->triggerRepaint();
10601065

0 commit comments

Comments
 (0)