diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-06-25 10:04:40 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-06-25 14:09:37 +0200 |
commit | 7c833601402d536bccb1541a17755d20a1a102de (patch) | |
tree | 154901275c3bd5d79459625a3ed6d556d11fed38 /src/widgets/dialogs/qcolordialog_p.h | |
parent | 4cf37985e4c7108ff1e28ae875b0ee33c523e8b3 (diff) |
QColorDialog: Do not update custom/standard color cells while picking.
Delay the updating of the custom/standard color cells to the mouse
release of the color pick. This makes it possible to pre-select
a custom color cell for assignment before the pick and prevents
that from changing when its color is crossed by accident.
Rename the existing method QColorDialogPrivate::setCurrentColor(QRgb)
to setCurrentRgbColor() and move QColor::setCurrentColor() to
QColorDialogPrivate, introducing an enumeration for specifying what to
set.
Task-number: QTBUG-39792
Change-Id: Ibfe96e345589346e8c72976a0335e901798f2766
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets/dialogs/qcolordialog_p.h')
-rw-r--r-- | src/widgets/dialogs/qcolordialog_p.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qcolordialog_p.h b/src/widgets/dialogs/qcolordialog_p.h index 72c3b0e3cd..feabce4bbf 100644 --- a/src/widgets/dialogs/qcolordialog_p.h +++ b/src/widgets/dialogs/qcolordialog_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtWidgets module of the Qt Toolkit. @@ -77,6 +77,12 @@ class QColorDialogPrivate : public QDialogPrivate Q_DECLARE_PUBLIC(QColorDialog) public: + enum SetColorMode { + ShowColor = 0x1, + SelectColor = 0x2, + SetColorAll = ShowColor | SelectColor + }; + QColorDialogPrivate() : options(new QColorDialogOptions) {} QPlatformColorDialogHelper *platformColorDialogHelper() const @@ -86,7 +92,8 @@ public: void initWidgets(); QRgb currentColor() const; QColor currentQColor() const; - void setCurrentColor(QRgb rgb); + void setCurrentColor(const QColor &color, SetColorMode setColorMode = SetColorAll); + void setCurrentRgbColor(QRgb rgb); void setCurrentQColor(const QColor &color); bool selectColor(const QColor &color); QColor grabScreenColor(const QPoint &p); |