diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index c0e642e795002bb19b9c45978e767f80999316c4..af0a011fad3de99e715abbae296e9391edcd8a7c 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3734,10 +3734,9 @@ bool GdbEngine::showToolTip() return true; } - const QModelIndex index = watchHandler()->itemIndex(iname); - if (!index.isValid()) { + if (!watchHandler()->isValidToolTip(iname)) { watchHandler()->removeData(iname); - return false; + return true; } DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; tw->setExpression(expression); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index b925766366fdd7e1e918692f2b9ce90c0b12c09f..542b7d2469a8b56d0acb5992d6396f3ba0ffc412 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1893,5 +1893,11 @@ void WatchHandler::resetLocation() } } +bool WatchHandler::isValidToolTip(const QByteArray &iname) const +{ + WatchItem *item = m_tooltips->findItem(iname, m_tooltips->m_root); + return item && !item->type.trimmed().isEmpty(); +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 8127c424bd9c5f58881062a048359951bd612fb5..3922d6866e9fe71d7008bea05c7e1c515c6a295e 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -203,6 +203,7 @@ public: void scheduleResetLocation(); void resetLocation(); + bool isValidToolTip(const QByteArray &iname) const; private: friend class WatchModel;