diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-09-16 15:18:04 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-09-16 15:18:04 +0200 |
commit | 418d0345380140bc5e2ad77987cad6aa081c1878 (patch) | |
tree | f1ba6e763dff91d5044b656364d062499a49e637 /tools/shared/qtpropertybrowser | |
parent | bc7eb95302d9fac44c8e922b173a576aaa9606d5 (diff) | |
download | qt4-tools-418d0345380140bc5e2ad77987cad6aa081c1878.tar.gz |
Fix alpha setting in Designer's "Edit Palette" window
Use QColorDialog::getColor() instead of deprecated
QColorDialog::getRgba(), which causes alpha value
to get lost in the process.
Task-number: QT-4494
Reviewed-by: Jarek Kobus <jkobus@trolltech.com>
Diffstat (limited to 'tools/shared/qtpropertybrowser')
-rw-r--r-- | tools/shared/qtpropertybrowser/qteditorfactory.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/shared/qtpropertybrowser/qteditorfactory.cpp b/tools/shared/qtpropertybrowser/qteditorfactory.cpp index 18a596f800..1be5ca69f1 100644 --- a/tools/shared/qtpropertybrowser/qteditorfactory.cpp +++ b/tools/shared/qtpropertybrowser/qteditorfactory.cpp @@ -2202,11 +2202,9 @@ void QtColorEditWidget::setValue(const QColor &c) void QtColorEditWidget::buttonClicked() { - bool ok = false; - QRgb oldRgba = m_color.rgba(); - QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this); - if (ok && newRgba != oldRgba) { - setValue(QColor::fromRgba(newRgba)); + const QColor newColor = QColorDialog::getColor(m_color, this, QString(), QColorDialog::ShowAlphaChannel); + if (newColor.isValid() && newColor != m_color) { + setValue(newColor); emit valueChanged(m_color); } } |