Navigation Menu

Skip to content

Commit

Permalink
Widget constraints: use field alias where available
Browse files Browse the repository at this point in the history
Fix #15455
  • Loading branch information
m-kuhn committed Aug 19, 2016
1 parent 7b7a156 commit 78e8393
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp
Expand Up @@ -142,7 +142,7 @@ void QgsEditorWidgetWrapper::updateConstraint( const QgsFeature &ft )
{
if ( !expression.isEmpty() )
{
QString fieldName = ft.fields()->field( mFieldIdx ).name();
QString fieldName = layer()->attributeDisplayName( mFieldIdx );
expression = "( " + expression + " ) AND ( " + fieldName + " IS NOT NULL)";
description = "( " + description + " ) AND NotNull";
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributeform.cpp
Expand Up @@ -888,7 +888,7 @@ void QgsAttributeForm::onUpdatedFields()
}

void QgsAttributeForm::onConstraintStatusChanged( const QString& constraint,
const QString &description, const QString& err, bool ok )
const QString& description, const QString& err, bool ok )
{
QgsEditorWidgetWrapper* eww = qobject_cast<QgsEditorWidgetWrapper*>( sender() );
Q_ASSERT( eww );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributeform.h
Expand Up @@ -256,7 +256,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
void onAttributeDeleted( int idx );
void onUpdatedFields();
void onConstraintStatusChanged( const QString& constraint,
const QString &description, const QString& err, bool ok );
const QString& description, const QString& err, bool ok );
void preventFeatureRefresh();
void synchronizeEnabledState();
void layerSelectionChanged();
Expand Down

0 comments on commit 78e8393

Please sign in to comment.