From d7d8cde4bbdc47c9ddf73eecf4ddadc1e8515703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 26 Aug 2016 13:25:59 +0200 Subject: QColorDialog::getRgba: Fixed ignoring of initial alpha value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation for this method explicitly states that the initial color+alpha is used, but its implementation used a QColor constructor that ignores the alpha value. Change-Id: I71721386e7fae0761e079d8840ec0124a8c14e33 Reviewed-by: Marc Mutz Reviewed-by: Thorbjørn Lindeijer --- src/widgets/dialogs/qcolordialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets/dialogs/qcolordialog.cpp') diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 547a55f19e..c4cc21cbe5 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -2173,7 +2173,8 @@ QColor QColorDialog::getColor(const QColor &initial, QWidget *parent, const QStr QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent) { - QColor color(getColor(QColor(initial), parent, QString(), ShowAlphaChannel)); + const QColor color = getColor(QColor::fromRgba(initial), parent, QString(), + ShowAlphaChannel); QRgb result = color.isValid() ? color.rgba() : initial; if (ok) *ok = color.isValid(); -- cgit v1.2.3