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>
This commit is contained in:
parent
1e85ca2e62
commit
d7d8cde4bb
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user