Debugger: Make tooltips pinnable.

Replace old debugger tooltip by a new ToolTipManager which
has a list of AbstractDebuggerToolTipWidget with the functionality
to 'acquire' an engine (display its data) and 'release' it
(store engine data and display them as 'previous') and serialization
to XML session data.
DebuggerTreeViewToolTipWidget implements AbstractDebuggerToolTipWidget
for tree model acting as  a filter on watch models.

Rubber-stamped-by: hjk
This commit is contained in:
Friedemann Kleint
2011-02-11 15:00:13 +01:00
parent 80b2b71a5b
commit 0ac879e39f
29 changed files with 1717 additions and 409 deletions
+19 -11
View File
@@ -50,7 +50,7 @@
#include "disassembleragent.h"
#include "memoryagent.h"
#include "debuggerrunner.h"
#include "debuggertooltip.h"
#include "debuggertooltipmanager.h"
#include "cdbparsehelpers.h"
#include "watchutils.h"
#include "gdb/gdbmi.h"
@@ -471,7 +471,9 @@ void CdbEngine::syncOperateByInstruction(bool operateByInstruction)
postCommand(m_operateByInstruction ? QByteArray("l-s") : QByteArray("l+s"), 0);
}
void CdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos)
void CdbEngine::setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor,
const DebuggerToolTipContext &contextIn)
{
if (debug)
qDebug() << Q_FUNC_INFO;
@@ -481,10 +483,10 @@ void CdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEd
// Determine expression and function
int line;
int column;
QString function;
const QString exp = cppExpressionAt(editor, cursorPos, &line, &column, &function);
DebuggerToolTipContext context = contextIn;
const QString exp = cppExpressionAt(editor, context.position, &line, &column, &context.function);
// Are we in the current stack frame
if (function.isEmpty() || exp.isEmpty() || function != stackHandler()->currentFrame().function)
if (context.function.isEmpty() || exp.isEmpty() || context.function != stackHandler()->currentFrame().function)
return;
// No numerical or any other expressions [yet]
if (!(exp.at(0).isLetter() || exp.at(0) == QLatin1Char('_')))
@@ -492,9 +494,12 @@ void CdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEd
const QByteArray iname = QByteArray(localsPrefixC) + exp.toAscii();
const QModelIndex index = watchHandler()->itemIndex(iname);
if (index.isValid()) {
showDebuggerToolTip(mousePos, watchHandler()->modelForIName(iname), index.row());
} else {
hideDebuggerToolTip();
DebuggerTreeViewToolTipWidget *tw = new DebuggerTreeViewToolTipWidget;
tw->setContext(context);
tw->setDebuggerModel(LocalsWatch);
tw->setExpression(exp);
tw->acquireEngine(this);
DebuggerToolTipManager::instance()->add(mousePos, tw);
}
}
@@ -1295,11 +1300,11 @@ void CdbEngine::activateFrame(int index)
}
} else {
gotoLocation(frame);
updateLocals();
updateLocals(true);
}
}
void CdbEngine::updateLocals()
void CdbEngine::updateLocals(bool forNewStackFrame)
{
typedef QHash<QByteArray, int> WatcherHash;
@@ -1362,7 +1367,7 @@ void CdbEngine::updateLocals()
// Required arguments: frame
str << blankSeparator << frameIndex;
watchHandler()->beginCycle();
postExtensionCommand("locals", arguments, 0, &CdbEngine::handleLocals);
postExtensionCommand("locals", arguments, 0, &CdbEngine::handleLocals, 0, QVariant(forNewStackFrame));
}
void CdbEngine::selectThread(int index)
@@ -1571,6 +1576,9 @@ void CdbEngine::handleLocals(const CdbExtensionCommandPtr &reply)
foreach (const WatchData &wd, watchData)
nsp << wd.toString() <<'\n';
}
const bool forNewStackFrame = reply->cookie.toBool();
if (forNewStackFrame)
emit stackFrameCompleted();
} else {
showMessage(QString::fromLatin1(reply->errorMessage), LogError);
}
+3 -2
View File
@@ -85,7 +85,8 @@ public:
virtual ~CdbEngine();
// Factory function that returns 0 if the debug engine library cannot be found.
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor,
const DebuggerToolTipContext &ctx);
virtual void setupEngine();
virtual void setupInferior();
virtual void runEngine();
@@ -215,7 +216,7 @@ private:
QString normalizeFileName(const QString &f);
void updateLocalVariable(const QByteArray &iname);
void updateLocals();
void updateLocals(bool forNewStackFrame = false);
int elapsedLogTime() const;
void addLocalsOptions(ByteArrayInputStream &s) const;
unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto);
+4 -4
View File
@@ -33,7 +33,6 @@ HEADERS += breakhandler.h \
debuggerstartparameters.h \
debuggerstreamops.h \
debuggerstringutils.h \
debuggertooltip.h \
disassembleragent.h \
disassemblerlines.h \
logwindow.h \
@@ -60,7 +59,8 @@ HEADERS += breakhandler.h \
threaddata.h \
threadshandler.h \
watchdelegatewidgets.h \
debuggerruncontrolfactory.h
debuggerruncontrolfactory.h \
debuggertooltipmanager.h
SOURCES += breakhandler.cpp \
breakpoint.cpp \
@@ -74,7 +74,6 @@ SOURCES += breakhandler.cpp \
debuggerplugin.cpp \
debuggerrunner.cpp \
debuggerstreamops.cpp \
debuggertooltip.cpp \
disassembleragent.cpp \
disassemblerlines.cpp \
logwindow.cpp \
@@ -100,7 +99,8 @@ SOURCES += breakhandler.cpp \
watchutils.cpp \
watchwindow.cpp \
stackframe.cpp \
watchdelegatewidgets.cpp
watchdelegatewidgets.cpp \
debuggertooltipmanager.cpp
FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
+1
View File
@@ -29,5 +29,6 @@
<file>images/breakpoint_pending_24.png</file>
<file>images/location_16.png</file>
<file>images/location_24.png</file>
<file>images/pin.xpm</file>
</qresource>
</RCC>
+3
View File
@@ -61,6 +61,7 @@ namespace Internal {
class BreakHandler;
class SnapshotHandler;
class Symbol;
class DebuggerToolTipManager;
class DebuggerCore : public QObject
{
@@ -109,6 +110,8 @@ public:
virtual Utils::SavedAction *action(int code) const = 0;
virtual bool boolSetting(int code) const = 0;
virtual QString stringSetting(int code) const = 0;
virtual DebuggerToolTipManager *toolTipManager() const = 0;
};
// This is the only way to access the global object.
+9 -7
View File
@@ -38,7 +38,6 @@
#include "debuggerplugin.h"
#include "debuggerrunner.h"
#include "debuggerstringutils.h"
#include "debuggertooltip.h"
#include "debuggerstartparameters.h"
#include "memoryagent.h"
@@ -357,11 +356,6 @@ void DebuggerEngine::showStatusMessage(const QString &msg, int timeout) const
showMessage(msg, StatusBar, timeout);
}
void DebuggerEngine::removeTooltip()
{
watchHandler()->removeTooltip();
hideDebuggerToolTip();
}
void DebuggerEngine::frameUp()
{
@@ -474,6 +468,14 @@ QAbstractItemModel *DebuggerEngine::returnModel() const
return model;
}
QAbstractItemModel *DebuggerEngine::toolTipsModel() const
{
QAbstractItemModel *model = watchHandler()->model(TooltipsWatch);
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("TooltipsModel"));
return model;
}
QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
{
QAbstractItemModel *model = sourceFilesHandler()->model();
@@ -1238,7 +1240,7 @@ DebuggerRunControl *DebuggerEngine::runControl() const
}
void DebuggerEngine::setToolTipExpression
(const QPoint &, TextEditor::ITextEditor *, int)
(const QPoint &, TextEditor::ITextEditor *, const DebuggerToolTipContext &)
{
}
+5 -2
View File
@@ -81,6 +81,7 @@ class ThreadsHandler;
class WatchHandler;
class BreakpointParameters;
class QmlCppEngine;
class DebuggerToolTipContext;
struct WatchUpdateFlags
{
@@ -137,7 +138,7 @@ public:
DebuggerStartParameters &startParameters();
virtual void setToolTipExpression(const QPoint & mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const Internal::DebuggerToolTipContext &);
virtual void updateWatchData(const Internal::WatchData &data,
const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags());
@@ -183,7 +184,6 @@ public:
virtual void assignValueInDebugger(const Internal::WatchData *data,
const QString &expr, const QVariant &value);
virtual void removeTooltip();
virtual void selectThread(int index);
virtual void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
@@ -204,6 +204,7 @@ public:
virtual QAbstractItemModel *localsModel() const;
virtual QAbstractItemModel *watchersModel() const;
virtual QAbstractItemModel *returnModel() const;
virtual QAbstractItemModel *toolTipsModel() const;
virtual QAbstractItemModel *sourceFilesModel() const;
void progressPing();
@@ -253,6 +254,8 @@ public:
signals:
void stateChanged(const Debugger::DebuggerState &state);
// A new stack frame is on display including locals.
void stackFrameCompleted();
void updateViewsRequested();
/*
* For "external" clients of a debugger run control that needs to do
+21 -7
View File
@@ -43,7 +43,6 @@
#include "debuggerrunner.h"
#include "debuggerruncontrolfactory.h"
#include "debuggerstringutils.h"
#include "debuggertooltip.h"
#include "breakpoint.h"
#include "breakhandler.h"
@@ -62,6 +61,7 @@
#include "watchhandler.h"
#include "watchwindow.h"
#include "watchutils.h"
#include "debuggertooltipmanager.h"
#include "snapshothandler.h"
#include "threadshandler.h"
@@ -1170,6 +1170,8 @@ public slots:
bool parseArguments(const QStringList &args,
unsigned *enabledEngines, QString *errorMessage);
DebuggerToolTipManager *toolTipManager() const { return m_toolTipManager; }
public:
DebuggerMainWindow *m_mainWindow;
DebuggerRunControlFactory *m_debuggerRunControlFactory;
@@ -1246,9 +1248,11 @@ public:
QSettings *m_coreSettings;
bool m_gdbBinariesChanged;
uint m_cmdLineEnabledEngines;
DebuggerToolTipManager *m_toolTipManager;
};
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_toolTipManager(new DebuggerToolTipManager(this))
{
qRegisterMetaType<WatchData>("WatchData");
qRegisterMetaType<ContextData>("ContextData");
@@ -1956,8 +1960,12 @@ void DebuggerPluginPrivate::showToolTip(ITextEditor *editor,
if (!currentEngine()->canDisplayTooltip())
return;
QTC_ASSERT(handled, return);
*handled = true;
currentEngine()->setToolTipExpression(point, editor, pos);
const DebuggerToolTipContext context = DebuggerToolTipContext::fromEditor(editor, pos);
if (context.isValid()) {
*handled = true;
currentEngine()->setToolTipExpression(point, editor, context);
}
}
DebuggerRunControl *DebuggerPluginPrivate::createDebugger
@@ -2036,7 +2044,7 @@ void DebuggerPluginPrivate::cleanupViews()
{
m_reverseDirectionAction->setChecked(false);
m_reverseDirectionAction->setEnabled(false);
hideDebuggerToolTip();
m_toolTipManager->closeUnpinnedToolTips();
if (!boolSetting(CloseBuffersOnExit))
return;
@@ -2089,7 +2097,7 @@ void DebuggerPluginPrivate::setInitialState()
setBusyCursor(false);
m_reverseDirectionAction->setChecked(false);
m_reverseDirectionAction->setEnabled(false);
hideDebuggerToolTip();
m_toolTipManager->closeAllToolTips();
m_startExternalAction->setEnabled(true);
m_attachExternalAction->setEnabled(true);
@@ -2286,12 +2294,15 @@ void DebuggerPluginPrivate::onModeChanged(IMode *mode)
m_mainWindow->onModeChanged(mode);
if (mode->id() != Constants::MODE_DEBUG)
if (mode->id() != Constants::MODE_DEBUG) {
m_toolTipManager->leavingDebugMode();
return;
}
EditorManager *editorManager = EditorManager::instance();
if (editorManager->currentEditor())
editorManager->currentEditor()->widget()->setFocus();
m_toolTipManager->debugModeEntered();
}
void DebuggerPluginPrivate::showSettingsDialog()
@@ -2345,11 +2356,13 @@ void DebuggerPluginPrivate::sessionLoaded()
{
m_breakHandler->loadSessionData();
dummyEngine()->watchHandler()->loadSessionData();
m_toolTipManager->loadSessionData();
}
void DebuggerPluginPrivate::aboutToUnloadSession()
{
m_breakHandler->removeSessionData();
m_toolTipManager->sessionAboutToChange();
// Stop debugging the active project when switching sessions.
// Note that at startup, session switches may occur, which interfere
// with command-line debugging startup.
@@ -2362,6 +2375,7 @@ void DebuggerPluginPrivate::aboutToUnloadSession()
void DebuggerPluginPrivate::aboutToSaveSession()
{
dummyEngine()->watchHandler()->loadSessionData();
m_toolTipManager->saveSessionData();
m_breakHandler->saveSessionData();
}
+4 -1
View File
@@ -43,6 +43,7 @@
#include "debuggerstartparameters.h"
#include "gdb/gdboptionspage.h"
#include "lldb/lldbenginehost.h"
#include "debuggertooltipmanager.h"
#ifdef Q_OS_WIN
# include "peutils.h"
@@ -344,7 +345,9 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
break;
}
if (!d->m_engine) {
if (d->m_engine) {
DebuggerToolTipManager::instance()->registerEngine(d->m_engine);
} else {
// Could not find anything suitable.
debuggingFinished();
// Create Message box with possibility to go to settings.
-221
View File
@@ -1,221 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "debuggertooltip.h"
#include <utils/qtcassert.h>
#include <QtCore/QtDebug>
#include <QtCore/QPointer>
#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#include <QtGui/QHeaderView>
#include <QtGui/QScrollBar>
#include <QtGui/QTreeView>
#include <QtGui/QSortFilterProxyModel>
namespace Debugger {
namespace Internal {
class ToolTipWidget : public QTreeView
{
Q_OBJECT
public:
ToolTipWidget(QWidget *parent);
QSize sizeHint() const { return m_size; }
void done();
void run(const QPoint &point, const QModelIndex &index);
int computeHeight(const QModelIndex &index) const;
Q_SLOT void computeSize();
void leaveEvent(QEvent *ev);
private:
QSize m_size;
};
static QPointer<ToolTipWidget> theToolTipWidget;
ToolTipWidget::ToolTipWidget(QWidget *parent)
: QTreeView(parent)
{
setWindowFlags(Qt::ToolTip | Qt::WindowStaysOnTopHint);
setFocusPolicy(Qt::NoFocus);
header()->hide();
setUniformRowHeights(true);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(computeSize()),
Qt::QueuedConnection);
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(computeSize()),
Qt::QueuedConnection);
}
int ToolTipWidget::computeHeight(const QModelIndex &index) const
{
int s = rowHeight(index);
for (int i = 0; i < model()->rowCount(index); ++i)
s += computeHeight(model()->index(i, 0, index));
return s;
}
void ToolTipWidget::computeSize()
{
int columns = 0;
for (int i = 0; i < 3; ++i) {
resizeColumnToContents(i);
columns += sizeHintForColumn(i);
}
int rows = computeHeight(QModelIndex());
// Fit tooltip to screen, showing/hiding scrollbars as needed.
// Add a bit of space to account for tooltip border, and not
// touch the border of the screen.
QPoint pos(x(), y());
QRect desktopRect = QApplication::desktop()->availableGeometry(pos);
const int maxWidth = desktopRect.right() - pos.x() - 5 - 5;
const int maxHeight = desktopRect.bottom() - pos.y() - 5 - 5;
if (columns > maxWidth)
rows += horizontalScrollBar()->height();
if (rows > maxHeight) {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
rows = maxHeight;
columns += verticalScrollBar()->width();
} else {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
if (columns > maxWidth) {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
columns = maxWidth;
} else {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
m_size = QSize(columns + 5, rows + 5);
setMinimumSize(m_size);
setMaximumSize(m_size);
}
void ToolTipWidget::done()
{
deleteLater();
}
void ToolTipWidget::run(const QPoint &point, const QModelIndex &index)
{
QAbstractItemModel *model = const_cast<QAbstractItemModel *>(index.model());
move(point);
setModel(model);
// Track changes in filter models.
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(computeSize()), Qt::QueuedConnection);
computeSize();
setRootIsDecorated(model->hasChildren(index));
}
void ToolTipWidget::leaveEvent(QEvent *ev)
{
Q_UNUSED(ev);
if (QApplication::keyboardModifiers() == Qt::NoModifier)
hide();
}
void showDebuggerToolTip(const QPoint &point, const QModelIndex &index)
{
if (index.model()) {
if (!theToolTipWidget)
theToolTipWidget = new ToolTipWidget(0);
theToolTipWidget->run(point, index);
theToolTipWidget->show();
} else if (theToolTipWidget) {
theToolTipWidget->done();
theToolTipWidget = 0;
}
}
// Model for tooltips filtering a local variable using the locals model.
class ToolTipRowFilterModel : public QSortFilterProxyModel
{
public:
// Index points the variable to be filtered.
explicit ToolTipRowFilterModel(QAbstractItemModel *model, int row, QObject *parent = 0);
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
private:
const int m_row;
};
ToolTipRowFilterModel::ToolTipRowFilterModel(QAbstractItemModel *model, int row, QObject *parent) :
QSortFilterProxyModel(parent), m_row(row)
{
setSourceModel(model);
}
bool ToolTipRowFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
// Match on row for top level, else pass through.
return sourceParent.isValid() || sourceRow == m_row;
}
// Show tooltip filtering a row of a source model.
void showDebuggerToolTip(const QPoint &point, QAbstractItemModel *model, int row)
{
// Create a filter model parented on the widget to display column
ToolTipRowFilterModel *filterModel = new ToolTipRowFilterModel(model, row);
showDebuggerToolTip(point, filterModel->index(0, 0));
QTC_ASSERT(theToolTipWidget, return; )
filterModel->setParent(theToolTipWidget);
}
void hideDebuggerToolTip(int delay)
{
Q_UNUSED(delay)
if (theToolTipWidget)
theToolTipWidget->done();
}
} // namespace Internal
} // namespace Debugger
#include "debuggertooltip.moc"
-56
View File
@@ -1,56 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_DEBUGGERTOOLTIP_H
#define DEBUGGER_DEBUGGERTOOLTIP_H
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
class QModelIndex;
class QPoint;
class QAbstractItemModel;
QT_END_NAMESPACE
namespace Debugger {
namespace Internal {
void showDebuggerToolTip(const QPoint &point, const QModelIndex &rootIndex);
// Show tooltip filtering a row of a source model.
void showDebuggerToolTip(const QPoint &point, QAbstractItemModel *model, int row);
void hideDebuggerToolTip(int delay = 0);
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_DEBUGGERTOOLTIP_H
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,278 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_INTERNAL_DEBUGGERTOOLTIPMANAGER_H
#define DEBUGGER_INTERNAL_DEBUGGERTOOLTIPMANAGER_H
#include "debuggerconstants.h"
#include <QtGui/QTreeView>
#include <QtCore/QPointer>
#include <QtCore/QList>
#include <QtCore/QXmlStreamWriter>
#include <QtCore/QXmlStreamReader>
#include <QtCore/QDate>
QT_BEGIN_NAMESPACE
class QVBoxLayout;
class QToolButton;
class QSortFilterProxyModel;
class QStandardItemModel;
class QPlainTextEdit;
class QLabel;
class QToolBar;
class QMenu;
class QDebug;
QT_END_NAMESPACE
namespace Core {
class IEditor;
class IMode;
}
namespace Debugger {
class DebuggerEngine;
namespace Internal {
class PinnableToolTipWidget : public QWidget
{
Q_OBJECT
public:
enum PinState
{
Unpinned,
Pinned
};
explicit PinnableToolTipWidget(QWidget *parent = 0);
PinState pinState() const { return m_pinState; }
void addWidget(QWidget *w);
void addToolBarWidget(QWidget *w);
public slots:
void pin();
signals:
void closeAllRequested();
protected:
virtual void leaveEvent(QEvent *ev);
private slots:
void toolButtonClicked();
private:
PinState m_pinState;
QVBoxLayout *m_mainVBoxLayout;
QToolBar *m_toolBar;
QToolButton *m_toolButton;
QMenu *m_menu;
};
class DebuggerToolTipContext
{
public:
DebuggerToolTipContext();
static DebuggerToolTipContext fromEditor(Core::IEditor *ed, int pos);
bool isValid() const { return !fileName.isEmpty(); }
QString fileName;
int position;
int line;
int column;
QString function; //!< Optional function. This must be set by the engine as it is language-specific.
};
QDebug operator<<(QDebug, const DebuggerToolTipContext &);
class AbstractDebuggerToolTipWidget : public PinnableToolTipWidget
{
Q_OBJECT
public:
explicit AbstractDebuggerToolTipWidget(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 AbstractDebuggerToolTipWidget *loadSessionData(QXmlStreamReader &r);
public slots:
void saveSessionData(QXmlStreamWriter &w) const;
void acquireEngine(Debugger::DebuggerEngine *engine);
void releaseEngine();
bool positionShow(const QPlainTextEdit *pe);
protected:
virtual void doAcquireEngine(Debugger::DebuggerEngine *engine) = 0;
virtual void doReleaseEngine() = 0;
virtual void doSaveSessionData(QXmlStreamWriter &w) const = 0;
virtual void doLoadSessionData(QXmlStreamReader &r) = 0;
private:
static AbstractDebuggerToolTipWidget *loadSessionDataI(QXmlStreamReader &r);
QLabel *m_titleLabel;
bool m_engineAcquired;
QString m_engineType;
DebuggerToolTipContext m_context;
QDate m_creationDate;
};
class DebuggerToolTipTreeView : public QTreeView
{
Q_OBJECT
public:
explicit DebuggerToolTipTreeView(QWidget *parent = 0);
QAbstractItemModel *swapModel(QAbstractItemModel *model);
QSize sizeHint() const { return m_size; }
int computeHeight(const QModelIndex &index) const;
public slots:
void computeSize();
private:
void init(QAbstractItemModel *model);
QSize m_size;
};
class DebuggerTreeViewToolTipWidget : public AbstractDebuggerToolTipWidget
{
Q_OBJECT
public:
explicit DebuggerTreeViewToolTipWidget(QWidget *parent = 0);
int debuggerModel() const { return m_debuggerModel; }
void setDebuggerModel(int m) { m_debuggerModel = m; }
QString expression() const { return m_expression; }
void setExpression(const QString &e) { m_expression = e; }
protected:
virtual void doAcquireEngine(Debugger::DebuggerEngine *engine);
virtual void doReleaseEngine();
virtual void doSaveSessionData(QXmlStreamWriter &w) const;
virtual void doLoadSessionData(QXmlStreamReader &r);
private:
static void restoreTreeModel(QXmlStreamReader &r, QStandardItemModel *m);
int m_debuggerModel;
QString m_expression;
DebuggerToolTipTreeView *m_treeView;
QStandardItemModel *m_defaultModel;
};
class DebuggerToolTipManager : public QObject
{
Q_OBJECT
public:
explicit DebuggerToolTipManager(QObject *parent = 0);
virtual ~DebuggerToolTipManager();
static DebuggerToolTipManager *instance() { return m_instance; }
void registerEngine(DebuggerEngine *engine);
// Collect all expressions of DebuggerTreeViewToolTipWidget
QStringList treeWidgetExpressions(const QString &fileName,
const QString &engineType = QString(),
const QString &function= QString()) const;
void add(const QPoint &p, AbstractDebuggerToolTipWidget *w);
virtual bool eventFilter(QObject *, QEvent *);
static bool debug();
signals:
public slots:
void debugModeEntered();
void leavingDebugMode();
void sessionAboutToChange();
void loadSessionData();
void saveSessionData();
void closeAllToolTips();
void closeUnpinnedToolTips();
void hide();
private slots:
void slotUpdateVisibleToolTips();
void slotDebuggerStateChanged(Debugger::DebuggerState);
void slotStackFrameCompleted();
void slotEditorOpened(Core::IEditor *);
private:
typedef QList<QPointer<AbstractDebuggerToolTipWidget> > DebuggerToolTipWidgetList;
inline bool isActive() const { return !m_tooltips.isEmpty(); }
void add(AbstractDebuggerToolTipWidget *toolTipWidget);
void moveToolTipsBy(const QPoint &distance);
// Purge out closed (null) tooltips and return list for convenience
DebuggerToolTipWidgetList &purgeClosedToolTips();
static DebuggerToolTipManager *m_instance;
DebuggerToolTipWidgetList m_tooltips;
bool m_debugModeActive;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_INTERNAL_DEBUGGERTOOLTIPMANAGER_H
@@ -119,7 +119,7 @@ void GdbEngine::updateLocalsClassic(const QVariant &cookie)
//PENDING_DEBUG("\nRESET PENDING");
//m_toolTipCache.clear();
m_toolTipExpression.clear();
clearToolTip();
watchHandler()->beginCycle();
QByteArray level = QByteArray::number(currentFrame());
+64 -67
View File
@@ -52,7 +52,7 @@
#include "debuggerplugin.h"
#include "debuggerrunner.h"
#include "debuggerstringutils.h"
#include "debuggertooltip.h"
#include "debuggertooltipmanager.h"
#include "disassembleragent.h"
#include "gdbmi.h"
#include "gdboptionspage.h"
@@ -74,6 +74,7 @@
#include "logwindow.h"
#include <coreplugin/icore.h>
#include <coreplugin/ifile.h>
#include <projectexplorer/toolchain.h>
#include <texteditor/itexteditor.h>
#include <utils/qtcassert.h>
@@ -101,10 +102,18 @@
#endif
#include <ctype.h>
namespace Debugger {
namespace Internal {
class GdbToolTipContext : public DebuggerToolTipContext
{
public:
GdbToolTipContext(const DebuggerToolTipContext &c) : DebuggerToolTipContext(c) {}
QPoint mousePosition;
QString expression;
};
static const char winPythonVersionC[] = "python2.5";
enum { debugPending = 0 };
@@ -1103,7 +1112,7 @@ void GdbEngine::handleQuerySources(const GdbResponse &response)
void GdbEngine::handleExecuteJumpToLine(const GdbResponse &response)
{
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
doNotifyInferiorRunOk();
// All is fine. Waiting for the temporary breakpoint to be hit.
} else if (response.resultClass == GdbResultDone) {
// This happens on old gdb. Trigger the effect of a '*stopped'.
@@ -1116,7 +1125,7 @@ void GdbEngine::handleExecuteJumpToLine(const GdbResponse &response)
void GdbEngine::handleExecuteRunToLine(const GdbResponse &response)
{
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
doNotifyInferiorRunOk();
// All is fine. Waiting for the temporary breakpoint to be hit.
} else if (response.resultClass == GdbResultDone) {
// This happens on old gdb. Trigger the effect of a '*stopped'.
@@ -1275,7 +1284,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// be handled in the result handler.
// -- or --
// *stopped arriving earlier than ^done response to an -exec-step
notifyInferiorRunOk();
doNotifyInferiorRunOk();
notifyInferiorSpontaneousStop();
} else if (state() == InferiorStopOk && isQmlStepBreakpoint2(bkptno)) {
// That's expected.
@@ -1630,7 +1639,7 @@ void GdbEngine::handleExecuteContinue(const GdbResponse &response)
{
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
doNotifyInferiorRunOk();
return;
}
QByteArray msg = response.data.findChild("msg").data();
@@ -1871,6 +1880,12 @@ void GdbEngine::continueInferiorInternal()
postCommand("-exec-continue", RunRequest, CB(handleExecuteContinue));
}
void GdbEngine::doNotifyInferiorRunOk()
{
clearToolTip();
notifyInferiorRunOk();
}
void GdbEngine::autoContinueInferior()
{
resetLocation();
@@ -1909,7 +1924,7 @@ void GdbEngine::handleExecuteStep(const GdbResponse &response)
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
doNotifyInferiorRunOk();
return;
}
QByteArray msg = response.data.findChild("msg").data();
@@ -1972,7 +1987,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response)
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
doNotifyInferiorRunOk();
return;
}
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
@@ -3366,7 +3381,12 @@ bool GdbEngine::supportsThreads() const
bool GdbEngine::showToolTip()
{
const QByteArray iname = tooltipIName(m_toolTipExpression);
if (m_toolTipContext.isNull())
return false;
const QString expression = m_toolTipContext->expression;
const QByteArray iname = tooltipIName(m_toolTipContext->expression);
if (DebuggerToolTipManager::debug())
qDebug() << "GdbEngine::showToolTip " << expression << iname << (*m_toolTipContext);
if (!debuggerCore()->boolSetting(UseToolTipsInMainEditor)) {
watchHandler()->removeData(iname);
@@ -3376,15 +3396,29 @@ bool GdbEngine::showToolTip()
const QModelIndex index = watchHandler()->itemIndex(iname);
if (!index.isValid()) {
watchHandler()->removeData(iname);
hideDebuggerToolTip();
return false;
}
showDebuggerToolTip(m_toolTipPos, index);
DebuggerTreeViewToolTipWidget *tw = new DebuggerTreeViewToolTipWidget;
tw->setDebuggerModel(TooltipsWatch);
tw->setExpression(expression);
tw->setContext(*m_toolTipContext);
tw->acquireEngine(this);
DebuggerToolTipManager::instance()->add(m_toolTipContext->mousePosition, tw);
return true;
}
QString GdbEngine::tooltipExpression() const
{
return m_toolTipContext.isNull() ? QString() : m_toolTipContext->expression;
}
void GdbEngine::clearToolTip()
{
m_toolTipContext.reset();
}
void GdbEngine::setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos)
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn)
{
if (state() != InferiorStopOk || !isCppEditor(editor)) {
//qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED "
@@ -3392,9 +3426,13 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
return;
}
m_toolTipPos = mousePos;
DebuggerToolTipContext context = contextIn;
int line, column;
QString exp = cppExpressionAt(editor, cursorPos, &line, &column);
QString exp = cppExpressionAt(editor, context.position, &line, &column, &context.function);
if (DebuggerToolTipManager::debug())
qDebug() << "GdbEngine::setToolTipExpression1 " << exp << context;
if (exp.isEmpty())
return;
// Extract the first identifier, everything else is considered
// too dangerous.
@@ -3414,35 +3452,11 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
}
exp = exp.mid(pos1, pos2 - pos1);
if (!exp.isEmpty() && exp == m_toolTipExpression) {
showToolTip();
return;
}
m_toolTipExpression = exp;
// FIXME: enable caching
//if (showToolTip())
// return;
if (exp.isEmpty() || exp.startsWith(_c('#'))) {
//QToolTip::hideText();
return;
}
if (!hasLetterOrNumber(exp)) {
//QToolTip::showText(m_toolTipPos,
// tr("'%1' contains no identifier").arg(exp));
return;
}
if (isKeyWord(exp))
if (exp.isEmpty() || exp.startsWith(_c('#')) || !hasLetterOrNumber(exp) || isKeyWord(exp))
return;
if (exp.startsWith(_c('"')) && exp.endsWith(_c('"'))) {
//QToolTip::showText(m_toolTipPos, tr("String literal %1").arg(exp));
if (exp.startsWith(_c('"')) && exp.endsWith(_c('"')))
return;
}
if (exp.startsWith(__("++")) || exp.startsWith(__("--")))
exp = exp.mid(2);
@@ -3453,29 +3467,19 @@ void GdbEngine::setToolTipExpression(const QPoint &mousePos,
if (exp.startsWith(_c('<')) || exp.startsWith(_c('[')))
return;
if (hasSideEffects(exp)) {
//QToolTip::showText(m_toolTipPos,
// tr("Cowardly refusing to evaluate expression '%1' "
// "with potential side effects").arg(exp));
if (hasSideEffects(exp) || exp.isEmpty())
return;
if (!m_toolTipContext.isNull() && m_toolTipContext->expression == exp) {
showToolTip();
return;
}
// Gdb crashes when creating a variable object with the name
// of the type of 'this'
/*
for (int i = 0; i != m_currentLocals.childCount(); ++i) {
if (m_currentLocals.childAt(i).exp == "this") {
qDebug() << "THIS IN ROW" << i;
if (m_currentLocals.childAt(i).type.startsWith(exp)) {
QToolTip::showText(m_toolTipPos,
tr("%1: type of current 'this'").arg(exp));
qDebug() << " TOOLTIP CRASH SUPPRESSED";
return;
}
break;
}
}
*/
m_toolTipContext.reset(new GdbToolTipContext(context));
m_toolTipContext->mousePosition = mousePos;
m_toolTipContext->expression = exp;
if (DebuggerToolTipManager::debug())
qDebug() << "GdbEngine::setToolTipExpression2 " << exp << (*m_toolTipContext);
if (isSynchronous()) {
updateLocals(QVariant());
@@ -4587,13 +4591,6 @@ void GdbEngine::resetCommandQueue()
}
}
void GdbEngine::removeTooltip()
{
m_toolTipExpression.clear();
m_toolTipPos = QPoint();
DebuggerEngine::removeTooltip();
}
void GdbEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
{
m_gdbAdapter->handleRemoteSetupDone(gdbServerPort, qmlPort);
+7 -5
View File
@@ -60,6 +60,7 @@ class AbstractGdbAdapter;
class AbstractGdbProcess;
class GdbResponse;
class GdbMi;
class GdbToolTipContext;
class WatchData;
class DisassemblerAgentCookie;
@@ -325,6 +326,7 @@ private: ////////// Inferior Management //////////
void executeNextI();
void continueInferiorInternal();
void doNotifyInferiorRunOk();
void autoContinueInferior();
void continueInferior();
void interruptInferior();
@@ -474,8 +476,7 @@ private: ////////// View & Data Stuff //////////
// Watch specific stuff
//
virtual void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
virtual void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
@@ -555,10 +556,11 @@ private: ////////// View & Data Stuff //////////
AbstractGdbProcess *gdbProc() const;
void showExecutionError(const QString &message);
void removeTooltip();
static QByteArray tooltipIName(const QString &exp);
QString m_toolTipExpression;
QPoint m_toolTipPos;
QString tooltipExpression() const;
void clearToolTip();
QScopedPointer<GdbToolTipContext> m_toolTipContext;
// For short-circuiting stack and thread list evaluation.
bool m_stackNeeded;
+18 -5
View File
@@ -37,6 +37,7 @@
#include "debuggeractions.h"
#include "debuggercore.h"
#include "debuggerstringutils.h"
#include "debuggertooltipmanager.h"
#include "breakhandler.h"
#include "watchhandler.h"
@@ -64,10 +65,21 @@ void GdbEngine::updateLocalsPython(bool tryPartial, const QByteArray &varList)
expanded += "formats:" + handler->individualFormatRequests();
QByteArray watchers;
if (!m_toolTipExpression.isEmpty()) {
watchers += m_toolTipExpression.toLatin1();
watchers += '#';
watchers += tooltipIName(m_toolTipExpression);
const QString fileName = stackHandler()->currentFrame().file;
const QString function = stackHandler()->currentFrame().function;
if (!fileName.isEmpty()) {
QStringList expressions =
DebuggerToolTipManager::instance()->treeWidgetExpressions(fileName, objectName(), function);
const QString currentExpression = tooltipExpression();
if (!currentExpression.isEmpty() && !expressions.contains(currentExpression))
expressions.push_back(currentExpression);
foreach (const QString &te, expressions) {
if (!watchers.isEmpty())
watchers += "##";
watchers += te.toLatin1();
watchers += '#';
watchers += tooltipIName(te);
}
}
QHash<QByteArray, int> watcherNames = handler->watcherNames();
@@ -120,7 +132,6 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response)
PRECONDITION;
if (response.resultClass == GdbResultDone) {
const bool partial = response.cookie.toBool();
Q_UNUSED(partial);
//qDebug() << "READING " << (partial ? "PARTIAL" : "FULL");
QByteArray out = response.data.findChild("consolestreamoutput").data();
while (out.endsWith(' ') || out.endsWith('\n'))
@@ -192,6 +203,8 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response)
//PENDING_DEBUG("\n\n .... AND TRIGGERS MODEL UPDATE\n");
rebuildWatchModel();
}
if (!partial)
emit stackFrameCompleted();
} else {
showMessage(_("DUMPER FAILED: " + response.toString()));
}
+19
View File
@@ -0,0 +1,19 @@
/* XPM */
static const char * pin_xpm[] = {
"12 9 7 1",
" c None",
". c #000000",
"+ c #515151",
"@ c #A8A8A8",
"# c #A9A9A9",
"$ c #999999",
"% c #696969",
" . ",
" ......+",
" .@@@@@.",
" .#####.",
"+.....$$$$$.",
" .%%%%%.",
" .......",
" ......+",
" . "};
+3 -3
View File
@@ -41,6 +41,7 @@
#include "debuggerdialogs.h"
#include "debuggerplugin.h"
#include "debuggerstringutils.h"
#include "debuggertooltipmanager.h"
#include "breakhandler.h"
#include "moduleshandler.h"
@@ -456,11 +457,10 @@ static QPoint m_toolTipPos;
static QHash<QString, WatchData> m_toolTipCache;
void PdbEngine::setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos)
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx)
{
Q_UNUSED(mousePos)
Q_UNUSED(editor)
Q_UNUSED(cursorPos)
if (state() != InferiorStopOk) {
//SDEBUG("SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED");
@@ -474,7 +474,7 @@ void PdbEngine::setToolTipExpression(const QPoint &mousePos,
int line;
int column;
QString exp = cppExpressionAt(editor, cursorPos, &line, &column);
QString exp = cppExpressionAt(editor, ctx.position, &line, &column);
/*
if (m_toolTipCache.contains(exp)) {
+1 -1
View File
@@ -80,7 +80,7 @@ private:
void shutdownEngine();
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void continueInferior();
void interruptInferior();
+2 -2
View File
@@ -138,9 +138,9 @@ QmlCppEngine::~QmlCppEngine()
}
void QmlCppEngine::setToolTipExpression(const QPoint & mousePos,
TextEditor::ITextEditor *editor, int cursorPos)
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx)
{
d->m_activeEngine->setToolTipExpression(mousePos, editor, cursorPos);
d->m_activeEngine->setToolTipExpression(mousePos, editor, ctx);
}
void QmlCppEngine::updateWatchData(const WatchData &data,
+1 -1
View File
@@ -19,7 +19,7 @@ public:
~QmlCppEngine();
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor * editor, int cursorPos);
TextEditor::ITextEditor * editor, const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags);
+3 -3
View File
@@ -42,7 +42,7 @@
#include "debuggermainwindow.h"
#include "debuggerrunner.h"
#include "debuggerstringutils.h"
#include "debuggertooltip.h"
#include "debuggertooltipmanager.h"
#include "breakhandler.h"
#include "moduleshandler.h"
@@ -564,11 +564,11 @@ void QmlEngine::requestModuleSymbols(const QString &moduleName)
//////////////////////////////////////////////////////////////////////
void QmlEngine::setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos)
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, cursorPos);
emit tooltipRequested(mousePos, editor, ctx.position);
}
//////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -85,7 +85,7 @@ private:
void shutdownEngine();
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void continueInferior();
void interruptInferior();
+3 -3
View File
@@ -46,6 +46,7 @@
#include "stackhandler.h"
#include "watchhandler.h"
#include "watchutils.h"
#include "debuggertooltipmanager.h"
#include <utils/qtcassert.h>
@@ -512,11 +513,10 @@ static QPoint m_toolTipPos;
static QHash<QString, WatchData> m_toolTipCache;
void ScriptEngine::setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos)
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &ctx)
{
Q_UNUSED(mousePos)
Q_UNUSED(editor)
Q_UNUSED(cursorPos)
if (state() != InferiorStopOk) {
//SDEBUG("SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED");
@@ -530,7 +530,7 @@ void ScriptEngine::setToolTipExpression(const QPoint &mousePos,
int line;
int column;
QString exp = cppExpressionAt(editor, cursorPos, &line, &column);
QString exp = cppExpressionAt(editor, ctx.position, &line, &column);
/*
if (m_toolTipCache.contains(exp)) {
+1 -1
View File
@@ -74,7 +74,7 @@ private:
void executeNextI();
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void setupEngine();
void setupInferior();
void runEngine();
+1 -2
View File
@@ -535,11 +535,10 @@ static WatchData m_toolTip;
static QPoint m_toolTipPos;
static QHash<QString, WatchData> m_toolTipCache;
void TcfEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos)
void TcfEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, const DebuggerToolTipContext &)
{
Q_UNUSED(mousePos)
Q_UNUSED(editor)
Q_UNUSED(cursorPos)
}
//////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -83,7 +83,7 @@ private:
void shutdownEngine();
void setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, int cursorPos);
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void continueInferior();
void interruptInferior();
+2 -2
View File
@@ -75,8 +75,8 @@ private:
virtual ~WatchModel();
public:
int rowCount(const QModelIndex &idx) const;
int columnCount(const QModelIndex &idx) const;
virtual int rowCount(const QModelIndex &idx = QModelIndex()) const;
virtual int columnCount(const QModelIndex &idx) const;
private:
QVariant data(const QModelIndex &index, int role) const;