From 14afb2ce9b742716354a06262f56f2d501710641 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 2 Jul 2016 14:43:01 +0300 Subject: [PATCH] Resolved issue #521. Error: Can't create Seam Allowance after using Union Tool. --HG-- branch : develop --- .../vtools/dialogs/tools/dialogdetail.cpp | 23 ++++++++++++++++++- src/libs/vtools/dialogs/tools/dialogdetail.h | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index b81f76934..0cc6bb33c 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -85,7 +85,7 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams); connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed); connect(ui.checkBoxReverse, &QCheckBox::clicked, this, &DialogDetail::ClickedReverse); - connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged); + connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NameDetailChanged); connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem); connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp); @@ -153,6 +153,27 @@ void DialogDetail::CheckState() } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogDetail::NameDetailChanged() +{ + SCASSERT(labelEditNamePoint != nullptr); + QLineEdit* edit = qobject_cast(sender()); + if (edit) + { + if (edit->text().isEmpty()) + { + flagName = false; + ChangeColor(labelEditNamePoint, Qt::red); + } + else + { + flagName = true; + ChangeColor(labelEditNamePoint, okColor); + } + } + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief NewItem add new object (point, arc, spline or spline path) to list diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.h b/src/libs/vtools/dialogs/tools/dialogdetail.h index 6dcd5c43e..11286af08 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.h +++ b/src/libs/vtools/dialogs/tools/dialogdetail.h @@ -62,6 +62,8 @@ protected: */ virtual void SaveData() Q_DECL_OVERRIDE; virtual void CheckState() Q_DECL_OVERRIDE; +private slots: + void NameDetailChanged(); private: /** @brief ui keeps information about user interface */