2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-29 15:05:45 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2011-06-29 15:05:45 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-29 15:05:45 +02: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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2011-06-29 15:05:45 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2011-06-29 15:05:45 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
#ifndef QMLPROFILEREVENTVIEW_H
|
|
|
|
|
#define QMLPROFILEREVENTVIEW_H
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStandardItemModel>
|
2012-04-18 12:06:10 +02:00
|
|
|
#include <qmldebug/qmlprofilereventtypes.h>
|
2013-08-08 13:28:08 +02:00
|
|
|
#include "qmlprofilermodelmanager.h"
|
|
|
|
|
#include "qmlprofilereventsmodelproxy.h"
|
|
|
|
|
#include "qmlprofilertreeview.h"
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
#include <analyzerbase/ianalyzertool.h>
|
|
|
|
|
|
|
|
|
|
#include "qmlprofilerviewmanager.h"
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-11-04 17:33:09 +01:00
|
|
|
class QmlProfilerEventsMainView;
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerEventChildrenView;
|
|
|
|
|
class QmlProfilerEventRelativesView;
|
2011-11-04 17:33:09 +01:00
|
|
|
|
2011-06-29 15:05:45 +02:00
|
|
|
enum ItemRole {
|
2014-07-04 14:10:37 +02:00
|
|
|
SortRole = Qt::UserRole + 1, // Sort by data, not by displayed string
|
2014-08-29 16:32:42 +02:00
|
|
|
TypeIdRole,
|
2014-07-04 14:10:37 +02:00
|
|
|
FilenameRole,
|
|
|
|
|
LineRole,
|
2014-08-29 16:32:42 +02:00
|
|
|
ColumnRole
|
2011-06-29 15:05:45 +02:00
|
|
|
};
|
|
|
|
|
|
2011-11-04 17:33:09 +01:00
|
|
|
class QmlProfilerEventsWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2012-02-24 10:47:17 +01:00
|
|
|
explicit QmlProfilerEventsWidget(QWidget *parent,
|
2013-08-08 11:37:15 +02:00
|
|
|
QmlProfilerTool *profilerTool,
|
2012-02-24 10:47:17 +01:00
|
|
|
QmlProfilerViewManager *container,
|
2013-08-08 13:28:08 +02:00
|
|
|
QmlProfilerModelManager *profilerModelManager );
|
2011-11-04 17:33:09 +01:00
|
|
|
~QmlProfilerEventsWidget();
|
|
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
2011-11-08 16:54:23 +01:00
|
|
|
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
|
2014-08-29 16:32:42 +02:00
|
|
|
QModelIndex selectedModelIndex() const;
|
2011-11-04 17:33:09 +01:00
|
|
|
bool mouseOnTable(const QPoint &position) const;
|
|
|
|
|
void copyTableToClipboard() const;
|
|
|
|
|
void copyRowToClipboard() const;
|
|
|
|
|
|
2011-11-10 11:19:22 +01:00
|
|
|
bool hasGlobalStats() const;
|
2012-02-03 17:28:29 +01:00
|
|
|
void setShowExtendedStatistics(bool show);
|
|
|
|
|
bool showExtendedStatistics() const;
|
2011-11-10 11:19:22 +01:00
|
|
|
|
2011-11-04 17:33:09 +01:00
|
|
|
signals:
|
2012-01-12 16:36:40 +01:00
|
|
|
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
2014-08-29 16:32:42 +02:00
|
|
|
void typeSelected(int typeIndex);
|
2012-05-16 12:16:45 +02:00
|
|
|
void resized();
|
2011-11-09 12:57:41 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2014-09-29 16:24:34 +02:00
|
|
|
void selectByTypeId(int typeIndex) const;
|
2012-01-12 16:36:40 +01:00
|
|
|
void selectBySourceLocation(const QString &filename, int line, int column);
|
2015-06-30 16:23:13 +02:00
|
|
|
void onVisibleFeaturesChanged(quint64 features);
|
2011-11-04 17:33:09 +01:00
|
|
|
|
2012-02-13 15:26:57 +01:00
|
|
|
private slots:
|
2012-02-24 10:47:17 +01:00
|
|
|
void profilerDataModelStateChanged();
|
2012-02-13 15:26:57 +01:00
|
|
|
|
2011-11-04 17:33:09 +01:00
|
|
|
protected:
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *ev);
|
2012-05-16 12:16:45 +02:00
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
2011-11-04 17:33:09 +01:00
|
|
|
|
|
|
|
|
private:
|
2012-02-24 10:47:17 +01:00
|
|
|
class QmlProfilerEventsWidgetPrivate;
|
|
|
|
|
QmlProfilerEventsWidgetPrivate *d;
|
2011-11-04 17:33:09 +01:00
|
|
|
};
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerEventsMainView : public QmlProfilerTreeView
|
2011-06-29 15:05:45 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2013-08-08 13:28:08 +02:00
|
|
|
explicit QmlProfilerEventsMainView(QWidget *parent,
|
|
|
|
|
QmlProfilerEventsModelProxy *modelProxy);
|
2011-11-04 17:33:09 +01:00
|
|
|
~QmlProfilerEventsMainView();
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
void setFieldViewable(Fields field, bool show);
|
|
|
|
|
void setShowAnonymousEvents( bool showThem );
|
|
|
|
|
|
2014-08-29 16:32:42 +02:00
|
|
|
QModelIndex selectedModelIndex() const;
|
2011-11-04 17:33:09 +01:00
|
|
|
void copyTableToClipboard() const;
|
|
|
|
|
void copyRowToClipboard() const;
|
|
|
|
|
|
2014-06-03 16:57:32 +02:00
|
|
|
static QString nameForType(QmlDebug::RangeType typeNumber);
|
2011-08-24 11:18:48 +02:00
|
|
|
|
2011-11-08 16:54:23 +01:00
|
|
|
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
|
2014-08-29 16:32:42 +02:00
|
|
|
int selectedTypeId() const;
|
2011-11-08 16:54:23 +01:00
|
|
|
|
2012-02-03 17:28:29 +01:00
|
|
|
void setShowExtendedStatistics(bool);
|
|
|
|
|
bool showExtendedStatistics() const;
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2011-06-29 15:05:45 +02:00
|
|
|
signals:
|
2012-01-12 16:36:40 +01:00
|
|
|
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
2014-08-29 16:32:42 +02:00
|
|
|
void typeSelected(int typeIndex);
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void clear();
|
|
|
|
|
void jumpToItem(const QModelIndex &index);
|
2014-08-29 16:32:42 +02:00
|
|
|
void selectType(int typeIndex);
|
|
|
|
|
void selectByLocation(const QString &filename, int line, int column);
|
2011-06-29 15:05:45 +02:00
|
|
|
void buildModel();
|
2014-09-26 18:25:39 +02:00
|
|
|
void updateNotes(int typeIndex);
|
2011-06-29 15:05:45 +02:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
private slots:
|
|
|
|
|
void profilerDataModelStateChanged();
|
|
|
|
|
|
2011-06-29 15:05:45 +02:00
|
|
|
private:
|
2014-04-03 11:15:56 +02:00
|
|
|
void selectItem(const QStandardItem *item);
|
2011-06-29 15:05:45 +02:00
|
|
|
void setHeaderLabels();
|
2013-08-08 13:28:08 +02:00
|
|
|
void parseModelProxy();
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
private:
|
2011-11-04 17:33:09 +01:00
|
|
|
class QmlProfilerEventsMainViewPrivate;
|
|
|
|
|
QmlProfilerEventsMainViewPrivate *d;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerEventRelativesView : public QmlProfilerTreeView
|
2011-11-04 17:33:09 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2015-06-26 10:25:33 +02:00
|
|
|
explicit QmlProfilerEventRelativesView(QmlProfilerEventRelativesModelProxy *modelProxy,
|
2013-08-08 13:28:08 +02:00
|
|
|
QWidget *parent );
|
|
|
|
|
~QmlProfilerEventRelativesView();
|
2011-11-04 17:33:09 +01:00
|
|
|
|
|
|
|
|
signals:
|
2014-08-29 16:32:42 +02:00
|
|
|
void typeClicked(int typeIndex);
|
2011-11-04 17:33:09 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2014-08-29 16:32:42 +02:00
|
|
|
void displayType(int typeIndex);
|
2011-11-04 17:33:09 +01:00
|
|
|
void jumpToItem(const QModelIndex &);
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
private:
|
2014-06-13 16:34:30 +02:00
|
|
|
void rebuildTree(const QmlProfilerEventParentsModelProxy::QmlEventRelativesMap &eventMap);
|
2011-11-04 17:33:09 +01:00
|
|
|
void updateHeader();
|
|
|
|
|
QStandardItemModel *treeModel();
|
2011-06-29 15:05:45 +02:00
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
class QmlProfilerEventParentsViewPrivate;
|
|
|
|
|
QmlProfilerEventParentsViewPrivate *d;
|
2011-06-29 15:05:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|
|
|
|
|
|
|
|
|
|
#endif // QMLPROFILEREVENTVIEW_H
|