diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-08 11:45:10 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-08 12:22:56 +0200 |
commit | 6586ccbbc19162c9a388af64a21653bd9f51569d (patch) | |
tree | efe36c60a26194fab36380cb7b25a2ed960fae13 | |
parent | 057429682b509bfcf4eec644682e8042a4d55a37 (diff) |
Fix warning from deprecated QColor::setNamedColor API
Use QColor::fromColor instead to create an initialized color, and make
it const.
Pick-to: 6.4
Change-Id: I838859562dedb079c9fc0bcfe63a50f630c197b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | tools/testcon/changeproperties.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp index fa30d85..799ee0b 100644 --- a/tools/testcon/changeproperties.cpp +++ b/tools/testcon/changeproperties.cpp @@ -71,8 +71,7 @@ void ChangeProperties::on_buttonSet_clicked() switch (type) { case QMetaType::QColor: { - QColor col; - col.setNamedColor(editValue->text()); + const QColor col = QColor::fromString(editValue->text()); if (col.isValid()) { value = QVariant::fromValue(col); } else { |