diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index f2d418dbc01..b9b80a3efac 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -447,8 +447,7 @@ void CdbEngine::syncVerboseLog(bool verboseLog) postCommand(m_verboseLog ? QByteArray("!sym noisy") : QByteArray("!sym quiet"), 0); } -bool CdbEngine::setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, +bool CdbEngine::setToolTipExpression(TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn) { if (debug) @@ -469,10 +468,7 @@ bool CdbEngine::setToolTipExpression(const QPoint &mousePos, if (!localVariable) return false; context.iname = localVariable->iname; - DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; - tw->setContext(context); - tw->acquireEngine(this); - DebuggerToolTipManager::showToolTip(mousePos, tw); + DebuggerToolTipManager::showToolTip(context, this); return true; } diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index e37265ed496..8aad2eec960 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -76,7 +76,7 @@ public: // Factory function that returns 0 if the debug engine library cannot be found. - virtual bool setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, + virtual bool setToolTipExpression(TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx); virtual void setupEngine(); virtual void setupInferior(); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 6afb7704a09..f1d1c89d333 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1355,8 +1355,8 @@ DebuggerRunControl *DebuggerEngine::runControl() const return d->runControl(); } -bool DebuggerEngine::setToolTipExpression - (const QPoint &, TextEditor::ITextEditor *, const DebuggerToolTipContext &) +bool DebuggerEngine::setToolTipExpression(TextEditor::ITextEditor *, + const DebuggerToolTipContext &) { return false; } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 453c755f4b5..718df1f1980 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -143,8 +143,8 @@ public: const DebuggerStartParameters &startParameters() const; DebuggerStartParameters &startParameters(); - virtual bool setToolTipExpression(const QPoint & mousePos, - TextEditor::ITextEditor *editor, const Internal::DebuggerToolTipContext &); + virtual bool setToolTipExpression(TextEditor::ITextEditor *editor, + const Internal::DebuggerToolTipContext &); virtual void updateWatchData(const Internal::WatchData &data, const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags()); diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 9f526a8b2b9..3627bcdb4cf 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -43,19 +43,20 @@ #include #include -#include -#include -#include #include +#include +#include #include +#include #include #include -#include -#include -#include - #include -#include +#include +#include +#include +#include +#include +#include using namespace Core; using namespace TextEditor; @@ -430,9 +431,6 @@ void DumpTreeModelVisitor::rowEnded() m_level--; } -} // namespace Internal -} // namespace Debugger - /* static QDebug operator<<(QDebug d, const QAbstractItemModel &model) { @@ -445,10 +443,54 @@ static QDebug operator<<(QDebug d, const QAbstractItemModel &model) } */ -namespace Debugger { -namespace Internal { +/*! + \class Debugger::Internal::TooltipFilterModel + + \brief The TooltipFilterModel class is a model for tooltips filtering an + item on the watchhandler matching its tree on the iname. + + In addition, suppress the model's tooltip data to avoid a tooltip on a tooltip. +*/ + +class TooltipFilterModel : public QSortFilterProxyModel +{ +public: + TooltipFilterModel(QAbstractItemModel *model, const QByteArray &iname) + : m_iname(iname) + { + setSourceModel(model); + } + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const + { + return role == Qt::ToolTipRole + ? QVariant() : QSortFilterProxyModel::data(index, role); + } + + static bool isSubIname(const QByteArray &haystack, const QByteArray &needle) + { + return haystack.size() > needle.size() + && haystack.startsWith(needle) + && haystack.at(needle.size()) == '.'; + } + + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const + { + const QModelIndex nameIndex = sourceModel()->index(sourceRow, 0, sourceParent); + const QByteArray iname = nameIndex.data(LocalsINameRole).toByteArray(); + return iname == m_iname || isSubIname(iname, m_iname) || isSubIname(m_iname, iname); + } + +private: + const QByteArray m_iname; +}; + +///////////////////////////////////////////////////////////////////////// +// +// TreeModelCopyVisitor builds a QStandardItem from a tree model (copy). +// +///////////////////////////////////////////////////////////////////////// -// Visitor building a QStandardItem from a tree model (copy). class TreeModelCopyVisitor : public TreeModelVisitor { public: @@ -466,6 +508,72 @@ private: }; +///////////////////////////////////////////////////////////////////////// +// +// DebuggerToolTipWidget +// +///////////////////////////////////////////////////////////////////////// + +class DebuggerToolTipWidget : public QWidget +{ + Q_OBJECT + +public: + bool isPinned() const { return m_isPinned; } + + explicit DebuggerToolTipWidget(QWidget *parent = 0); + bool engineAcquired() const { return m_engineAcquired; } + + QString fileName() const { return m_context.fileName; } + QString function() const { return m_context.function; } + int position() const { return m_context.position; } + // Check for a match at position. + bool matches(const QString &fileName, + const QString &engineType = QString(), + const QString &function= QString()) const; + + const DebuggerToolTipContext &context() const { return m_context; } + void setContext(const DebuggerToolTipContext &c) { m_context = c; } + + QString engineType() const { return m_engineType; } + void setEngineType(const QString &e) { m_engineType = e; } + + QDate creationDate() const { return m_creationDate; } + void setCreationDate(const QDate &d) { m_creationDate = d; } + +public slots: + void saveSessionData(QXmlStreamWriter &w) const; + + void acquireEngine(Debugger::DebuggerEngine *engine); + void releaseEngine(); + void copy(); + bool positionShow(const DebuggerToolTipEditor &pe); + void pin(); + void doLoadSessionData(QXmlStreamReader &r); + +private slots: + void slotDragged(const QPoint &p); + void toolButtonClicked(); + +private: + void doReleaseEngine(); + void doSaveSessionData(QXmlStreamWriter &w) const; + QString clipboardContents() const; + QAbstractItemModel *swapModel(QAbstractItemModel *newModel); + + bool m_isPinned; + QToolButton *m_toolButton; + DraggableLabel *m_titleLabel; + bool m_engineAcquired; + QString m_engineType; + DebuggerToolTipContext m_context; + QDate m_creationDate; + QPoint m_offset; //!< Offset to text cursor position (user dragging). + int m_debuggerModel; + DebuggerToolTipTreeView *m_treeView; + QStandardItemModel *m_defaultModel; +}; + void DebuggerToolTipWidget::pin() { if (m_isPinned) @@ -633,10 +741,15 @@ void DebuggerToolTipWidget::acquireEngine(DebuggerEngine *engine) qDebug() << this << " acquiring" << engine << m_engineAcquired; if (m_engineAcquired) return; - doAcquireEngine(engine); + m_engineType = engine->objectName(); m_engineAcquired = true; m_titleLabel->setText(QString()); + + // Create a filter model on the debugger's model and switch to it. + QAbstractItemModel *model = engine->watchModel(); + TooltipFilterModel *filterModel = new TooltipFilterModel(model, m_context.iname); + swapModel(filterModel); } void DebuggerToolTipWidget::releaseEngine() @@ -712,17 +825,7 @@ static QDate dateFromString(const QString &date) QDate(); } -DebuggerToolTipWidget *DebuggerToolTipWidget::loadSessionData(QXmlStreamReader &r) -{ - if (debugToolTips) - qDebug() << ">DebuggerToolTipWidget::loadSessionData" << r.tokenString() << r.name(); - DebuggerToolTipWidget *rc = DebuggerToolTipWidget::loadSessionDataI(r); - if (debugToolTips) - qDebug() << " needle.size() - && haystack.startsWith(needle) - && haystack.at(needle.size()) == '.'; -} - -bool TooltipFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const -{ - const QModelIndex nameIndex = sourceModel()->index(sourceRow, 0, sourceParent); - const QByteArray iname = nameIndex.data(LocalsINameRole).toByteArray(); - return iname == m_iname || isSubIname(iname, m_iname) || isSubIname(m_iname, iname); -} - /*! \class Debugger::Internal::DebuggerToolTipTreeView @@ -967,15 +1026,6 @@ void DebuggerToolTipTreeView::computeSize() viewport()->update(); } -void DebuggerToolTipWidget::doAcquireEngine(DebuggerEngine *engine) -{ - // Create a filter model on the debugger's model and switch to it. - QAbstractItemModel *model = engine->watchModel(); - TooltipFilterModel *filterModel = - new TooltipFilterModel(model, m_context.iname); - swapModel(filterModel); -} - QAbstractItemModel *DebuggerToolTipWidget::swapModel(QAbstractItemModel *newModel) { QAbstractItemModel *oldModel = m_treeView->swapModel(newModel); @@ -1001,7 +1051,7 @@ void DebuggerToolTipWidget::doReleaseEngine() delete swapModel(m_defaultModel); } -void DebuggerToolTipWidget::restoreTreeModel(QXmlStreamReader &r, QStandardItemModel *m) +static void restoreTreeModel(QXmlStreamReader &r, QStandardItemModel *m) { StandardItemTreeModelBuilder builder(m); int columnCount = 1; @@ -1069,7 +1119,7 @@ void DebuggerToolTipWidget::doLoadSessionData(QXmlStreamReader &r) m_treeView->swapModel(m_defaultModel); } -QString DebuggerToolTipWidget::treeModelClipboardContents(const QAbstractItemModel *m) +QString DebuggerToolTipManager::treeModelClipboardContents(const QAbstractItemModel *m) { QString rc; QTextStream str(&rc); @@ -1081,7 +1131,7 @@ QString DebuggerToolTipWidget::treeModelClipboardContents(const QAbstractItemMod QString DebuggerToolTipWidget::clipboardContents() const { if (const QAbstractItemModel *model = m_treeView->model()) - return DebuggerToolTipWidget::treeModelClipboardContents(model); + return DebuggerToolTipManager::treeModelClipboardContents(model); return QString(); } @@ -1149,13 +1199,15 @@ bool DebuggerToolTipManager::hasToolTips() return !d->m_tooltips.isEmpty(); } -void DebuggerToolTipManager::showToolTip(const QPoint &p, DebuggerToolTipWidget *toolTipWidget) +void DebuggerToolTipManager::showToolTip(const DebuggerToolTipContext &context, + DebuggerEngine *engine) { - if (debugToolTipPositioning) - qDebug() << "DebuggerToolTipManager::showToolTip" << p << " Mouse at " << QCursor::pos(); - const Utils::WidgetContent widgetContent(toolTipWidget, true); - Utils::ToolTip::show(p, widgetContent, debuggerCore()->mainWindow()); - d->registerToolTip(toolTipWidget); + DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; + tw->setContext(context); + tw->acquireEngine(engine); + const Utils::WidgetContent widgetContent(tw, true); + Utils::ToolTip::show(context.mousePosition, widgetContent, debuggerCore()->mainWindow()); + d->registerToolTip(tw); } void DebuggerToolTipManagerData::registerToolTip(DebuggerToolTipWidget *toolTipWidget) @@ -1214,6 +1266,16 @@ void DebuggerToolTipManager::sessionAboutToChange() closeAllToolTips(); } +static DebuggerToolTipWidget *loadSessionDataX(QXmlStreamReader &r) +{ + if (debugToolTips) + qDebug() << ">DebuggerToolTipWidget::loadSessionData" << r.tokenString() << r.name(); + DebuggerToolTipWidget *rc = loadSessionDataI(r); + if (debugToolTips) + qDebug() << "registerToolTip(tw); if (debugToolTips) @@ -1466,8 +1528,9 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested(ITextEditor *editor, if (!currentEngine || !currentEngine->canDisplayTooltip()) break; - const DebuggerToolTipContext context = DebuggerToolTipContext::fromEditor(editor, pos); - if (context.isValid() && currentEngine->setToolTipExpression(point, editor, context)) { + DebuggerToolTipContext context = DebuggerToolTipContext::fromEditor(editor, pos); + context.mousePosition = point; + if (context.isValid() && currentEngine->setToolTipExpression(editor, context)) { *handled = true; d->m_lastToolTipEditor = editor; d->m_lastToolTipPoint = point; diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 9f554830dee..fb45e6536c3 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -32,34 +32,21 @@ #include "debuggerconstants.h" +#include +#include #include -#include -#include -#include -#include - QT_BEGIN_NAMESPACE -class QVBoxLayout; -class QToolButton; -class QStandardItemModel; -class QToolBar; class QDebug; QT_END_NAMESPACE -namespace Core { -class IEditor; -class IMode; -} - +namespace Core { class IEditor; } namespace TextEditor { class ITextEditor; } namespace Debugger { class DebuggerEngine; namespace Internal { -class DraggableLabel; -class DebuggerToolTipEditor; class DebuggerToolTipContext { @@ -84,81 +71,6 @@ typedef QList DebuggerToolTipContexts; QDebug operator<<(QDebug, const DebuggerToolTipContext &); -class DebuggerToolTipTreeView; - -class DebuggerToolTipWidget : public QWidget -{ - Q_OBJECT - -public: - bool isPinned() const { return m_isPinned; } - - explicit DebuggerToolTipWidget(QWidget *parent = 0); - bool engineAcquired() const { return m_engineAcquired; } - - QString fileName() const { return m_context.fileName; } - QString function() const { return m_context.function; } - int position() const { return m_context.position; } - // Check for a match at position. - bool matches(const QString &fileName, - const QString &engineType = QString(), - const QString &function= QString()) const; - - const DebuggerToolTipContext &context() const { return m_context; } - void setContext(const DebuggerToolTipContext &c) { m_context = c; } - - QString engineType() const { return m_engineType; } - void setEngineType(const QString &e) { m_engineType = e; } - - QDate creationDate() const { return m_creationDate; } - void setCreationDate(const QDate &d) { m_creationDate = d; } - - static DebuggerToolTipWidget *loadSessionData(QXmlStreamReader &r); - - static QString treeModelClipboardContents(const QAbstractItemModel *m); - -public slots: - void saveSessionData(QXmlStreamWriter &w) const; - - void acquireEngine(Debugger::DebuggerEngine *engine); - void releaseEngine(); - void copy(); - bool positionShow(const DebuggerToolTipEditor &pe); - void pin(); - -private slots: - void slotDragged(const QPoint &p); - void toolButtonClicked(); - -private: - bool m_isPinned; - QToolButton *m_toolButton; - -private: - static DebuggerToolTipWidget *loadSessionDataI(QXmlStreamReader &r); - void doAcquireEngine(Debugger::DebuggerEngine *engine); - void doReleaseEngine(); - void doSaveSessionData(QXmlStreamWriter &w) const; - void doLoadSessionData(QXmlStreamReader &r); - QString clipboardContents() const; - - DraggableLabel *m_titleLabel; - bool m_engineAcquired; - QString m_engineType; - DebuggerToolTipContext m_context; - QDate m_creationDate; - QPoint m_offset; //!< Offset to text cursor position (user dragging). - -private: - QAbstractItemModel *swapModel(QAbstractItemModel *newModel); - static void restoreTreeModel(QXmlStreamReader &r, QStandardItemModel *m); - - int m_debuggerModel; - - DebuggerToolTipTreeView *m_treeView; - QStandardItemModel *m_defaultModel; -}; - class DebuggerToolTipTreeView : public QTreeView { Q_OBJECT @@ -168,16 +80,15 @@ public: QAbstractItemModel *swapModel(QAbstractItemModel *model); QSize sizeHint() const { return m_size; } - int computeHeight(const QModelIndex &index) const; -public slots: +private slots: void computeSize(); void expandNode(const QModelIndex &idx); void collapseNode(const QModelIndex &idx); void handleItemIsExpanded(const QModelIndex &sourceIdx); private: - void init(QAbstractItemModel *model); + int computeHeight(const QModelIndex &index) const; QSize m_size; }; @@ -198,11 +109,13 @@ public: const QString &engineType = QString(), const QString &function= QString()); - static void showToolTip(const QPoint &p, DebuggerToolTipWidget *); + static void showToolTip(const DebuggerToolTipContext &context, + DebuggerEngine *engine); virtual bool eventFilter(QObject *, QEvent *); static bool debug(); + static QString treeModelClipboardContents(const QAbstractItemModel *m); public slots: void debugModeEntered(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b201a1ec663..b98b2354f8f 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3644,10 +3644,7 @@ void GdbEngine::showToolTip() return; } - DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; - tw->setContext(*m_toolTipContext); - tw->acquireEngine(this); - DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw); + DebuggerToolTipManager::showToolTip(*m_toolTipContext, this); // Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711). m_toolTipContext.reset(); } @@ -3663,8 +3660,8 @@ void GdbEngine::resetLocation() DebuggerEngine::resetLocation(); } -bool GdbEngine::setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn) +bool GdbEngine::setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &contextIn) { if (state() != InferiorStopOk || !isCppEditor(editor)) { //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED " @@ -3696,7 +3693,6 @@ bool GdbEngine::setToolTipExpression(const QPoint &mousePos, } m_toolTipContext.reset(new DebuggerToolTipContext(context)); - m_toolTipContext->mousePosition = mousePos; m_toolTipContext->expression = exp; m_toolTipContext->iname = iname; // Local variable: Display synchronously. diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 215338b25d5..31386ad45f1 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -406,8 +406,8 @@ protected: // // Watch specific stuff // - virtual bool setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &); + virtual bool setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &); virtual void assignValueInDebugger(const WatchData *data, const QString &expr, const QVariant &value); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 90f18d631f3..d83be06da83 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -834,10 +834,7 @@ void LldbEngine::showToolTip() return; } - DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; - tw->setContext(*m_toolTipContext); - tw->acquireEngine(this); - DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw); + DebuggerToolTipManager::showToolTip(*m_toolTipContext, this); // Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711). m_toolTipContext.reset(); } @@ -848,8 +845,7 @@ void LldbEngine::resetLocation() DebuggerEngine::resetLocation(); } -bool LldbEngine::setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn) +bool LldbEngine::setToolTipExpression(TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn) { if (state() != InferiorStopOk || !isCppEditor(editor)) { //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED " @@ -881,7 +877,6 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos, } m_toolTipContext.reset(new DebuggerToolTipContext(context)); - m_toolTipContext->mousePosition = mousePos; m_toolTipContext->expression = exp; m_toolTipContext->iname = iname; // Local variable: Display synchronously. diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index 65b2b89cbdf..aaa9ecdc1e0 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -107,8 +107,8 @@ private: void abortDebugger(); void resetLocation(); - bool setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &); + bool setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &); void continueInferior(); void interruptInferior(); diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index faaa25a9311..ea8e04e8ddc 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -452,10 +452,9 @@ static WatchData m_toolTip; static QPoint m_toolTipPos; static QHash m_toolTipCache; -bool PdbEngine::setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx) +bool PdbEngine::setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &ctx) { - Q_UNUSED(mousePos) Q_UNUSED(editor) if (state() != InferiorStopOk) { diff --git a/src/plugins/debugger/pdb/pdbengine.h b/src/plugins/debugger/pdb/pdbengine.h index e10f3f73a72..bb91567fdf8 100644 --- a/src/plugins/debugger/pdb/pdbengine.h +++ b/src/plugins/debugger/pdb/pdbengine.h @@ -75,8 +75,8 @@ private: void shutdownInferior(); void shutdownEngine(); - bool setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &); + bool setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &); void continueInferior(); void interruptInferior(); diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index e09ff53f53f..8cea03a430e 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -89,15 +89,14 @@ bool QmlCppEngine::canDisplayTooltip() const return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip(); } -bool QmlCppEngine::setToolTipExpression(const QPoint & mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx) +bool QmlCppEngine::setToolTipExpression(TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx) { QTC_ASSERT(editor, return false); bool success = false; if (editor->document()->id() == CppEditor::Constants::CPPEDITOR_ID) - success = m_cppEngine->setToolTipExpression(mousePos, editor, ctx); + success = m_cppEngine->setToolTipExpression(editor, ctx); else if (editor->document()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) - success = m_qmlEngine->setToolTipExpression(mousePos, editor, ctx); + success = m_qmlEngine->setToolTipExpression(editor, ctx); return success; } diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h index 2b3591fc61b..5320fe3ed73 100644 --- a/src/plugins/debugger/qml/qmlcppengine.h +++ b/src/plugins/debugger/qml/qmlcppengine.h @@ -46,8 +46,8 @@ public: ~QmlCppEngine(); bool canDisplayTooltip() const; - bool setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor * editor, const DebuggerToolTipContext &); + bool setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &); void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags); void watchDataSelected(const QByteArray &iname); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 1f5f4cbf084..c36ec7cb4ac 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -983,12 +983,12 @@ void QmlEngine::requestModuleSymbols(const QString &moduleName) // ////////////////////////////////////////////////////////////////////// -bool QmlEngine::setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx) +bool QmlEngine::setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &ctx) { // This is processed by QML inspector, which has dependencies to // the qml js editor. Makes life easier. - emit tooltipRequested(mousePos, editor, ctx.position); + emit tooltipRequested(ctx.mousePosition, editor, ctx.position); return true; } diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index 8a9e4bb98b5..cb0e9d6a856 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -128,8 +128,8 @@ private: void shutdownInferior(); void shutdownEngine(); - bool setToolTipExpression(const QPoint &mousePos, - TextEditor::ITextEditor *editor, const DebuggerToolTipContext &); + bool setToolTipExpression(TextEditor::ITextEditor *editor, + const DebuggerToolTipContext &); void continueInferior(); void interruptInferior(); diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 679ef2db5de..fc80359f09a 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -958,7 +958,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) } else if (act == &actRemoveWatchExpression) { handler->removeData(p.data(LocalsINameRole).toByteArray()); } else if (act == &actCopy) { - copyToClipboard(DebuggerToolTipWidget::treeModelClipboardContents(model())); + copyToClipboard(DebuggerToolTipManager::treeModelClipboardContents(model())); } else if (act == &actCopyValue) { copyToClipboard(mi1.data().toString()); } else if (act == &actShowInEditor) {