2013-08-08 13:28:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
2013-08-08 13:28:08 +02: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.
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-10-28 19:01:43 +01:00
|
|
|
#include "qmlprofilertimelinemodel.h"
|
2014-02-18 17:32:20 +01:00
|
|
|
#include "qmlprofilerdatamodel.h"
|
2016-05-02 12:18:57 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
|
|
|
|
#include "qmlprofilereventlocation.h"
|
|
|
|
|
|
|
|
|
|
#include <QVariantList>
|
2013-08-08 13:28:08 +02:00
|
|
|
#include <QColor>
|
|
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
class QmlProfilerModelManager;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-10-28 19:01:43 +01:00
|
|
|
class QmlProfilerRangeModel : public QmlProfilerTimelineModel
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
struct QmlRangeEventStartInstance {
|
2014-08-29 19:30:30 +02:00
|
|
|
QmlRangeEventStartInstance() :
|
2016-05-02 12:18:57 +02:00
|
|
|
displayRowExpanded(Constants::QML_MIN_LEVEL),
|
|
|
|
|
displayRowCollapsed(Constants::QML_MIN_LEVEL),
|
2013-12-04 16:05:02 +01:00
|
|
|
bindingLoopHead(-1) {}
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
// not-expanded, per type
|
|
|
|
|
int displayRowExpanded;
|
|
|
|
|
int displayRowCollapsed;
|
|
|
|
|
int bindingLoopHead;
|
|
|
|
|
};
|
|
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range, QObject *parent = 0);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-11-18 17:37:25 +01:00
|
|
|
Q_INVOKABLE int expandedRow(int index) const;
|
|
|
|
|
Q_INVOKABLE int collapsedRow(int index) const;
|
2014-07-08 14:43:15 +02:00
|
|
|
int bindingLoopDest(int index) const;
|
|
|
|
|
QColor color(int index) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-07-08 14:43:15 +02:00
|
|
|
QVariantList labels() const;
|
2014-07-07 14:02:29 +02:00
|
|
|
QVariantMap details(int index) const;
|
2014-07-08 14:43:15 +02:00
|
|
|
QVariantMap location(int index) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-10-28 14:26:57 +01:00
|
|
|
int typeId(int index) const;
|
2014-08-29 16:32:42 +02:00
|
|
|
int selectionIdForLocation(const QString &filename, int line, int column) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-12-09 11:01:23 +01:00
|
|
|
virtual QList<const Timeline::TimelineRenderPass *> supportedRenderPasses() const;
|
2014-11-18 18:32:43 +01:00
|
|
|
|
2014-09-11 11:12:47 +02:00
|
|
|
protected:
|
|
|
|
|
void loadData();
|
|
|
|
|
void clear();
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
private:
|
2014-11-18 18:32:43 +01:00
|
|
|
|
|
|
|
|
bool supportsBindingLoops() const;
|
2014-10-28 10:57:32 +01:00
|
|
|
void computeNestingContracted();
|
|
|
|
|
void computeExpandedLevels();
|
|
|
|
|
void findBindingLoops();
|
|
|
|
|
|
|
|
|
|
QVector<QmlRangeEventStartInstance> m_data;
|
|
|
|
|
QVector<int> m_expandedRowTypes;
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|