Skip to content
Permalink
Browse files

default flag on search widget for relation reference so it's selected…

… when the value changes for the first time. reported here #37843
  • Loading branch information
signedav authored and nyalldawson committed Sep 9, 2020
1 parent 029f067 commit a89765e9ce7a40fdf7a48126d36cb5659af4f42a
@@ -48,6 +48,12 @@ Returns a variant representing the current state of the widget.

virtual QgsSearchWidgetWrapper::FilterFlags supportedFlags() const;


virtual QgsSearchWidgetWrapper::FilterFlags defaultFlags() const;

%Docstring
Returns the default flags (equalTo)
%End
virtual QString createExpression( QgsSearchWidgetWrapper::FilterFlags flags ) const;


@@ -72,6 +72,11 @@ QgsSearchWidgetWrapper::FilterFlags QgsRelationReferenceSearchWidgetWrapper::sup
return EqualTo | NotEqualTo | IsNull | IsNotNull;
}

QgsSearchWidgetWrapper::FilterFlags QgsRelationReferenceSearchWidgetWrapper::defaultFlags() const
{
return EqualTo;
}

QString QgsRelationReferenceSearchWidgetWrapper::createExpression( QgsSearchWidgetWrapper::FilterFlags flags ) const
{
QString fieldName = createFieldIdentifier();
@@ -60,6 +60,11 @@ class GUI_EXPORT QgsRelationReferenceSearchWidgetWrapper : public QgsSearchWidge
QString expression() const override;
bool valid() const override;
QgsSearchWidgetWrapper::FilterFlags supportedFlags() const override;

/**
* Returns the default flags (equalTo)
*/
QgsSearchWidgetWrapper::FilterFlags defaultFlags() const override;
QString createExpression( QgsSearchWidgetWrapper::FilterFlags flags ) const override;

public slots:

0 comments on commit a89765e

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