Fix deprecated QColorDialog::getRgba.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-12-11 11:48:42 +02:00
parent fc38ce6df1
commit 54e2025439

View file

@ -96,12 +96,10 @@ QString VPE::VColorPropertyEditor::GetColorString(const QColor& color)
void VPE::VColorPropertyEditor::onToolButtonClicked() void VPE::VColorPropertyEditor::onToolButtonClicked()
{ {
bool ok = false; const QColor newColor = QColorDialog::getColor(Color, this, QString(), QColorDialog::ShowAlphaChannel);
QRgb oldRgba = Color.rgba(); if (newColor.isValid() && newColor != Color)
QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this);
if (ok && newRgba != oldRgba)
{ {
SetColor(QColor::fromRgba(newRgba)); SetColor(newColor);
emit dataChangedByUser(Color, this); emit dataChangedByUser(Color, this);
UserChangeEvent *event = new UserChangeEvent(); UserChangeEvent *event = new UserChangeEvent();
QCoreApplication::postEvent ( this, event ); QCoreApplication::postEvent ( this, event );