forked from qt-creator/qt-creator
debugger: suppress variable tooltips with outdated contents
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -156,6 +156,7 @@ public:
|
||||
|
||||
void loadSessionData();
|
||||
void saveSessionData();
|
||||
void removeTooltip();
|
||||
|
||||
void initializeFromTemplate(WatchHandler *other);
|
||||
void storeToTemplate(WatchHandler *other);
|
||||
|
||||
Reference in New Issue
Block a user