From 3d7f51f42bb862ff6f55559914231f058a8a0249 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 18 Feb 2016 19:51:57 +0100 Subject: [PATCH] Fixed bug when cancel edit form on new record. --- core/autoform.h | 2 -- core/iform.cpp | 6 +++++- core/iform.h | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/autoform.h b/core/autoform.h index 760b3dc..e288811 100644 --- a/core/autoform.h +++ b/core/autoform.h @@ -24,7 +24,6 @@ class AutoForm : public IForm { public: explicit AutoForm(QWidget *parent = 0) : IForm(parent) { - m_newRec = false; m_serviceConnected = false; m_saved = false; } @@ -73,7 +72,6 @@ private: QList m_bindWidgets; QList m_validators; QHash > m_bindCombos; - bool m_newRec; void bindToUi() { registerCombos(); diff --git a/core/iform.cpp b/core/iform.cpp index ded8846..8e58428 100644 --- a/core/iform.cpp +++ b/core/iform.cpp @@ -2,6 +2,7 @@ IForm::IForm(QWidget *parent) : QWidget(parent) { + m_newRec = false; } IForm::~IForm() @@ -20,6 +21,9 @@ void IForm::setPluginId(const QString &pluginId) void IForm::refresh() { - emit refreshEntity(); + if (!m_newRec) + { + emit refreshEntity(); + } } diff --git a/core/iform.h b/core/iform.h index 7a99e96..d11a6c1 100644 --- a/core/iform.h +++ b/core/iform.h @@ -29,6 +29,9 @@ public slots: private: QString m_pluginId; + +protected: + bool m_newRec; }; #endif // IFORM_H