diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index e85885c9a61ed3c969f2911f6b0618edd38c18b9..bff0904e7f11f4cf5b3e5b12479826eb2d99ac27 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -35,6 +35,7 @@ #include "debuggeroutputwindow.h" #include "debuggerplugin.h" #include "debuggerstringutils.h" +#include "debuggertooltip.h" #include "breakhandler.h" #include "moduleshandler.h" @@ -421,11 +422,26 @@ void DebuggerEngine::showStatusMessage(const QString &msg, int timeout) const showMessage(msg, StatusBar, timeout); } +void DebuggerEngine::removeTooltip() +{ + watchHandler()->removeTooltip(); + hideDebuggerToolTip(); +} + void DebuggerEngine::handleCommand(int role, const QVariant &value) { - //qDebug() << "COMMAND: " << role << value; + if (role != RequestToolTipByExpressionRole) + removeTooltip(); switch (role) { + case RequestActivateFrameRole: + activateFrame(value.toInt()); + break; + + case RequestReloadFullStackRole: + reloadFullStack(); + break; + case RequestReloadSourceFilesRole: reloadSourceFiles(); break; diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 8b4b21eed35bc98790f57a8b52c05f67d1be3eae..6f2df32ee195d74d6c6c8d990b30eba69a10fa8b 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -185,6 +185,7 @@ public: virtual void selectThread(int index); virtual void assignValueInDebugger(const QString &expr, const QString &value); + virtual void removeTooltip(); // Convenience static QMessageBox *showMessageBox diff --git a/src/plugins/debugger/debuggertooltip.cpp b/src/plugins/debugger/debuggertooltip.cpp index 96452a4ba40d49a738479585e1b352d19c65a84c..da7511fbefd42b50494f820dd754c09e7f1dcafd 100644 --- a/src/plugins/debugger/debuggertooltip.cpp +++ b/src/plugins/debugger/debuggertooltip.cpp @@ -151,7 +151,6 @@ void ToolTipWidget::run(const QPoint &point, QAbstractItemModel *model, { move(point); setModel(model); - setRootIndex(index.parent()); computeSize(); setRootIsDecorated(model->hasChildren(index)); // FIXME: use something more sensible diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index f0bab9d679ac61eb8996733afd90a8a96d705a59..179802a3cab8483799b39ccd1a5a6395bfb6c432 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3189,9 +3189,6 @@ bool GdbEngine::supportsThreads() const // ////////////////////////////////////////////////////////////////////// -QString GdbEngine::m_toolTipExpression; -QPoint GdbEngine::m_toolTipPos; - bool GdbEngine::showToolTip() { QByteArray iname = tooltipIName(m_toolTipExpression); @@ -4394,6 +4391,13 @@ void GdbEngine::resetCommandQueue() } } +void GdbEngine::removeTooltip() +{ + m_toolTipExpression.clear(); + m_toolTipPos = QPoint(); + DebuggerEngine::removeTooltip(); +} + // // Factory // diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 24ffdc632944ec81e7065c74a9940a848d388927..3e0f77e87db78815321a20fad3fddbfeb52cc46b 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -532,9 +532,10 @@ private: ////////// View & Data Stuff ////////// AbstractGdbProcess *gdbProc() const; void showExecutionError(const QString &message); - static QString m_toolTipExpression; - static QPoint m_toolTipPos; + void removeTooltip(); static QByteArray tooltipIName(const QString &exp); + QString m_toolTipExpression; + QPoint m_toolTipPos; // HACK: StackFrame m_targetFrame; diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index dbf9deee52ecd130061d5c882637acbce3a3133b..d7e995f08318412ce6b8a8bf4eae6e8a36a63ae0 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -140,8 +140,9 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const bool StackHandler::setData(const QModelIndex &index, const QVariant &value, int role) { switch (role) { + case RequestReloadFullStackRole: case RequestActivateFrameRole: - m_engine->activateFrame(value.toInt()); + m_engine->handleCommand(role, value); return true; case RequestShowMemoryRole: @@ -154,10 +155,6 @@ bool StackHandler::setData(const QModelIndex &index, const QVariant &value, int return true; } - case RequestReloadFullStackRole: - m_engine->reloadFullStack(); - return true; - default: return QAbstractTableModel::setData(index, value, role); } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 7d55dc7f4137108f9ab0a4d37c25023b92dcb4d8..2871f2135abd4b2c7f64fbf123c2f69d2d3427cf 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1661,5 +1661,11 @@ void WatchHandler::showInEditorHelper(QString *contents, WatchItem *item, int de showInEditorHelper(contents, child, depth + 1); } +void WatchHandler::removeTooltip() +{ + m_tooltips->reinitialize(); + m_tooltips->emitAllChanged(); +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 42380f8fac3d175bd8a4314e056950e027ad99a8..0c8f0f15eb4876cd8138a2dee28feaf7ba11c3ff 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -156,6 +156,7 @@ public: void loadSessionData(); void saveSessionData(); + void removeTooltip(); void initializeFromTemplate(WatchHandler *other); void storeToTemplate(WatchHandler *other);