forked from qt-creator/qt-creator
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 <ulf.hermann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit is contained in:
@@ -293,7 +293,9 @@ bool QmlJSHoverHandler::matchColorItem(const ScopeChain &scopeChain,
|
||||
if (auto binding = AST::cast<const AST::UiScriptBinding *>(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());
|
||||
|
Reference in New Issue
Block a user