Commit 30045bee authored by hjk's avatar hjk Committed by David Schulz
Browse files

Debugger: Simplify Tooltip manager interface



The Editor itself is not really used.

Task-number: QTCREATORBUG-10358
Change-Id: I94620ed7b3b1d6b02c4eef2a359f991217b0a00b
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent b034b0b9
......@@ -483,7 +483,7 @@ bool CdbEngine::setToolTipExpression(const QPoint &mousePos,
tw->setContext(context);
tw->setIname(localVariable->iname);
tw->acquireEngine(this);
DebuggerToolTipManager::instance()->showToolTip(mousePos, editor, tw);
DebuggerToolTipManager::showToolTip(mousePos, tw);
return true;
}
......
......@@ -1107,15 +1107,13 @@ void DebuggerToolTipManager::registerEngine(DebuggerEngine *engine)
connect(engine, SIGNAL(stackFrameCompleted()), this, SLOT(slotStackFrameCompleted()));
}
void DebuggerToolTipManager::showToolTip(const QPoint &p, IEditor *editor,
DebuggerToolTipWidget *toolTipWidget)
void DebuggerToolTipManager::showToolTip(const QPoint &p, DebuggerToolTipWidget *toolTipWidget)
{
QWidget *widget = editor->widget();
if (debugToolTipPositioning)
qDebug() << "DebuggerToolTipManager::showToolTip" << p << " Mouse at " << QCursor::pos();
const Utils::WidgetContent widgetContent(toolTipWidget, true);
Utils::ToolTip::show(p, widgetContent, widget);
registerToolTip(toolTipWidget);
Utils::ToolTip::show(p, widgetContent, debuggerCore()->mainWindow());
m_instance->registerToolTip(toolTipWidget);
}
void DebuggerToolTipManager::registerToolTip(DebuggerToolTipWidget *toolTipWidget)
......
......@@ -207,7 +207,7 @@ public:
const QString &engineType = QString(),
const QString &function= QString()) const;
void showToolTip(const QPoint &p, Core::IEditor *editor, DebuggerToolTipWidget *);
static void showToolTip(const QPoint &p, DebuggerToolTipWidget *);
virtual bool eventFilter(QObject *, QEvent *);
......
......@@ -95,12 +95,11 @@ class GdbToolTipContext : public DebuggerToolTipContext
{
public:
GdbToolTipContext(const DebuggerToolTipContext &c) :
DebuggerToolTipContext(c), editor(0) {}
DebuggerToolTipContext(c) {}
QPoint mousePosition;
QString expression;
QByteArray iname;
Core::IEditor *editor;
};
enum { debugPending = 0 };
......@@ -3984,8 +3983,7 @@ void GdbEngine::showToolTip()
tw->setExpression(m_toolTipContext->expression);
tw->setContext(*m_toolTipContext);
tw->acquireEngine(this);
DebuggerToolTipManager::instance()->showToolTip(m_toolTipContext->mousePosition,
m_toolTipContext->editor, tw);
DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw);
// Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711).
m_toolTipContext.reset();
}
......@@ -4037,7 +4035,6 @@ bool GdbEngine::setToolTipExpression(const QPoint &mousePos,
m_toolTipContext->mousePosition = mousePos;
m_toolTipContext->expression = exp;
m_toolTipContext->iname = iname;
m_toolTipContext->editor = editor;
// Local variable: Display synchronously.
if (iname.startsWith("local")) {
showToolTip();
......
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