summaryrefslogtreecommitdiffstats
path: root/tools/shared
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shared')
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.cpp10
-rw-r--r--tools/shared/qtpropertybrowser/qteditorfactory.cpp8
2 files changed, 6 insertions, 12 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);
}
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);
}
}