diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index c0e642e7950..af0a011fad3 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 b925766366f..542b7d2469a 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 8127c424bd9..3922d6866e9 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;