diff --git a/src/blackgui/editors/form.cpp b/src/blackgui/editors/form.cpp index 34b6e4b99..13eae1fa9 100644 --- a/src/blackgui/editors/form.cpp +++ b/src/blackgui/editors/form.cpp @@ -36,6 +36,13 @@ namespace BlackGui return CStatusMessageList(); } + CStatusMessageList CForm::validateAsOverlayMessage(bool withNestedObjects, bool appendOldMessages, int timeOutMs) + { + const CStatusMessageList msgs = this->validate(withNestedObjects); + this->showOverlayMessages(msgs, appendOldMessages, timeOutMs); + return msgs; + } + void CForm::jsonPasted(const QString &json) { Q_UNUSED(json); diff --git a/src/blackgui/editors/form.h b/src/blackgui/editors/form.h index f09bb8777..e968ef991 100644 --- a/src/blackgui/editors/form.h +++ b/src/blackgui/editors/form.h @@ -48,6 +48,10 @@ namespace BlackGui //! Validate, empty list means OK virtual BlackMisc::CStatusMessageList validate(bool withNestedObjects = true) const; + //! Validate as overlay message + //! \note uses CForm::validate and displays the messages as overlay messages + BlackMisc::CStatusMessageList validateAsOverlayMessage(bool withNestedObjects = true, bool appendOldMessages = false, int timeOutMs = -1); + //! Is read only? bool isReadOnly() const { return m_readOnly; }