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();
|
||||
|
||||
if (color != m_color) {
|
||||
if (color.isValid() && color != m_color) {
|
||||
m_color = color;
|
||||
update();
|
||||
emit valueChanged();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user