From 830e09ccca8e000a51a379b4b43bfccd3c269f33 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 22 Mar 2024 15:01:15 +0100 Subject: [PATCH] QmlJSEditor: Fix hovering color properties Color properties set with hex color values display a color tool tip, but named colors failed for Qt6 while it was still working with Qt5. Change-Id: I6457bbdc86dd7f036bc48dc40cfa16cda570b95f Reviewed-by: Ulf Hermann Reviewed-by: Reviewed-by: Sami Shalayel --- src/plugins/qmljseditor/qmljshoverhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index 3f7d3a5c110..188d49fabb2 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -293,7 +293,9 @@ bool QmlJSHoverHandler::matchColorItem(const ScopeChain &scopeChain, if (auto binding = AST::cast(member)) { if (binding->qualifiedId && posIsInSource(pos, binding->statement)) { value = scopeChain.evaluate(binding->qualifiedId); - if (value && value->asColorValue()) { + if (value && (value->asColorValue() + || (value->asCppComponentValue() + && value->asCppComponentValue()->className() == "color"))) { color = textAt(qmlDocument, binding->statement->firstSourceLocation(), binding->statement->lastSourceLocation());