forked from qt-creator/qt-creator
Do not update control values when pressing cancel
Change-Id: I3d365e760fa8ba4a0b36a995d0bf6a59f2d9734b Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -85,7 +85,7 @@ void ColorControl::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
if (color != m_color) {
|
if (color.isValid() && color != m_color) {
|
||||||
m_color = color;
|
m_color = color;
|
||||||
update();
|
update();
|
||||||
emit valueChanged();
|
emit valueChanged();
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "setframevaluedialog.h"
|
#include "setframevaluedialog.h"
|
||||||
#include "curveeditor/detail/colorcontrol.h"
|
#include "timelinecontrols.h"
|
||||||
|
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
@@ -110,7 +110,7 @@ QWidget* SetFrameValueDialog::createValueControl(const QVariant& value)
|
|||||||
{
|
{
|
||||||
|
|
||||||
case QMetaType::QColor: {
|
case QMetaType::QColor: {
|
||||||
auto* widget = new StyleEditor::ColorControl(value.value<QColor>());
|
auto* widget = new ColorControl(value.value<QColor>());
|
||||||
m_valueGetter = [widget]() { return widget->value(); };
|
m_valueGetter = [widget]() { return widget->value(); };
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
@@ -191,7 +191,7 @@ void ColorControl::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
if (color != m_color) {
|
if (color.isValid() && color != m_color) {
|
||||||
m_color = color;
|
m_color = color;
|
||||||
update();
|
update();
|
||||||
emit valueChanged();
|
emit valueChanged();
|
||||||
|
Reference in New Issue
Block a user