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 "debuggeroutputwindow.h"
|
||||||
#include "debuggerplugin.h"
|
#include "debuggerplugin.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
|
#include "debuggertooltip.h"
|
||||||
|
|
||||||
#include "breakhandler.h"
|
#include "breakhandler.h"
|
||||||
#include "moduleshandler.h"
|
#include "moduleshandler.h"
|
||||||
@@ -421,11 +422,26 @@ void DebuggerEngine::showStatusMessage(const QString &msg, int timeout) const
|
|||||||
showMessage(msg, StatusBar, timeout);
|
showMessage(msg, StatusBar, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerEngine::removeTooltip()
|
||||||
|
{
|
||||||
|
watchHandler()->removeTooltip();
|
||||||
|
hideDebuggerToolTip();
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerEngine::handleCommand(int role, const QVariant &value)
|
void DebuggerEngine::handleCommand(int role, const QVariant &value)
|
||||||
{
|
{
|
||||||
//qDebug() << "COMMAND: " << role << value;
|
if (role != RequestToolTipByExpressionRole)
|
||||||
|
removeTooltip();
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
case RequestActivateFrameRole:
|
||||||
|
activateFrame(value.toInt());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RequestReloadFullStackRole:
|
||||||
|
reloadFullStack();
|
||||||
|
break;
|
||||||
|
|
||||||
case RequestReloadSourceFilesRole:
|
case RequestReloadSourceFilesRole:
|
||||||
reloadSourceFiles();
|
reloadSourceFiles();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ public:
|
|||||||
virtual void selectThread(int index);
|
virtual void selectThread(int index);
|
||||||
|
|
||||||
virtual void assignValueInDebugger(const QString &expr, const QString &value);
|
virtual void assignValueInDebugger(const QString &expr, const QString &value);
|
||||||
|
virtual void removeTooltip();
|
||||||
|
|
||||||
// Convenience
|
// Convenience
|
||||||
static QMessageBox *showMessageBox
|
static QMessageBox *showMessageBox
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ void ToolTipWidget::run(const QPoint &point, QAbstractItemModel *model,
|
|||||||
{
|
{
|
||||||
move(point);
|
move(point);
|
||||||
setModel(model);
|
setModel(model);
|
||||||
setRootIndex(index.parent());
|
|
||||||
computeSize();
|
computeSize();
|
||||||
setRootIsDecorated(model->hasChildren(index));
|
setRootIsDecorated(model->hasChildren(index));
|
||||||
// FIXME: use something more sensible
|
// FIXME: use something more sensible
|
||||||
|
|||||||
@@ -3189,9 +3189,6 @@ bool GdbEngine::supportsThreads() const
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QString GdbEngine::m_toolTipExpression;
|
|
||||||
QPoint GdbEngine::m_toolTipPos;
|
|
||||||
|
|
||||||
bool GdbEngine::showToolTip()
|
bool GdbEngine::showToolTip()
|
||||||
{
|
{
|
||||||
QByteArray iname = tooltipIName(m_toolTipExpression);
|
QByteArray iname = tooltipIName(m_toolTipExpression);
|
||||||
@@ -4394,6 +4391,13 @@ void GdbEngine::resetCommandQueue()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GdbEngine::removeTooltip()
|
||||||
|
{
|
||||||
|
m_toolTipExpression.clear();
|
||||||
|
m_toolTipPos = QPoint();
|
||||||
|
DebuggerEngine::removeTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Factory
|
// Factory
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -532,9 +532,10 @@ private: ////////// View & Data Stuff //////////
|
|||||||
AbstractGdbProcess *gdbProc() const;
|
AbstractGdbProcess *gdbProc() const;
|
||||||
void showExecutionError(const QString &message);
|
void showExecutionError(const QString &message);
|
||||||
|
|
||||||
static QString m_toolTipExpression;
|
void removeTooltip();
|
||||||
static QPoint m_toolTipPos;
|
|
||||||
static QByteArray tooltipIName(const QString &exp);
|
static QByteArray tooltipIName(const QString &exp);
|
||||||
|
QString m_toolTipExpression;
|
||||||
|
QPoint m_toolTipPos;
|
||||||
|
|
||||||
// HACK:
|
// HACK:
|
||||||
StackFrame m_targetFrame;
|
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)
|
bool StackHandler::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||||
{
|
{
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
case RequestReloadFullStackRole:
|
||||||
case RequestActivateFrameRole:
|
case RequestActivateFrameRole:
|
||||||
m_engine->activateFrame(value.toInt());
|
m_engine->handleCommand(role, value);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case RequestShowMemoryRole:
|
case RequestShowMemoryRole:
|
||||||
@@ -154,10 +155,6 @@ bool StackHandler::setData(const QModelIndex &index, const QVariant &value, int
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case RequestReloadFullStackRole:
|
|
||||||
m_engine->reloadFullStack();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QAbstractTableModel::setData(index, value, role);
|
return QAbstractTableModel::setData(index, value, role);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1661,5 +1661,11 @@ void WatchHandler::showInEditorHelper(QString *contents, WatchItem *item, int de
|
|||||||
showInEditorHelper(contents, child, depth + 1);
|
showInEditorHelper(contents, child, depth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WatchHandler::removeTooltip()
|
||||||
|
{
|
||||||
|
m_tooltips->reinitialize();
|
||||||
|
m_tooltips->emitAllChanged();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public:
|
|||||||
|
|
||||||
void loadSessionData();
|
void loadSessionData();
|
||||||
void saveSessionData();
|
void saveSessionData();
|
||||||
|
void removeTooltip();
|
||||||
|
|
||||||
void initializeFromTemplate(WatchHandler *other);
|
void initializeFromTemplate(WatchHandler *other);
|
||||||
void storeToTemplate(WatchHandler *other);
|
void storeToTemplate(WatchHandler *other);
|
||||||
|
|||||||
Reference in New Issue
Block a user