Skip to content

Commit 969b129

Browse files
committedApr 9, 2018
Also update symbol previews when a remote SVG is fetched
1 parent 45c400c commit 969b129

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/gui/symbology/qgssymbolselectordialog.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "qgssettings.h"
3434
#include "qgsfeatureiterator.h"
3535
#include "qgsvectorlayer.h"
36+
#include "qgssvgcache.h"
3637

3738
#include <QColorDialog>
3839
#include <QPainter>
@@ -283,6 +284,17 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
283284
layersTree->setCurrentIndex( newIndex );
284285

285286
setPanelTitle( tr( "Symbol Selector" ) );
287+
288+
connect( QgsApplication::svgCache(), &QgsSvgCache::remoteSvgFetched, this, [ = ]
289+
{
290+
// when a remote svg has been fetched, update the widget's previews
291+
// this is required if the symbol utilises remote svgs, and the current previews
292+
// have been generated using the temporary "downloading" svg. In this case
293+
// we require the preview to be regenerated to use the correct fetched
294+
// svg
295+
symbolChanged();
296+
updatePreview();
297+
} );
286298
}
287299

288300
QMenu *QgsSymbolSelectorWidget::advancedMenu()

0 commit comments

Comments
 (0)
Please sign in to comment.