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"
|
2016-05-02 12:18:57 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
2016-05-04 18:54:59 +02:00
|
|
|
#include "qmleventlocation.h"
|
2014-02-18 17:32:20 +01:00
|
|
|
#include "qmlprofilerdatamodel.h"
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
#include <QVariantList>
|
|
|
|
|
#include <QColor>
|
|
|
|
|
#include <QObject>
|
2013-08-08 13:28:08 +02:00
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
class QmlProfilerModelManager;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-10-28 19:01:43 +01:00
|
|
|
class QmlProfilerAnimationsModel : public QmlProfilerTimelineModel
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
struct QmlPaintEventData {
|
|
|
|
|
int framerate;
|
|
|
|
|
int animationcount;
|
2014-10-28 14:26:57 +01:00
|
|
|
int typeId;
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
2014-10-28 17:37:11 +01:00
|
|
|
QmlProfilerAnimationsModel(QmlProfilerModelManager *manager, QObject *parent = 0);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-06-23 12:38:53 +02:00
|
|
|
int rowMaxValue(int rowNumber) const;
|
|
|
|
|
|
2014-10-28 14:26:57 +01:00
|
|
|
int typeId(int index) const;
|
2014-11-18 17:37:25 +01:00
|
|
|
Q_INVOKABLE int expandedRow(int index) const;
|
|
|
|
|
Q_INVOKABLE int collapsedRow(int index) const;
|
2014-02-14 16:20:13 +01:00
|
|
|
|
2014-07-08 14:43:15 +02:00
|
|
|
QColor color(int index) const;
|
2014-09-02 12:19:33 +02:00
|
|
|
float relativeHeight(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;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-04-26 11:50:59 +02:00
|
|
|
bool accepted(const QmlEventType &event) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-09-11 11:12:47 +02:00
|
|
|
protected:
|
|
|
|
|
void loadData();
|
|
|
|
|
void clear();
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
private:
|
2014-10-28 10:57:32 +01:00
|
|
|
QVector<QmlProfilerAnimationsModel::QmlPaintEventData> m_data;
|
|
|
|
|
int m_maxGuiThreadAnimations;
|
|
|
|
|
int m_maxRenderThreadAnimations;
|
2014-10-28 14:26:57 +01:00
|
|
|
int rowFromThreadId(int threadId) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
2016-04-28 16:02:54 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|