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
|
2014-10-28 19:01:43 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-10-28 19:01:43 +01:00
|
|
|
|
2014-12-10 12:53:49 +01:00
|
|
|
#include "qmlprofiler_global.h"
|
|
|
|
|
#include "qmlprofilermodelmanager.h"
|
2018-05-03 09:50:11 +02:00
|
|
|
|
|
|
|
|
#include <tracing/timelinemodel.h>
|
|
|
|
|
#include <tracing/timelinemodelaggregator.h>
|
2014-10-28 19:01:43 +01:00
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
|
2014-12-09 11:01:23 +01:00
|
|
|
class QMLPROFILER_EXPORT QmlProfilerTimelineModel : public Timeline::TimelineModel {
|
2014-10-28 19:01:43 +01:00
|
|
|
Q_OBJECT
|
2016-05-02 12:18:57 +02:00
|
|
|
Q_PROPERTY(RangeType rangeType READ rangeType CONSTANT)
|
|
|
|
|
Q_PROPERTY(Message message READ message CONSTANT)
|
2014-10-28 19:01:43 +01:00
|
|
|
Q_PROPERTY(QmlProfilerModelManager *modelManager READ modelManager CONSTANT)
|
|
|
|
|
|
|
|
|
|
public:
|
2016-05-02 12:18:57 +02:00
|
|
|
QmlProfilerTimelineModel(QmlProfilerModelManager *modelManager, Message message,
|
2018-03-28 15:40:13 +02:00
|
|
|
RangeType rangeType, ProfileFeature mainFeature,
|
|
|
|
|
Timeline::TimelineModelAggregator *parent);
|
2014-10-28 19:01:43 +01:00
|
|
|
|
|
|
|
|
QmlProfilerModelManager *modelManager() const;
|
|
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
RangeType rangeType() const;
|
|
|
|
|
Message message() const;
|
|
|
|
|
ProfileFeature mainFeature() const;
|
2014-10-28 19:01:43 +01:00
|
|
|
|
2018-05-07 15:05:36 +02:00
|
|
|
bool handlesTypeId(int typeId) const override;
|
2016-07-13 10:09:51 +02:00
|
|
|
|
2015-11-13 17:53:00 +01:00
|
|
|
QVariantMap locationFromTypeId(int index) const;
|
2014-10-28 19:01:43 +01:00
|
|
|
|
2016-04-26 13:23:35 +02:00
|
|
|
virtual void loadEvent(const QmlEvent &event, const QmlEventType &type) = 0;
|
2018-04-05 09:47:33 +02:00
|
|
|
virtual void initialize();
|
|
|
|
|
virtual void finalize();
|
2014-10-28 19:01:43 +01:00
|
|
|
|
|
|
|
|
private:
|
2017-09-07 14:07:10 +02:00
|
|
|
void onVisibleFeaturesChanged(quint64 features);
|
|
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
const Message m_message;
|
|
|
|
|
const RangeType m_rangeType;
|
|
|
|
|
const ProfileFeature m_mainFeature;
|
2014-10-28 19:01:43 +01:00
|
|
|
QmlProfilerModelManager *const m_modelManager;
|
2016-04-26 13:23:35 +02:00
|
|
|
|
|
|
|
|
void updateProgress(qint64 count, qint64 max) const;
|
2014-10-28 19:01:43 +01:00
|
|
|
};
|
|
|
|
|
|
2016-04-26 13:23:35 +02:00
|
|
|
} // namespace QmlProfiler
|