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
|
|
|
|
2016-05-04 18:54:59 +02:00
|
|
|
#include "qmleventlocation.h"
|
2016-05-02 12:18:57 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
2016-04-26 12:26:46 +02:00
|
|
|
#include "qmlnote.h"
|
2016-12-29 14:26:29 +01:00
|
|
|
#include "qmleventtype.h"
|
|
|
|
|
#include "qmlevent.h"
|
|
|
|
|
#include "qmlprofilermodelmanager.h"
|
2016-05-02 12:18:57 +02:00
|
|
|
|
2018-05-03 09:50:11 +02:00
|
|
|
#include <tracing/timelinetracefile.h>
|
2018-04-05 09:47:33 +02:00
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QVector>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2016-05-10 13:27:48 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QFile)
|
2013-08-08 13:28:08 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QIODevice)
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QXmlStreamReader)
|
|
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2018-04-05 09:47:33 +02:00
|
|
|
class QmlProfilerTraceFile : public Timeline::TimelineTraceFile
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-04-05 09:47:33 +02:00
|
|
|
explicit QmlProfilerTraceFile(QObject *parent = nullptr);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2018-04-05 09:47:33 +02:00
|
|
|
void load(QIODevice *device) final;
|
|
|
|
|
void save(QIODevice *device) final;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2018-04-05 09:47:33 +02:00
|
|
|
private:
|
|
|
|
|
QmlProfilerModelManager *modelManager();
|
|
|
|
|
QmlProfilerNotesModel *qmlNotes();
|
2017-02-20 18:55:45 +01:00
|
|
|
void loadQtd(QIODevice *device);
|
|
|
|
|
void loadQzt(QIODevice *device);
|
2018-04-05 09:47:33 +02:00
|
|
|
void saveQtd(QIODevice *device);
|
|
|
|
|
void saveQzt(QIODevice *device);
|
2016-05-10 13:27:48 +02:00
|
|
|
|
2016-04-26 11:50:59 +02:00
|
|
|
void loadEventTypes(QXmlStreamReader &reader);
|
|
|
|
|
void loadEvents(QXmlStreamReader &reader);
|
|
|
|
|
void loadNotes(QXmlStreamReader &reader);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2017-02-20 18:55:45 +01:00
|
|
|
enum ProgressValues {
|
2018-04-05 09:47:33 +02:00
|
|
|
ProgressTypes = 128,
|
|
|
|
|
ProgressNotes = 32,
|
|
|
|
|
ProgressEvents = MaximumProgress - ProgressTypes - ProgressNotes - MinimumProgress,
|
2017-02-20 18:55:45 +01:00
|
|
|
};
|
|
|
|
|
|
2018-04-05 09:47:33 +02:00
|
|
|
void addEventsProgress(qint64 timestamp);
|
|
|
|
|
void addStageProgress(ProgressValues stage);
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|