2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-11 15:00:13 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-11 15:00:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-11 15:00:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-02-11 15:00:13 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-02-11 15:00:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-02-11 15:00:13 +01:00
|
|
|
|
2011-02-22 18:02:29 +01:00
|
|
|
#ifndef DEBUGGER_DEBUGGERTOOLTIPMANAGER_H
|
|
|
|
|
#define DEBUGGER_DEBUGGERTOOLTIPMANAGER_H
|
2011-02-11 15:00:13 +01:00
|
|
|
|
|
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
2014-11-07 13:50:09 +01:00
|
|
|
#include <QCoreApplication>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDate>
|
2014-11-07 15:00:45 +01:00
|
|
|
#include <QPoint>
|
2011-02-11 15:00:13 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2014-11-07 15:00:45 +01:00
|
|
|
class QAbstractItemModel;
|
2011-02-11 15:00:13 +01:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class DebuggerEngine;
|
2015-02-13 15:28:56 +01:00
|
|
|
class DebuggerCommand;
|
2014-11-15 13:33:40 +01:00
|
|
|
class StackFrame;
|
|
|
|
|
|
2011-02-11 15:00:13 +01:00
|
|
|
class DebuggerToolTipContext
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DebuggerToolTipContext();
|
2014-07-10 18:10:56 +02:00
|
|
|
bool isValid() const { return !expression.isEmpty(); }
|
2014-11-15 13:33:40 +01:00
|
|
|
bool matchesFrame(const StackFrame &frame) const;
|
2014-07-10 18:10:56 +02:00
|
|
|
bool isSame(const DebuggerToolTipContext &other) const;
|
2015-02-13 15:28:56 +01:00
|
|
|
void appendFormatRequest(DebuggerCommand *cmd) const;
|
2015-02-09 09:00:21 +01:00
|
|
|
QString toolTip() const;
|
2011-02-11 15:00:13 +01:00
|
|
|
|
|
|
|
|
QString fileName;
|
|
|
|
|
int position;
|
|
|
|
|
int line;
|
|
|
|
|
int column;
|
2014-11-15 13:33:40 +01:00
|
|
|
int scopeFromLine;
|
|
|
|
|
int scopeToLine;
|
|
|
|
|
QString function; //!< Optional, informational only.
|
2014-07-10 18:10:56 +02:00
|
|
|
QString engineType;
|
|
|
|
|
QDate creationDate;
|
2013-10-11 16:56:25 +02:00
|
|
|
|
|
|
|
|
QPoint mousePosition;
|
|
|
|
|
QString expression;
|
|
|
|
|
QByteArray iname;
|
2015-03-06 13:36:42 +01:00
|
|
|
bool isCppEditor;
|
2011-02-11 15:00:13 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-11 16:56:25 +02:00
|
|
|
typedef QList<DebuggerToolTipContext> DebuggerToolTipContexts;
|
|
|
|
|
|
2011-02-11 15:00:13 +01:00
|
|
|
class DebuggerToolTipManager : public QObject
|
|
|
|
|
{
|
2014-11-08 19:09:16 +02:00
|
|
|
Q_OBJECT
|
2011-02-22 18:02:29 +01:00
|
|
|
|
2011-02-11 15:00:13 +01:00
|
|
|
public:
|
2014-11-07 13:50:09 +01:00
|
|
|
DebuggerToolTipManager();
|
2013-10-11 17:04:56 +02:00
|
|
|
~DebuggerToolTipManager();
|
2011-02-11 15:00:13 +01:00
|
|
|
|
2013-10-11 17:04:56 +02:00
|
|
|
static void registerEngine(DebuggerEngine *engine);
|
2014-07-10 18:10:56 +02:00
|
|
|
static void deregisterEngine(DebuggerEngine *engine);
|
|
|
|
|
static void updateEngine(DebuggerEngine *engine);
|
2013-10-11 17:04:56 +02:00
|
|
|
static bool hasToolTips();
|
2011-02-11 15:00:13 +01:00
|
|
|
|
2014-11-11 11:00:32 +01:00
|
|
|
static DebuggerToolTipContexts pendingTooltips(DebuggerEngine *engine);
|
2011-02-11 15:00:13 +01:00
|
|
|
|
|
|
|
|
virtual bool eventFilter(QObject *, QEvent *);
|
|
|
|
|
|
|
|
|
|
void debugModeEntered();
|
|
|
|
|
void leavingDebugMode();
|
|
|
|
|
void sessionAboutToChange();
|
2014-07-10 18:10:56 +02:00
|
|
|
static void loadSessionData();
|
|
|
|
|
static void saveSessionData();
|
2013-10-11 17:04:56 +02:00
|
|
|
static void closeAllToolTips();
|
2014-11-11 11:00:32 +01:00
|
|
|
static void resetLocation();
|
2014-11-08 19:09:16 +02:00
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
static void slotUpdateVisibleToolTips();
|
2011-02-11 15:00:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGER_INTERNAL_DEBUGGERTOOLTIPMANAGER_H
|