Skip to content

Commit

Permalink
Also update symbol previews when a remote SVG is fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent 45c400c commit 969b129
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "qgssettings.h" #include "qgssettings.h"
#include "qgsfeatureiterator.h" #include "qgsfeatureiterator.h"
#include "qgsvectorlayer.h" #include "qgsvectorlayer.h"
#include "qgssvgcache.h"


#include <QColorDialog> #include <QColorDialog>
#include <QPainter> #include <QPainter>
Expand Down Expand Up @@ -283,6 +284,17 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
layersTree->setCurrentIndex( newIndex ); layersTree->setCurrentIndex( newIndex );


setPanelTitle( tr( "Symbol Selector" ) ); setPanelTitle( tr( "Symbol Selector" ) );

connect( QgsApplication::svgCache(), &QgsSvgCache::remoteSvgFetched, this, [ = ]
{
// when a remote svg has been fetched, update the widget's previews
// this is required if the symbol utilises remote svgs, and the current previews
// have been generated using the temporary "downloading" svg. In this case
// we require the preview to be regenerated to use the correct fetched
// svg
symbolChanged();
updatePreview();
} );
} }


QMenu *QgsSymbolSelectorWidget::advancedMenu() QMenu *QgsSymbolSelectorWidget::advancedMenu()
Expand Down

0 comments on commit 969b129

Please sign in to comment.