@@ -783,12 +783,13 @@ bool QgsAttributeForm::currentFormFeature( QgsFeature &feature )
783
783
784
784
void QgsAttributeForm::clearInvalidConstraintsMessage ()
785
785
{
786
+ mInvalidConstraintMessage ->hide ();
786
787
mInvalidConstraintMessage ->clear ();
787
788
mInvalidConstraintMessage ->setStyleSheet ( QString () );
788
789
}
789
790
790
- void QgsAttributeForm::displayInvalidConstraintMessage ( const QStringList & f,
791
- const QStringList & d )
791
+ void QgsAttributeForm::displayInvalidConstraintMessage ( const QStringList& f,
792
+ const QStringList& d )
792
793
{
793
794
clearInvalidConstraintsMessage ();
794
795
@@ -804,6 +805,7 @@ void QgsAttributeForm::displayInvalidConstraintMessage( const QStringList &f,
804
805
QString title = QString ( " <img src=\" %1\" > <b>%2:" ).arg ( icPath ).arg ( tr ( " Invalid fields" ) );
805
806
QString msg = QString ( " %1</b><ul>%2</ul>" ).arg ( title ).arg ( descriptions ) ;
806
807
808
+ mInvalidConstraintMessage ->show ();
807
809
mInvalidConstraintMessage ->setText ( msg );
808
810
mInvalidConstraintMessage ->setStyleSheet ( " QLabel { background-color : #ffc800; }" );
809
811
}
@@ -922,8 +924,8 @@ void QgsAttributeForm::onConstraintStatusChanged( const QString& constraint,
922
924
}
923
925
}
924
926
925
- void QgsAttributeForm::constraintDependencies ( QgsEditorWidgetWrapper * w,
926
- QList<QgsEditorWidgetWrapper*> & wDeps )
927
+ void QgsAttributeForm::constraintDependencies ( QgsEditorWidgetWrapper* w,
928
+ QList<QgsEditorWidgetWrapper*>& wDeps )
927
929
{
928
930
QString name = w->field ().name ();
929
931
@@ -1051,6 +1053,7 @@ void QgsAttributeForm::init()
1051
1053
vl->addWidget ( mMessageBar );
1052
1054
1053
1055
mInvalidConstraintMessage = new QLabel ( this );
1056
+ mInvalidConstraintMessage ->hide ();
1054
1057
vl->addWidget ( mInvalidConstraintMessage );
1055
1058
1056
1059
setLayout ( vl );
0 commit comments