Commit c1fd41c5 authored by hjk's avatar hjk

Debugger: Replace empty tooltips by a "No valid expression" message

Task-number: QTCREATORBUG-13774
Change-Id: I2c14a50c1457ca4f24843df2691fda83a790931b
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 48ac7c18
...@@ -831,8 +831,9 @@ void DebuggerToolTipHolder::setState(DebuggerTooltipState newState) ...@@ -831,8 +831,9 @@ void DebuggerToolTipHolder::setState(DebuggerTooltipState newState)
bool ok = (state == New && newState == PendingUnshown) bool ok = (state == New && newState == PendingUnshown)
|| (state == PendingUnshown && newState == PendingShown) || (state == PendingUnshown && newState == PendingShown)
|| (state == PendingShown && newState == Acquired) || (state == PendingShown && newState == Acquired)
|| (state == Acquired && (newState == Released)) || (state == Acquired && newState == Released)
|| (state == Released && (newState == Acquired)); || (state == Acquired && newState == Acquired)
|| (state == Released && newState == Acquired);
// FIXME: These happen when a tooltip is re-used in findOrCreate. // FIXME: These happen when a tooltip is re-used in findOrCreate.
ok = ok ok = ok
...@@ -856,9 +857,22 @@ void DebuggerToolTipHolder::destroy() ...@@ -856,9 +857,22 @@ void DebuggerToolTipHolder::destroy()
void DebuggerToolTipHolder::releaseEngine() void DebuggerToolTipHolder::releaseEngine()
{ {
DEBUG("RELEASE ENGINE: STATE " << state);
if (state == Released) if (state == Released)
return; return;
DEBUG("RELEASE ENGINE: STATE " << state);
if (state == PendingShown) {
// This happens after hovering over something that looks roughly like
// a valid expression but can't be resolved by the debugger backend.
// (Out of scope items, keywords, ...)
ToolTip::show(context.mousePosition,
DebuggerToolTipManager::tr("No valid expression"),
Internal::mainWindow());
QTC_ASSERT(widget, return);
widget->deleteLater();
return;
}
setState(Released); setState(Released);
QTC_ASSERT(widget, return); QTC_ASSERT(widget, return);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment