Skip to content

Commit

Permalink
disable feature picker when no feature is available in expression pre…
Browse files Browse the repository at this point in the history
…view widget (#37518)
  • Loading branch information
3nids committed Jul 7, 2020
1 parent 960e533 commit 5f6dab0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/gui/qgsexpressionpreviewwidget.cpp
Expand Up @@ -55,10 +55,13 @@ void QgsExpressionPreviewWidget::setCurrentFeature( const QgsFeature &feature )
QgsFeature validFeature( feature );
validFeature.setValid( true );
mExpressionContext.setFeature( validFeature );
mFeaturePickerWidget->setEnabled( false );
mFeaturePickerWidget->setToolTip( tr( "No feature was found on this layer to evaluate the expression." ) );
}
else
{
mExpressionContext.setFeature( feature );
mFeaturePickerWidget->setEnabled( true );
}
refreshPreview();
}
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsfeaturepickerwidget.cpp
Expand Up @@ -81,7 +81,6 @@ QgsFeaturePickerWidget::QgsFeaturePickerWidget( QWidget *parent )
mComboBox->setModel( mModel );

connect( mLineEdit, &QgsFilterLineEdit::textEdited, this, &QgsFeaturePickerWidget::onCurrentTextChanged );

}

QgsVectorLayer *QgsFeaturePickerWidget::layer() const
Expand Down

0 comments on commit 5f6dab0

Please sign in to comment.