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
(cherry-picked from 969b129)
  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent da0de64 commit 9b7ef03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Expand Up @@ -33,6 +33,7 @@
#include "qgssettings.h"
#include "qgsfeatureiterator.h"
#include "qgsvectorlayer.h"
#include "qgssvgcache.h"

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

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()
Expand Down

0 comments on commit 9b7ef03

Please sign in to comment.