summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKnud Dollereder <knud.dollereder@qt.io>2022-08-18 13:13:09 +0200
committerKnud Dollereder <knud.dollereder@qt.io>2022-08-18 12:02:31 +0000
commit5c68fb68ceff9222eed7e199b0622217140a7bc7 (patch)
tree0884f31802bf792b824ac9e4ca56a6bacc3460cc
parentdc2cd9db946d4f176269b852e55f21134590f4b0 (diff)
downloadqt-creator-5c68fb68ceff9222eed7e199b0622217140a7bc7.tar.gz
Do not update control values when pressing cancel
Change-Id: I3d365e760fa8ba4a0b36a995d0bf6a59f2d9734b Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/colorcontrol.cpp2
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp4
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinecontrols.cpp2
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 f8587df06f..cb6811c975 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 1bf437e802..60553dc620 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 <QDoubleSpinBox>
#include <QSpinBox>
@@ -110,7 +110,7 @@ QWidget* SetFrameValueDialog::createValueControl(const QVariant& value)
{
case QMetaType::QColor: {
- auto* widget = new StyleEditor::ColorControl(value.value<QColor>());
+ auto* widget = new ColorControl(value.value<QColor>());
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 185b12ea42..f417d5dad0 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();