summaryrefslogtreecommitdiffstats
path: root/tools/shared/qtgradienteditor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shared/qtgradienteditor')
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.cpp10
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);
}