Skip to content
Permalink
Browse files

Constraint Result Indicator invisible when not in editable mode

The icon for the constraint result indicator cross/tipp disappears when not in editable mode
this is made by the new method setconstraintresult.
  • Loading branch information
signedav committed Nov 9, 2017
1 parent 0ccf6fa commit 53d642cecc3e58fb2993c8ece5ed4b0d9b711b71
@@ -101,6 +101,11 @@ class QgsAttributeFormEditorWidget : QWidget
Set the constraint status for this widget.
%End

void setConstraintResultVisibility( bool editable );
%Docstring
Set the constraint result lable visible or invisible according to the layer editable status
%End

public slots:

void setIsMixed( bool mixed );
@@ -966,6 +966,8 @@ void QgsAttributeForm::synchronizeEnabledState()
QgsEditorWidgetWrapper *eww = qobject_cast<QgsEditorWidgetWrapper *>( ww );
if ( eww )
{
mFormEditorWidgets.value( eww->fieldIdx() )->setConstraintResultVisibility( isEditable );

bool enabled = isEditable && fieldIsEditable( eww->fieldIdx() );
ww->setEnabled( enabled );

@@ -159,6 +159,11 @@ void QgsAttributeFormEditorWidget::setConstraintStatus( const QString &constrain
}
}

void QgsAttributeFormEditorWidget::setConstraintResultVisibility( bool editable )
{
mConstraintResultLabel->setHidden( !editable );
}

void QgsAttributeFormEditorWidget::setMode( QgsAttributeFormEditorWidget::Mode mode )
{
mMode = mode;
@@ -123,6 +123,11 @@ class GUI_EXPORT QgsAttributeFormEditorWidget : public QWidget
*/
void setConstraintStatus( const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result );

/**
* Set the constraint result lable visible or invisible according to the layer editable status
*/
void setConstraintResultVisibility( bool editable );

public slots:

/**

0 comments on commit 53d642c

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