2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-29 15:05:45 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/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
|
|
|
|
|
** 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, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt 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 {
|
2011-12-05 16:32:05 +01:00
|
|
|
EventHashStrRole = Qt::UserRole+1,
|
2011-06-29 15:05:45 +02:00
|
|
|
FilenameRole = Qt::UserRole+2,
|
2011-11-04 17:33:09 +01:00
|
|
|
LineRole = Qt::UserRole+3,
|
2012-01-12 16:36:40 +01:00
|
|
|
ColumnRole = Qt::UserRole+4,
|
|
|
|
|
EventIdRole = Qt::UserRole+5
|
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);
|
2011-11-04 17:33:09 +01:00
|
|
|
QModelIndex selectedItem() const;
|
|
|
|
|
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
|
|
|
|
2014-03-06 16:12:02 +01:00
|
|
|
void setShowJavaScript(bool show);
|
|
|
|
|
bool showJavaScript() const;
|
|
|
|
|
|
|
|
|
|
void setShowQml(bool show);
|
|
|
|
|
bool showQml() const;
|
2012-02-24 10:47:17 +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);
|
2013-08-08 13:28:08 +02:00
|
|
|
void eventSelectedByHash(const QString &eventHash);
|
2012-05-16 12:16:45 +02:00
|
|
|
void resized();
|
2011-11-09 12:57:41 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2013-08-08 13:28:08 +02:00
|
|
|
void updateSelectedEvent(const QString &eventHash) const;
|
2012-01-12 16:36:40 +01:00
|
|
|
void selectBySourceLocation(const QString &filename, int line, int column);
|
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 );
|
|
|
|
|
|
2011-08-24 11:18:48 +02:00
|
|
|
QModelIndex selectedItem() const;
|
2011-11-04 17:33:09 +01:00
|
|
|
void copyTableToClipboard() const;
|
|
|
|
|
void copyRowToClipboard() const;
|
|
|
|
|
|
|
|
|
|
static QString nameForType(int typeNumber);
|
2011-08-24 11:18:48 +02:00
|
|
|
|
2011-11-08 16:54:23 +01:00
|
|
|
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
|
2013-08-08 13:28:08 +02:00
|
|
|
QString selectedEventHash() 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);
|
2013-08-08 13:28:08 +02:00
|
|
|
void eventSelected(const QString &eventHash);
|
2011-06-29 15:05:45 +02:00
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void clear();
|
|
|
|
|
void jumpToItem(const QModelIndex &index);
|
2013-08-08 13:28:08 +02:00
|
|
|
void selectEvent(const QString &eventHash);
|
|
|
|
|
void selectEventByLocation(const QString &filename, int line, int column);
|
2011-06-29 15:05:45 +02:00
|
|
|
void buildModel();
|
|
|
|
|
|
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:
|
2013-08-08 13:28:08 +02:00
|
|
|
explicit QmlProfilerEventRelativesView(QmlProfilerModelManager *modelManager,
|
|
|
|
|
QmlProfilerEventRelativesModelProxy *modelProxy,
|
|
|
|
|
QWidget *parent );
|
|
|
|
|
~QmlProfilerEventRelativesView();
|
2011-11-04 17:33:09 +01:00
|
|
|
|
|
|
|
|
signals:
|
2013-08-08 13:28:08 +02:00
|
|
|
void eventClicked(const QString &eventHash);
|
2011-11-04 17:33:09 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2013-08-08 13:28:08 +02:00
|
|
|
void displayEvent(const QString &eventHash);
|
2011-11-04 17:33:09 +01:00
|
|
|
void jumpToItem(const QModelIndex &);
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
private:
|
2013-08-08 13:28:08 +02:00
|
|
|
void rebuildTree(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
|