Skip to content
Permalink
Browse files

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

…view widget (#37643)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
qgis-bot and github-actions committed Jul 7, 2020
1 parent 998c51d commit c28ed4a36feb534bb688a4268f1975bb109a1c1c
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 c28ed4a

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