diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-09-16 13:18:04 (GMT) |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-09-16 13:18:04 (GMT) |
commit | 418d0345380140bc5e2ad77987cad6aa081c1878 (patch) | |
tree | f1ba6e763dff91d5044b656364d062499a49e637 /tools/shared/qtpropertybrowser | |
parent | bc7eb95302d9fac44c8e922b173a576aaa9606d5 (diff) | |
download | Qt-418d0345380140bc5e2ad77987cad6aa081c1878.zip Qt-418d0345380140bc5e2ad77987cad6aa081c1878.tar.gz Qt-418d0345380140bc5e2ad77987cad6aa081c1878.tar.bz2 |
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 18a596f..1be5ca6 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); } } |