Skip to content
Browse files

Disable feature fetching for symbol selector widget preview

It's just too expensive for any remote provider, e.g. wfs, and
causes many ui lockups. Revisit when support for iterator
timeouts is more mature.
  • Loading branch information
nyalldawson committed Aug 16, 2018
1 parent 291224e commit b422504c37a5ce3791676f67665e3958825d1c36
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/gui/symbology/qgssymbolselectordialog.cpp
@@ -253,11 +253,15 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
//get first feature from layer for previews
if ( mVectorLayer )
#if 0 // this is too expensive to do for many providers. TODO revisit when support for connection timeouts is complete across all providers
// short timeout for request - it doesn't really matter if we don't get the feature, and this call is blocking UI
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ).setConnectionTimeout( 100 ) );
it.nextFeature( mPreviewFeature );
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
#if 0
mPreviewExpressionContext.setFeature( mPreviewFeature );

0 comments on commit b422504

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