2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
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
|