Skip to content
Permalink
Browse files

disable feature picker when no feature is available in expression pre…

…view widget (#37518)
  • Loading branch information
3nids committed Jul 7, 2020
1 parent 960e533 commit 5f6dab09abbced6e6cd79845f5c8d2991bf5eef8
Showing with 3 additions and 1 deletion.
  1. +3 −0 src/gui/qgsexpressionpreviewwidget.cpp
  2. +0 −1 src/gui/qgsfeaturepickerwidget.cpp
@@ -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();
}
@@ -81,7 +81,6 @@ QgsFeaturePickerWidget::QgsFeaturePickerWidget( QWidget *parent )
mComboBox->setModel( mModel );

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

}

QgsVectorLayer *QgsFeaturePickerWidget::layer() const

0 comments on commit 5f6dab0

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