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
|
2015-11-13 18:03:23 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2015-11-13 18:03:23 +01:00
|
|
|
|
2016-04-26 10:21:00 +02:00
|
|
|
#include "qmlprofilertimelinemodel.h"
|
2015-11-13 18:03:23 +01:00
|
|
|
|
2016-04-26 10:21:00 +02:00
|
|
|
namespace QmlProfiler {
|
2015-11-13 18:03:23 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2016-04-26 10:21:00 +02:00
|
|
|
class DebugMessagesModel : public QmlProfilerTimelineModel
|
2015-11-13 18:03:23 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-05-09 09:27:07 +02:00
|
|
|
struct Item {
|
|
|
|
|
Item(const QString &text = QString(), int typeId = -1) :
|
|
|
|
|
text(text), typeId(typeId) {}
|
|
|
|
|
QString text;
|
|
|
|
|
int typeId;
|
|
|
|
|
};
|
|
|
|
|
|
2018-03-28 15:40:13 +02:00
|
|
|
DebugMessagesModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent);
|
2015-11-13 18:03:23 +01:00
|
|
|
|
|
|
|
|
int typeId(int index) const override;
|
2016-11-08 18:11:36 +01:00
|
|
|
QRgb color(int index) const override;
|
2015-11-13 18:03:23 +01:00
|
|
|
QVariantList labels() const override;
|
|
|
|
|
QVariantMap details(int index) const override;
|
|
|
|
|
int expandedRow(int index) const override;
|
|
|
|
|
int collapsedRow(int index) const override;
|
2016-04-26 13:23:35 +02:00
|
|
|
void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
|
|
|
|
|
void finalize() override;
|
2015-11-13 18:03:23 +01:00
|
|
|
void clear() override;
|
|
|
|
|
QVariantMap location(int index) const override;
|
|
|
|
|
|
|
|
|
|
private:
|
2015-11-23 15:46:41 +01:00
|
|
|
static QString messageType(uint i);
|
|
|
|
|
|
|
|
|
|
int m_maximumMsgType;
|
2018-05-09 09:27:07 +02:00
|
|
|
QVector<Item> m_data;
|
2015-11-13 18:03:23 +01:00
|
|
|
};
|
|
|
|
|
|
2016-04-26 10:21:00 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qmlprofiler
|