2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +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.
|
2008-12-02 14:17:16 +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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-06-04 13:21:02 +02:00
|
|
|
#include <utils/basetreeview.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
namespace Debugger {
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-06-02 10:43:26 +02:00
|
|
|
enum WatchType { LocalsType, InspectType, WatchersType, ReturnType, TooltipType };
|
|
|
|
|
|
2014-06-04 13:21:02 +02:00
|
|
|
class WatchTreeView : public Utils::BaseTreeView
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2014-06-04 14:45:10 +02:00
|
|
|
explicit WatchTreeView(WatchType type);
|
2014-06-02 10:43:26 +02:00
|
|
|
WatchType type() const { return m_type; }
|
2014-06-03 11:34:52 +02:00
|
|
|
|
2012-03-29 14:20:45 +02:00
|
|
|
void setModel(QAbstractItemModel *model);
|
2014-04-09 17:39:41 +02:00
|
|
|
void rowActivated(const QModelIndex &index);
|
2012-05-18 02:28:41 +02:00
|
|
|
void reset();
|
2010-01-29 21:33:57 +01:00
|
|
|
|
2014-04-15 18:13:03 +02:00
|
|
|
void fillFormatMenu(QMenu *, const QModelIndex &mi);
|
2014-07-10 18:10:56 +02:00
|
|
|
static void reexpand(QTreeView *view, const QModelIndex &idx);
|
2014-04-15 18:13:03 +02:00
|
|
|
|
2010-11-05 19:38:40 +01:00
|
|
|
void watchExpression(const QString &exp);
|
2012-08-31 11:34:27 +02:00
|
|
|
void watchExpression(const QString &exp, const QString &name);
|
2012-05-18 02:28:41 +02:00
|
|
|
void handleItemIsExpanded(const QModelIndex &idx);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-10-05 13:42:14 +02:00
|
|
|
signals:
|
|
|
|
|
void currentIndexChanged(const QModelIndex ¤tIndex);
|
|
|
|
|
|
2015-01-29 23:55:10 +01:00
|
|
|
private:
|
2014-04-15 18:13:03 +02:00
|
|
|
void resetHelper();
|
|
|
|
|
void expandNode(const QModelIndex &idx);
|
|
|
|
|
void collapseNode(const QModelIndex &idx);
|
2016-04-19 22:49:23 +02:00
|
|
|
void adjustSlider();
|
2014-04-15 18:13:03 +02:00
|
|
|
|
2015-01-29 23:55:10 +01:00
|
|
|
void showUnprintable(int base);
|
2014-07-01 10:55:24 +02:00
|
|
|
void doItemsLayout();
|
2008-12-17 18:02:08 +01:00
|
|
|
void keyPressEvent(QKeyEvent *ev);
|
2008-12-02 12:01:29 +01:00
|
|
|
void contextMenuEvent(QContextMenuEvent *ev);
|
2009-04-29 12:20:10 +02:00
|
|
|
void dragEnterEvent(QDragEnterEvent *ev);
|
|
|
|
|
void dropEvent(QDropEvent *ev);
|
|
|
|
|
void dragMoveEvent(QDragMoveEvent *ev);
|
2010-07-14 15:38:20 +02:00
|
|
|
void mouseDoubleClickEvent(QMouseEvent *ev);
|
2009-07-01 12:49:41 +02:00
|
|
|
bool event(QEvent *ev);
|
2012-10-05 13:42:14 +02:00
|
|
|
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
2009-04-29 12:20:10 +02:00
|
|
|
|
2014-07-07 10:33:38 +02:00
|
|
|
void inputNewExpression();
|
2008-12-02 12:01:29 +01:00
|
|
|
void editItem(const QModelIndex &idx);
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void setModelData(int role, const QVariant &value = QVariant(),
|
|
|
|
|
const QModelIndex &index = QModelIndex());
|
|
|
|
|
|
2014-06-02 10:43:26 +02:00
|
|
|
WatchType m_type;
|
2009-07-01 12:49:41 +02:00
|
|
|
bool m_grabbing;
|
2014-07-01 10:55:24 +02:00
|
|
|
int m_sliderPosition;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|