From 9902ed2bc91adfaa0905e4680323d9d6a9c237e2 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 25 Oct 2011 12:11:45 +0200 Subject: [PATCH] QmlJS tooltips: Avoid unhelpful tooltips. Saying 'unknown' or 'undefined' isn't very useful. Change-Id: I130013a8f025ebc5eb984358f269fdf8a23aae92 Reviewed-by: Roberto Raggi --- src/plugins/qmljseditor/qmljshoverhandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index d2c5797c7e8..952d6d7d0fb 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -305,9 +305,10 @@ void HoverHandler::prettyPrintTooltip(const QmlJS::Value *value, } if (toolTip().isEmpty()) { - QString typeId = context->valueOwner()->typeId(value); - if (typeId != QLatin1String("undefined")) + if (!value->asUndefinedValue() && !value->asUnknownValue()) { + const QString typeId = context->valueOwner()->typeId(value); setToolTip(typeId); + } } }