diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2016-08-26 13:25:59 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-08-26 22:18:02 +0000 |
commit | d7d8cde4bbdc47c9ddf73eecf4ddadc1e8515703 (patch) | |
tree | 6a94711e3460ec5099ed3f4bfb7c332470b0a680 /src/widgets/dialogs | |
parent | 1e85ca2e62e9aba553a53effabf52272aa3acb70 (diff) |
QColorDialog::getRgba: Fixed ignoring of initial alpha value
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 <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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(); |