Skip to content
Permalink
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.

(cherry-picked from b422504)
  • Loading branch information
nyalldawson committed Aug 16, 2018
1 parent c4eb57d commit 01b4ede1cc36d52b6f1a5998ea4074fb3c52ac7f
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gui/symbology/qgssymbolselectordialog.cpp
@@ -253,10 +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 ) );
it.nextFeature( mPreviewFeature );
#endif
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
#if 0
mPreviewExpressionContext.setFeature( mPreviewFeature );
#endif
}
else
{

0 comments on commit 01b4ede

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