From 5c68fb68ceff9222eed7e199b0622217140a7bc7 Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Thu, 18 Aug 2022 13:13:09 +0200 Subject: Do not update control values when pressing cancel Change-Id: I3d365e760fa8ba4a0b36a995d0bf6a59f2d9734b Reviewed-by: Thomas Hartmann --- .../qmldesigner/components/curveeditor/detail/colorcontrol.cpp | 2 +- .../qmldesigner/components/timelineeditor/setframevaluedialog.cpp | 4 ++-- .../qmldesigner/components/timelineeditor/timelinecontrols.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/colorcontrol.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/colorcontrol.cpp index f8587df06fe..cb6811c9750 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/colorcontrol.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/colorcontrol.cpp @@ -85,7 +85,7 @@ void ColorControl::mouseReleaseEvent(QMouseEvent *event) event->accept(); - if (color != m_color) { + if (color.isValid() && color != m_color) { m_color = color; update(); emit valueChanged(); diff --git a/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp index 1bf437e802a..60553dc6202 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "setframevaluedialog.h" -#include "curveeditor/detail/colorcontrol.h" +#include "timelinecontrols.h" #include #include @@ -110,7 +110,7 @@ QWidget* SetFrameValueDialog::createValueControl(const QVariant& value) { case QMetaType::QColor: { - auto* widget = new StyleEditor::ColorControl(value.value()); + auto* widget = new ColorControl(value.value()); m_valueGetter = [widget]() { return widget->value(); }; return widget; } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinecontrols.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinecontrols.cpp index 185b12ea422..f417d5dad06 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinecontrols.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinecontrols.cpp @@ -191,7 +191,7 @@ void ColorControl::mouseReleaseEvent(QMouseEvent *event) event->accept(); - if (color != m_color) { + if (color.isValid() && color != m_color) { m_color = color; update(); emit valueChanged(); -- cgit v1.2.3