Skip to content
Permalink
Browse files

Fix clearing constraints

  • Loading branch information
nyalldawson authored and m-kuhn committed Nov 16, 2016
1 parent 747097d commit 95271c869bbe489404f85696d7d1cef029ab8e24
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/app/qgsfieldsproperties.cpp
@@ -1001,14 +1001,26 @@ void QgsFieldsProperties::apply()
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintNotNull, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintUnique )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintUnique, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintUnique, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintUnique );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintExpression )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintExpression, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintExpression, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintExpression );
}

if ( mFieldsList->item( i, attrWMSCol )->checkState() == Qt::Unchecked )
{

0 comments on commit 95271c8

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