From 54e2025439d9642923a563cfaa8b1c51dddc9439 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 11 Dec 2018 11:48:42 +0200 Subject: [PATCH] Fix deprecated QColorDialog::getRgba. --HG-- branch : develop --- .../vpropertyexplorer/plugins/vcolorpropertyeditor.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index a4aa4a335..574ef1333 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -96,12 +96,10 @@ QString VPE::VColorPropertyEditor::GetColorString(const QColor& color) void VPE::VColorPropertyEditor::onToolButtonClicked() { - bool ok = false; - QRgb oldRgba = Color.rgba(); - QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this); - if (ok && newRgba != oldRgba) + const QColor newColor = QColorDialog::getColor(Color, this, QString(), QColorDialog::ShowAlphaChannel); + if (newColor.isValid() && newColor != Color) { - SetColor(QColor::fromRgba(newRgba)); + SetColor(newColor); emit dataChangedByUser(Color, this); UserChangeEvent *event = new UserChangeEvent(); QCoreApplication::postEvent ( this, event );