From 74f24c96e1341a6fe287e562a905f6e4e70f4ab4 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 19 Sep 2014 15:06:53 +0200 Subject: [PATCH] Debugger: Show a "no valid expression" hint in tooltips So far silently nothing happened, which can be annoying. Change-Id: Ib0a20343b41a0737de82c2894d526e46a21400a4 Reviewed-by: hjk --- src/plugins/debugger/debuggertooltipmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 92e9c279a55..c546f069f05 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -1338,8 +1338,11 @@ bool DebuggerToolTipManager::tryHandleToolTipOverride(BaseTextEditor *editor, co QString raw = cppExpressionAt(editor, context.position, &context.line, &context.column, &context.function); context.expression = fixCppExpression(raw); - if (context.expression.isEmpty()) - return false; + if (context.expression.isEmpty()) { + const Utils::WidgetContent widgetContent(new QLabel(tr("No valid expression")), true); + Utils::ToolTip::show(context.mousePosition, widgetContent, debuggerCore()->mainWindow()); + return true; + } // Prefer a filter on an existing local variable if it can be found. if (const WatchData *localVariable = engine->watchHandler()->findCppLocalVariable(context.expression)) {