summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-08 11:45:10 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-08 10:48:53 +0000
commitc4bfc1977419de9815a9b54a6f0bc817c0b15858 (patch)
tree11d34df4ff7a999bf84d44c74b7917fafc248afe
parent85289a60d62f4ad4cf5f95a05b9572acd7316591 (diff)
Fix warning from deprecated QColor::setNamedColor API
Use QColor::fromColor instead to create an initialized color, and make it const. Change-Id: I838859562dedb079c9fc0bcfe63a50f630c197b8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6586ccbbc19162c9a388af64a21653bd9f51569d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tools/testcon/changeproperties.cpp3
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 {