diff options
Diffstat (limited to 'tools/shared/qtpropertybrowser/qteditorfactory.cpp')
-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); } } |