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/qtgradienteditor | |
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/qtgradienteditor')
-rw-r--r-- | tools/shared/qtgradienteditor/qtcolorbutton.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.cpp b/tools/shared/qtgradienteditor/qtcolorbutton.cpp index 1c29b66..5c38b52 100644 --- a/tools/shared/qtgradienteditor/qtcolorbutton.cpp +++ b/tools/shared/qtgradienteditor/qtcolorbutton.cpp @@ -68,14 +68,10 @@ public: void QtColorButtonPrivate::slotEditColor() { - bool ok; - const QRgb rgba = QColorDialog::getRgba(m_color.rgba(), &ok, q_ptr); - if (!ok) + const QColor newColor = QColorDialog::getColor(m_color, q_ptr, QString(), QColorDialog::ShowAlphaChannel); + if (!newColor.isValid() || newColor == q_ptr->color()) return; - const QColor c = QColor::fromRgba(rgba); - if (c == q_ptr->color()) - return; - q_ptr->setColor(c); + q_ptr->setColor(newColor); emit q_ptr->colorChanged(m_color); } |