Skip to content

Commit 53d642c

Browse files
committedNov 13, 2017
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.
1 parent 0ccf6fa commit 53d642c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed
 

‎python/gui/qgsattributeformeditorwidget.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class QgsAttributeFormEditorWidget : QWidget
101101
Set the constraint status for this widget.
102102
%End
103103

104+
void setConstraintResultVisibility( bool editable );
105+
%Docstring
106+
Set the constraint result lable visible or invisible according to the layer editable status
107+
%End
108+
104109
public slots:
105110

106111
void setIsMixed( bool mixed );

‎src/gui/qgsattributeform.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,8 @@ void QgsAttributeForm::synchronizeEnabledState()
966966
QgsEditorWidgetWrapper *eww = qobject_cast<QgsEditorWidgetWrapper *>( ww );
967967
if ( eww )
968968
{
969+
mFormEditorWidgets.value( eww->fieldIdx() )->setConstraintResultVisibility( isEditable );
970+
969971
bool enabled = isEditable && fieldIsEditable( eww->fieldIdx() );
970972
ww->setEnabled( enabled );
971973

‎src/gui/qgsattributeformeditorwidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ void QgsAttributeFormEditorWidget::setConstraintStatus( const QString &constrain
159159
}
160160
}
161161

162+
void QgsAttributeFormEditorWidget::setConstraintResultVisibility( bool editable )
163+
{
164+
mConstraintResultLabel->setHidden( !editable );
165+
}
166+
162167
void QgsAttributeFormEditorWidget::setMode( QgsAttributeFormEditorWidget::Mode mode )
163168
{
164169
mMode = mode;

‎src/gui/qgsattributeformeditorwidget.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ class GUI_EXPORT QgsAttributeFormEditorWidget : public QWidget
123123
*/
124124
void setConstraintStatus( const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result );
125125

126+
/**
127+
* Set the constraint result lable visible or invisible according to the layer editable status
128+
*/
129+
void setConstraintResultVisibility( bool editable );
130+
126131
public slots:
127132

128133
/**

0 commit comments

Comments
 (0)
Please sign in to comment.