2014-10-28 19:01:43 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-10-28 19:01:43 +01: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.
|
2014-10-28 19:01:43 +01: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.
|
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"
|
|
|
|
|
#include "qmlprofilerdatamodel.h"
|
|
|
|
|
#include "timeline/timelinemodel.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,
|
|
|
|
|
RangeType rangeType, ProfileFeature mainFeature, QObject *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
|
|
|
|
2016-06-06 19:51:55 +02:00
|
|
|
virtual bool accepted(const QmlEventType &type) const;
|
2014-10-28 19:01:43 +01:00
|
|
|
bool handlesTypeId(int typeId) const;
|
|
|
|
|
Q_INVOKABLE virtual int bindingLoopDest(int index) const;
|
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;
|
|
|
|
|
virtual void finalize() = 0;
|
2014-10-28 19:01:43 +01:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void dataChanged();
|
2015-06-30 14:37:47 +02:00
|
|
|
void onVisibleFeaturesChanged(quint64 features);
|
2014-10-28 19:01:43 +01:00
|
|
|
|
|
|
|
|
protected:
|
2016-04-28 16:19:17 +02:00
|
|
|
void announceFeatures(quint64 features);
|
2014-10-28 19:01:43 +01:00
|
|
|
|
|
|
|
|
private:
|
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
|