#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
-#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QKeyEvent>
#include <QtGui/QScrollBar>
#include <QtGui/QTreeView>
-#include <QtGui/QVBoxLayout>
namespace Debugger {
namespace Internal {
QSize sizeHint() const { return m_size; }
void done();
- void run(const QPoint &point, QAbstractItemModel *model,
- const QModelIndex &index, const QString &msg);
+ void run(const QPoint &point, const QModelIndex &index);
int computeHeight(const QModelIndex &index) const;
Q_SLOT void computeSize();
deleteLater();
}
-void ToolTipWidget::run(const QPoint &point, QAbstractItemModel *model,
- const QModelIndex &index, const QString & /* msg */)
+void ToolTipWidget::run(const QPoint &point, const QModelIndex &index)
{
+ QAbstractItemModel *model = const_cast<QAbstractItemModel *>(index.model());
move(point);
setModel(model);
computeSize();
hide();
}
-void showDebuggerToolTip(const QPoint &point, QAbstractItemModel *model,
- const QModelIndex &index, const QString &msg)
+void showDebuggerToolTip(const QPoint &point, const QModelIndex &index)
{
- if (model) {
+ if (index.model()) {
if (!theToolTipWidget)
theToolTipWidget = new ToolTipWidget(0);
- theToolTipWidget->run(point, model, index, msg);
+ theToolTipWidget->run(point, index);
theToolTipWidget->show();
} else if (theToolTipWidget) {
theToolTipWidget->done();
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
-class QAbstractItemModel;
class QModelIndex;
class QPoint;
-class QString;
QT_END_NAMESPACE
namespace Debugger {
namespace Internal {
-void showDebuggerToolTip(const QPoint &point, QAbstractItemModel *model,
- const QModelIndex &rootIndex, const QString &msg);
-
+void showDebuggerToolTip(const QPoint &point, const QModelIndex &rootIndex);
void hideDebuggerToolTip(int delay = 0);
} // namespace Internal
hideDebuggerToolTip();
return false;
}
- showDebuggerToolTip(m_toolTipPos, watchHandler()->model(TooltipsWatch), index, m_toolTipExpression);
+ showDebuggerToolTip(m_toolTipPos, index);
return true;
}
TextEditor::ITextEditor *editor, int cursorPos)
{
if (state() != InferiorStopOk || !isCppEditor(editor)) {
- //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED/Non Cpp editor";
+ //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED "
+ // " OR NOT A CPPEDITOR";
return;
}
- if (debuggerCore()->boolSetting(DebugDebuggingHelpers)) {
- // minimize interference
+ // Minimize interference.
+ if (debuggerCore()->boolSetting(DebugDebuggingHelpers))
return;
- }
m_toolTipPos = mousePos;
int line, column;