@@ -783,12 +783,13 @@ bool QgsAttributeForm::currentFormFeature( QgsFeature &feature )
783783
784784void QgsAttributeForm::clearInvalidConstraintsMessage ()
785785{
786+ mInvalidConstraintMessage ->hide ();
786787 mInvalidConstraintMessage ->clear ();
787788 mInvalidConstraintMessage ->setStyleSheet ( QString () );
788789}
789790
790- void QgsAttributeForm::displayInvalidConstraintMessage ( const QStringList & f,
791- const QStringList & d )
791+ void QgsAttributeForm::displayInvalidConstraintMessage ( const QStringList& f,
792+ const QStringList& d )
792793{
793794 clearInvalidConstraintsMessage ();
794795
@@ -804,6 +805,7 @@ void QgsAttributeForm::displayInvalidConstraintMessage( const QStringList &f,
804805 QString title = QString ( " <img src=\" %1\" > <b>%2:" ).arg ( icPath ).arg ( tr ( " Invalid fields" ) );
805806 QString msg = QString ( " %1</b><ul>%2</ul>" ).arg ( title ).arg ( descriptions ) ;
806807
808+ mInvalidConstraintMessage ->show ();
807809 mInvalidConstraintMessage ->setText ( msg );
808810 mInvalidConstraintMessage ->setStyleSheet ( " QLabel { background-color : #ffc800; }" );
809811}
@@ -922,8 +924,8 @@ void QgsAttributeForm::onConstraintStatusChanged( const QString& constraint,
922924 }
923925}
924926
925- void QgsAttributeForm::constraintDependencies ( QgsEditorWidgetWrapper * w,
926- QList<QgsEditorWidgetWrapper*> & wDeps )
927+ void QgsAttributeForm::constraintDependencies ( QgsEditorWidgetWrapper* w,
928+ QList<QgsEditorWidgetWrapper*>& wDeps )
927929{
928930 QString name = w->field ().name ();
929931
@@ -1051,6 +1053,7 @@ void QgsAttributeForm::init()
10511053 vl->addWidget ( mMessageBar );
10521054
10531055 mInvalidConstraintMessage = new QLabel ( this );
1056+ mInvalidConstraintMessage ->hide ();
10541057 vl->addWidget ( mInvalidConstraintMessage );
10551058
10561059 setLayout ( vl );
0 commit comments