mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Short connection timeout for symbol selector preview feature fetching
Because we don't really care if we couldn't fulfill this request, and the request itself is blocking UI.
This commit is contained in:
parent
70277635a2
commit
f3235f7c43
@ -253,7 +253,8 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
|
|||||||
//get first feature from layer for previews
|
//get first feature from layer for previews
|
||||||
if ( mVectorLayer )
|
if ( mVectorLayer )
|
||||||
{
|
{
|
||||||
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ) );
|
// 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 );
|
it.nextFeature( mPreviewFeature );
|
||||||
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
|
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
|
||||||
mPreviewExpressionContext.setFeature( mPreviewFeature );
|
mPreviewExpressionContext.setFeature( mPreviewFeature );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user