Commit a59f45c5 authored by hjk's avatar hjk
Browse files

debugger: try to improve tooltip handling

Still far from usable.
parent ed843bf5
......@@ -114,9 +114,9 @@ static const char winPythonVersionC[] = "python2.5";
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
QByteArray GdbEngine::tooltipIName()
QByteArray GdbEngine::tooltipIName(const QString &exp)
{
return "tooltip.x";
return "tooltip." + exp.toLatin1().toHex();
}
static bool stateAcceptsGdbCommands(DebuggerState state)
......@@ -3222,7 +3222,7 @@ QPoint GdbEngine::m_toolTipPos;
bool GdbEngine::showToolTip()
{
QByteArray iname = tooltipIName();
QByteArray iname = tooltipIName(m_toolTipExpression);
if (!theDebuggerBoolSetting(UseToolTipsInMainEditor)) {
watchHandler()->removeData(iname);
......@@ -3257,8 +3257,10 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
m_toolTipPos = mousePos;
int line, column;
QString exp = cppExpressionAt(editor, cursorPos, &line, &column);
if (exp == m_toolTipExpression)
if (!exp.isEmpty() && exp == m_toolTipExpression) {
showToolTip();
return;
}
m_toolTipExpression = exp;
......@@ -3326,7 +3328,7 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
WatchData toolTip;
toolTip.exp = exp.toLatin1();
toolTip.name = exp;
toolTip.iname = tooltipIName();
toolTip.iname = tooltipIName(exp);
watchHandler()->removeData(toolTip.iname);
watchHandler()->insertData(toolTip);
}
......
......@@ -525,7 +525,7 @@ private: ////////// View & Data Stuff //////////
static QString m_toolTipExpression;
static QPoint m_toolTipPos;
static QByteArray tooltipIName();
static QByteArray tooltipIName(const QString &exp);
// HACK:
StackFrame m_targetFrame;
......
......@@ -60,8 +60,11 @@ void GdbEngine::updateLocalsPython(const QByteArray &varList)
expanded += "formats:" + handler->individualFormatRequests();
QByteArray watchers;
if (!m_toolTipExpression.isEmpty())
watchers += m_toolTipExpression.toLatin1() + '#' + tooltipIName();
if (!m_toolTipExpression.isEmpty()) {
watchers += m_toolTipExpression.toLatin1();
watchers += '#';
watchers += tooltipIName(m_toolTipExpression);
}
QHash<QByteArray, int> watcherNames = handler->watcherNames();
QHashIterator<QByteArray, int> it(watcherNames);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment