Skip to content
Permalink
Browse files

Widget constraints: use field alias where available

Fix #15455
  • Loading branch information
m-kuhn committed Aug 19, 2016
1 parent 7b7a156 commit 78e8393f1e52f3488f01f0b731450ed5595fc20a
@@ -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";
}
@@ -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 );
@@ -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();

0 comments on commit 78e8393

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