forked from qt-creator/qt-creator
QmlProfiler: Move timeline classes into own namespace
The new namespace "Timeline" is for classes that are supposed to go to the generic timeline library later. Change-Id: I1f6dce59de2c37398b1ed89473e1a94ec020104b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
|||||||
BindingLoopMaterial();
|
BindingLoopMaterial();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BindingLoopsRenderPassState : public TimelineRenderPass::State {
|
struct BindingLoopsRenderPassState : public Timeline::TimelineRenderPass::State {
|
||||||
BindingLoopsRenderPassState() : indexFrom(std::numeric_limits<int>::max()), indexTo(-1) {}
|
BindingLoopsRenderPassState() : indexFrom(std::numeric_limits<int>::max()), indexTo(-1) {}
|
||||||
BindingLoopMaterial material;
|
BindingLoopMaterial material;
|
||||||
int indexFrom;
|
int indexFrom;
|
||||||
@@ -81,7 +81,8 @@ QmlProfilerBindingLoopsRenderPass::QmlProfilerBindingLoopsRenderPass()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateNodes(const QmlProfilerRangeModel *model, int from, int to,
|
void updateNodes(const QmlProfilerRangeModel *model, int from, int to,
|
||||||
const TimelineRenderState *parentState, BindingLoopsRenderPassState *state)
|
const Timeline::TimelineRenderState *parentState,
|
||||||
|
BindingLoopsRenderPassState *state)
|
||||||
{
|
{
|
||||||
QVector<BindlingLoopsGeometry> expandedPerRow(model->expandedRowCount());
|
QVector<BindlingLoopsGeometry> expandedPerRow(model->expandedRowCount());
|
||||||
BindlingLoopsGeometry collapsed;
|
BindlingLoopsGeometry collapsed;
|
||||||
@@ -114,7 +115,7 @@ void updateNodes(const QmlProfilerRangeModel *model, int from, int to,
|
|||||||
state->collapsedOverlay->appendChildNode(collapsed.node);
|
state->collapsedOverlay->appendChildNode(collapsed.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rowHeight = TimelineModel::defaultRowHeight();
|
int rowHeight = Timeline::TimelineModel::defaultRowHeight();
|
||||||
for (int i = from; i < to; ++i) {
|
for (int i = from; i < to; ++i) {
|
||||||
int bindingLoopDest = model->bindingLoopDest(i);
|
int bindingLoopDest = model->bindingLoopDest(i);
|
||||||
if (bindingLoopDest == -1)
|
if (bindingLoopDest == -1)
|
||||||
@@ -141,8 +142,9 @@ void updateNodes(const QmlProfilerRangeModel *model, int from, int to,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineRenderPass::State *QmlProfilerBindingLoopsRenderPass::update(
|
Timeline::TimelineRenderPass::State *QmlProfilerBindingLoopsRenderPass::update(
|
||||||
const TimelineRenderer *renderer, const TimelineRenderState *parentState, State *oldState,
|
const Timeline::TimelineRenderer *renderer,
|
||||||
|
const Timeline::TimelineRenderState *parentState, State *oldState,
|
||||||
int indexFrom, int indexTo, bool stateChanged, qreal spacing) const
|
int indexFrom, int indexTo, bool stateChanged, qreal spacing) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(stateChanged);
|
Q_UNUSED(stateChanged);
|
||||||
@@ -238,7 +240,7 @@ void BindlingLoopsGeometry::allocate(QSGMaterial *material)
|
|||||||
|
|
||||||
void BindlingLoopsGeometry::addExpandedEvent(float itemCenter)
|
void BindlingLoopsGeometry::addExpandedEvent(float itemCenter)
|
||||||
{
|
{
|
||||||
float verticalCenter = TimelineModel::defaultRowHeight() / 2.0;
|
float verticalCenter = Timeline::TimelineModel::defaultRowHeight() / 2.0;
|
||||||
Point2DWithOffset *v = vertexData() + usedVertices;
|
Point2DWithOffset *v = vertexData() + usedVertices;
|
||||||
v[0].set(itemCenter, verticalCenter, -1.0f, currentY);
|
v[0].set(itemCenter, verticalCenter, -1.0f, currentY);
|
||||||
v[1].set(itemCenter, verticalCenter, +1.0f, currentY);
|
v[1].set(itemCenter, verticalCenter, +1.0f, currentY);
|
||||||
|
|||||||
@@ -40,11 +40,12 @@
|
|||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlProfilerBindingLoopsRenderPass : public TimelineRenderPass
|
class QmlProfilerBindingLoopsRenderPass : public Timeline::TimelineRenderPass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const QmlProfilerBindingLoopsRenderPass *instance();
|
static const QmlProfilerBindingLoopsRenderPass *instance();
|
||||||
State *update(const TimelineRenderer *renderer, const TimelineRenderState *parentState,
|
State *update(const Timeline::TimelineRenderer *renderer,
|
||||||
|
const Timeline::TimelineRenderState *parentState,
|
||||||
State *oldState, int indexFrom, int indexTo, bool stateChanged,
|
State *oldState, int indexFrom, int indexTo, bool stateChanged,
|
||||||
qreal spacing) const;
|
qreal spacing) const;
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ int QmlProfilerNotesModel::add(int typeId, qint64 start, qint64 duration, const
|
|||||||
{
|
{
|
||||||
int timelineModel = -1;
|
int timelineModel = -1;
|
||||||
int timelineIndex = -1;
|
int timelineIndex = -1;
|
||||||
foreach (const TimelineModel *model, timelineModels()) {
|
foreach (const Timeline::TimelineModel *model, timelineModels()) {
|
||||||
if (model->handlesTypeId(typeId)) {
|
if (model->handlesTypeId(typeId)) {
|
||||||
for (int i = model->firstIndex(start); i <= model->lastIndex(start + duration); ++i) {
|
for (int i = model->firstIndex(start); i <= model->lastIndex(start + duration); ++i) {
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
@@ -89,7 +89,7 @@ void QmlProfilerNotesModel::saveData()
|
|||||||
{
|
{
|
||||||
QVector<QmlProfilerDataModel::QmlEventNoteData> notes;
|
QVector<QmlProfilerDataModel::QmlEventNoteData> notes;
|
||||||
for (int i = 0; i < count(); ++i) {
|
for (int i = 0; i < count(); ++i) {
|
||||||
const TimelineModel *model = timelineModelByModelId(timelineModel(i));
|
const Timeline::TimelineModel *model = timelineModelByModelId(timelineModel(i));
|
||||||
if (!model)
|
if (!model)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
class QMLPROFILER_EXPORT QmlProfilerNotesModel : public TimelineNotesModel {
|
class QMLPROFILER_EXPORT QmlProfilerNotesModel : public Timeline::TimelineNotesModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QmlProfilerNotesModel(QObject *parent);
|
QmlProfilerNotesModel(QObject *parent);
|
||||||
@@ -51,5 +51,5 @@ protected:
|
|||||||
|
|
||||||
int add(int typeId, qint64 startTime, qint64 duration, const QString &text);
|
int add(int typeId, qint64 startTime, qint64 duration, const QString &text);
|
||||||
};
|
};
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
#endif // NOTESMODEL_H
|
#endif // QMLPROFILERNOTESMODEL_H
|
||||||
|
|||||||
@@ -284,14 +284,14 @@ int QmlProfilerRangeModel::selectionIdForLocation(const QString &filename, int l
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<const TimelineRenderPass *> QmlProfilerRangeModel::supportedRenderPasses() const
|
QList<const Timeline::TimelineRenderPass *> QmlProfilerRangeModel::supportedRenderPasses() const
|
||||||
{
|
{
|
||||||
if (supportsBindingLoops()) {
|
if (supportsBindingLoops()) {
|
||||||
QList<const TimelineRenderPass *> passes;
|
QList<const Timeline::TimelineRenderPass *> passes;
|
||||||
passes << TimelineItemsRenderPass::instance()
|
passes << Timeline::TimelineItemsRenderPass::instance()
|
||||||
<< QmlProfilerBindingLoopsRenderPass::instance()
|
<< QmlProfilerBindingLoopsRenderPass::instance()
|
||||||
<< TimelineSelectionRenderPass::instance()
|
<< Timeline::TimelineSelectionRenderPass::instance()
|
||||||
<< TimelineNotesRenderPass::instance();
|
<< Timeline::TimelineNotesRenderPass::instance();
|
||||||
return passes;
|
return passes;
|
||||||
} else {
|
} else {
|
||||||
return QmlProfilerTimelineModel::supportedRenderPasses();
|
return QmlProfilerTimelineModel::supportedRenderPasses();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
int typeId(int index) const;
|
int typeId(int index) const;
|
||||||
int selectionIdForLocation(const QString &filename, int line, int column) const;
|
int selectionIdForLocation(const QString &filename, int line, int column) const;
|
||||||
|
|
||||||
virtual QList<const TimelineRenderPass *> supportedRenderPasses() const;
|
virtual QList<const Timeline::TimelineRenderPass *> supportedRenderPasses() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void loadData();
|
void loadData();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
|
||||||
class QMLPROFILER_EXPORT QmlProfilerTimelineModel : public TimelineModel {
|
class QMLPROFILER_EXPORT QmlProfilerTimelineModel : public Timeline::TimelineModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QmlDebug::RangeType rangeType READ rangeType CONSTANT)
|
Q_PROPERTY(QmlDebug::RangeType rangeType READ rangeType CONSTANT)
|
||||||
Q_PROPERTY(QmlDebug::Message message READ message CONSTANT)
|
Q_PROPERTY(QmlDebug::Message message READ message CONSTANT)
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ public:
|
|||||||
|
|
||||||
QQuickView *m_mainView;
|
QQuickView *m_mainView;
|
||||||
QmlProfilerModelManager *m_modelManager;
|
QmlProfilerModelManager *m_modelManager;
|
||||||
TimelineModelAggregator *m_modelProxy;
|
Timeline::TimelineModelAggregator *m_modelProxy;
|
||||||
|
|
||||||
|
|
||||||
TimelineZoomControl *m_zoomControl;
|
Timeline::TimelineZoomControl *m_zoomControl;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager, QmlProfilerStateManager *profilerState)
|
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager, QmlProfilerStateManager *profilerState)
|
||||||
@@ -91,18 +91,18 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
|
|||||||
{
|
{
|
||||||
setObjectName(QLatin1String("QML Profiler"));
|
setObjectName(QLatin1String("QML Profiler"));
|
||||||
|
|
||||||
d->m_zoomControl = new TimelineZoomControl(this);
|
d->m_zoomControl = new Timeline::TimelineZoomControl(this);
|
||||||
connect(modelManager->traceTime(), &QmlProfilerTraceTime::timeChanged,
|
connect(modelManager->traceTime(), &QmlProfilerTraceTime::timeChanged,
|
||||||
d->m_zoomControl, &TimelineZoomControl::setTrace);
|
d->m_zoomControl, &Timeline::TimelineZoomControl::setTrace);
|
||||||
|
|
||||||
QVBoxLayout *groupLayout = new QVBoxLayout;
|
QVBoxLayout *groupLayout = new QVBoxLayout;
|
||||||
groupLayout->setContentsMargins(0, 0, 0, 0);
|
groupLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
groupLayout->setSpacing(0);
|
groupLayout->setSpacing(0);
|
||||||
|
|
||||||
qmlRegisterType<TimelineRenderer>("TimelineRenderer", 1, 0, "TimelineRenderer");
|
qmlRegisterType<Timeline::TimelineRenderer>("TimelineRenderer", 1, 0, "TimelineRenderer");
|
||||||
qmlRegisterType<TimelineZoomControl>();
|
qmlRegisterType<Timeline::TimelineZoomControl>();
|
||||||
qmlRegisterType<TimelineModel>();
|
qmlRegisterType<Timeline::TimelineModel>();
|
||||||
qmlRegisterType<TimelineNotesModel>();
|
qmlRegisterType<Timeline::TimelineNotesModel>();
|
||||||
|
|
||||||
d->m_mainView = new QmlProfilerQuickView(this);
|
d->m_mainView = new QmlProfilerQuickView(this);
|
||||||
d->m_mainView->setResizeMode(QQuickView::SizeRootObjectToView);
|
d->m_mainView->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
@@ -115,7 +115,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
|
|||||||
d->m_profilerTool = profilerTool;
|
d->m_profilerTool = profilerTool;
|
||||||
d->m_viewContainer = container;
|
d->m_viewContainer = container;
|
||||||
|
|
||||||
d->m_modelProxy = new TimelineModelAggregator(modelManager->notesModel(), this);
|
d->m_modelProxy = new Timeline::TimelineModelAggregator(modelManager->notesModel(), this);
|
||||||
d->m_modelManager = modelManager;
|
d->m_modelManager = modelManager;
|
||||||
|
|
||||||
connect(modelManager,SIGNAL(dataAvailable()), d->m_modelProxy,SIGNAL(dataAvailable()));
|
connect(modelManager,SIGNAL(dataAvailable()), d->m_modelProxy,SIGNAL(dataAvailable()));
|
||||||
|
|||||||
@@ -34,8 +34,7 @@
|
|||||||
#include <QSGVertexColorMaterial>
|
#include <QSGVertexColorMaterial>
|
||||||
#include <QtAlgorithms>
|
#include <QtAlgorithms>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineItemsMaterial : public QSGMaterial {
|
class TimelineItemsMaterial : public QSGMaterial {
|
||||||
public:
|
public:
|
||||||
@@ -453,5 +452,4 @@ void OpaqueColoredPoint2DWithSize::set(float nx, float ny, float nw, float nh, f
|
|||||||
r = nr; g = ng, b = nb; a = 255;
|
r = nr; g = ng, b = nb; a = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
#include "timelinerenderpass.h"
|
#include "timelinerenderpass.h"
|
||||||
#include <QSGMaterial>
|
#include <QSGMaterial>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineItemsRenderPass : public TimelineRenderPass
|
class TimelineItemsRenderPass : public TimelineRenderPass
|
||||||
{
|
{
|
||||||
@@ -49,8 +48,6 @@ protected:
|
|||||||
TimelineItemsRenderPass();
|
TimelineItemsRenderPass();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|
||||||
#endif // TIMELINEITEMSRENDERPASS_H
|
#endif // TIMELINEITEMSRENDERPASS_H
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <QLinkedList>
|
#include <QLinkedList>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QmlProfiler::TimelineModel
|
\class QmlProfiler::TimelineModel
|
||||||
@@ -623,6 +623,6 @@ int TimelineModel::TimelineModelPrivate::prevItemById(IdType idType, int id, qin
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#include "moc_timelinemodel.cpp"
|
#include "moc_timelinemodel.cpp"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
class QMLPROFILER_EXPORT TimelineModel : public QObject
|
class QMLPROFILER_EXPORT TimelineModel : public QObject
|
||||||
{
|
{
|
||||||
@@ -155,6 +155,6 @@ private:
|
|||||||
Q_DECLARE_PRIVATE(TimelineModel)
|
Q_DECLARE_PRIVATE(TimelineModel)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#endif // TIMELINEMODEL_H
|
#endif // TIMELINEMODEL_H
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "timelinemodel.h"
|
#include "timelinemodel.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
class QMLPROFILER_EXPORT TimelineModel::TimelineModelPrivate {
|
class QMLPROFILER_EXPORT TimelineModel::TimelineModelPrivate {
|
||||||
public:
|
public:
|
||||||
@@ -135,5 +135,6 @@ private:
|
|||||||
Q_DECLARE_PUBLIC(TimelineModel)
|
Q_DECLARE_PUBLIC(TimelineModel)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#endif // TIMELINEMODEL_P_H
|
#endif // TIMELINEMODEL_P_H
|
||||||
|
|||||||
@@ -38,9 +38,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
|
|
||||||
class TimelineModelAggregator::TimelineModelAggregatorPrivate {
|
class TimelineModelAggregator::TimelineModelAggregatorPrivate {
|
||||||
public:
|
public:
|
||||||
@@ -219,5 +217,4 @@ QVariantMap TimelineModelAggregator::prevItem(int selectedModel, int selectedIte
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Timeline
|
||||||
} // namespace QmlProfiler
|
|
||||||
|
|||||||
@@ -35,15 +35,14 @@
|
|||||||
#include "qmlprofilermodelmanager.h"
|
#include "qmlprofilermodelmanager.h"
|
||||||
#include "timelinerenderer.h"
|
#include "timelinerenderer.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineModelAggregator : public QObject
|
class TimelineModelAggregator : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int height READ height NOTIFY heightChanged)
|
Q_PROPERTY(int height READ height NOTIFY heightChanged)
|
||||||
Q_PROPERTY(QVariantList models READ models NOTIFY modelsChanged)
|
Q_PROPERTY(QVariantList models READ models NOTIFY modelsChanged)
|
||||||
Q_PROPERTY(QmlProfiler::TimelineNotesModel *notes READ notes CONSTANT)
|
Q_PROPERTY(Timeline::TimelineNotesModel *notes READ notes CONSTANT)
|
||||||
public:
|
public:
|
||||||
TimelineModelAggregator(TimelineNotesModel *notes, QObject *parent = 0);
|
TimelineModelAggregator(TimelineNotesModel *notes, QObject *parent = 0);
|
||||||
~TimelineModelAggregator();
|
~TimelineModelAggregator();
|
||||||
@@ -74,7 +73,6 @@ private:
|
|||||||
TimelineModelAggregatorPrivate *d;
|
TimelineModelAggregatorPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|
||||||
#endif // TIMELINEMODELAGGREGATOR_H
|
#endif // TIMELINEMODELAGGREGATOR_H
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "timelinenotesmodel_p.h"
|
#include "timelinenotesmodel_p.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
TimelineNotesModel::TimelineNotesModelPrivate::TimelineNotesModelPrivate(TimelineNotesModel *q) :
|
TimelineNotesModel::TimelineNotesModelPrivate::TimelineNotesModelPrivate(TimelineNotesModel *q) :
|
||||||
modified(false), q_ptr(q)
|
modified(false), q_ptr(q)
|
||||||
@@ -220,6 +220,6 @@ void TimelineNotesModel::clear()
|
|||||||
emit changed(-1, -1, -1);
|
emit changed(-1, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#include "moc_timelinenotesmodel.cpp"
|
#include "moc_timelinenotesmodel.cpp"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "timelinemodel.h"
|
#include "timelinemodel.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
class QMLPROFILER_EXPORT TimelineNotesModel : public QObject
|
class QMLPROFILER_EXPORT TimelineNotesModel : public QObject
|
||||||
{
|
{
|
||||||
@@ -80,6 +80,6 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d_ptr, void _q_removeTimelineModel(QObject *timelineModel))
|
Q_PRIVATE_SLOT(d_ptr, void _q_removeTimelineModel(QObject *timelineModel))
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#endif // TIMELINENOTESMODEL_H
|
#endif // TIMELINENOTESMODEL_H
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "timelinenotesmodel.h"
|
#include "timelinenotesmodel.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
class TimelineNotesModel::TimelineNotesModelPrivate {
|
class TimelineNotesModel::TimelineNotesModelPrivate {
|
||||||
public:
|
public:
|
||||||
@@ -59,6 +59,7 @@ private:
|
|||||||
Q_DECLARE_PUBLIC(TimelineNotesModel)
|
Q_DECLARE_PUBLIC(TimelineNotesModel)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|
||||||
#endif // TIMELINENOTESMODEL_P_H
|
#endif // TIMELINENOTESMODEL_P_H
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,7 @@
|
|||||||
#include "timelinerenderstate.h"
|
#include "timelinerenderstate.h"
|
||||||
#include "qmlprofilernotesmodel.h"
|
#include "qmlprofilernotesmodel.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
struct Point2DWithDistanceFromTop {
|
struct Point2DWithDistanceFromTop {
|
||||||
float x, y, d;
|
float x, y, d;
|
||||||
@@ -255,5 +254,4 @@ void Point2DWithDistanceFromTop::set(float nx, float ny, float nd)
|
|||||||
x = nx; y = ny; d = nd;
|
x = nx; y = ny; d = nd;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,8 +34,7 @@
|
|||||||
#include "timelinerenderer.h"
|
#include "timelinerenderer.h"
|
||||||
#include <QSGMaterial>
|
#include <QSGMaterial>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineNotesRenderPass : public TimelineRenderPass
|
class TimelineNotesRenderPass : public TimelineRenderPass
|
||||||
{
|
{
|
||||||
@@ -50,9 +49,7 @@ private:
|
|||||||
TimelineNotesRenderPass();
|
TimelineNotesRenderPass();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // TIMELINENOTESRENDERPASS_H
|
#endif // TIMELINENOTESRENDERPASS_H
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
using namespace QmlProfiler;
|
namespace Timeline {
|
||||||
using namespace QmlProfiler::Internal;
|
|
||||||
|
|
||||||
TimelineRenderer::TimelineRenderer(QQuickItem *parent) :
|
TimelineRenderer::TimelineRenderer(QQuickItem *parent) :
|
||||||
QQuickItem(parent), m_model(0), m_zoomer(0), m_notes(0),
|
QQuickItem(parent), m_model(0), m_zoomer(0), m_notes(0),
|
||||||
@@ -460,3 +459,4 @@ void TimelineRenderer::setRowCountsDirty()
|
|||||||
m_rowCountsDirty = true;
|
m_rowCountsDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Timeline
|
||||||
|
|||||||
@@ -38,8 +38,7 @@
|
|||||||
#include "timelinenotesmodel.h"
|
#include "timelinenotesmodel.h"
|
||||||
#include "timelinerenderpass.h"
|
#include "timelinerenderpass.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineRenderPass;
|
class TimelineRenderPass;
|
||||||
class TimelineRenderState;
|
class TimelineRenderState;
|
||||||
@@ -47,9 +46,9 @@ class TimelineRenderState;
|
|||||||
class TimelineRenderer : public QQuickItem
|
class TimelineRenderer : public QQuickItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QmlProfiler::TimelineModel *model READ model WRITE setModel NOTIFY modelChanged)
|
Q_PROPERTY(Timeline::TimelineModel *model READ model WRITE setModel NOTIFY modelChanged)
|
||||||
Q_PROPERTY(QmlProfiler::TimelineZoomControl *zoomer READ zoomer WRITE setZoomer NOTIFY zoomerChanged)
|
Q_PROPERTY(Timeline::TimelineZoomControl *zoomer READ zoomer WRITE setZoomer NOTIFY zoomerChanged)
|
||||||
Q_PROPERTY(QmlProfiler::TimelineNotesModel *notes READ notes WRITE setNotes NOTIFY notesChanged)
|
Q_PROPERTY(Timeline::TimelineNotesModel *notes READ notes WRITE setNotes NOTIFY notesChanged)
|
||||||
Q_PROPERTY(bool selectionLocked READ selectionLocked WRITE setSelectionLocked NOTIFY selectionLockedChanged)
|
Q_PROPERTY(bool selectionLocked READ selectionLocked WRITE setSelectionLocked NOTIFY selectionLockedChanged)
|
||||||
Q_PROPERTY(int selectedItem READ selectedItem WRITE setSelectedItem NOTIFY selectedItemChanged)
|
Q_PROPERTY(int selectedItem READ selectedItem WRITE setSelectedItem NOTIFY selectedItemChanged)
|
||||||
|
|
||||||
@@ -164,9 +163,8 @@ private:
|
|||||||
TimelineRenderState *m_lastState;
|
TimelineRenderState *m_lastState;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Timeline
|
||||||
} // namespace QmlProfiler
|
|
||||||
|
|
||||||
QML_DECLARE_TYPE(QmlProfiler::Internal::TimelineRenderer)
|
QML_DECLARE_TYPE(Timeline::TimelineRenderer)
|
||||||
|
|
||||||
#endif // TIMELINERENDERER_H
|
#endif // TIMELINERENDERER_H
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#include "timelinerenderpass.h"
|
#include "timelinerenderpass.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,8 +34,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QSGNode)
|
QT_FORWARD_DECLARE_CLASS(QSGNode)
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineRenderer;
|
class TimelineRenderer;
|
||||||
class TimelineRenderState;
|
class TimelineRenderState;
|
||||||
@@ -57,6 +56,6 @@ public:
|
|||||||
qreal spacing) const = 0;
|
qreal spacing) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
#endif // TIMELINERENDERPASS_H
|
#endif // TIMELINERENDERPASS_H
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
|
|
||||||
#include "timelinerenderstate.h"
|
#include "timelinerenderstate.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
TimelineRenderState::TimelineRenderState(qint64 start, qint64 end, qreal scale, int numPasses) :
|
TimelineRenderState::TimelineRenderState(qint64 start, qint64 end, qreal scale, int numPasses) :
|
||||||
m_expandedRowRoot(new QSGNode), m_collapsedRowRoot(new QSGNode),
|
m_expandedRowRoot(new QSGNode), m_collapsedRowRoot(new QSGNode),
|
||||||
@@ -108,5 +107,4 @@ void TimelineRenderState::setPassState(int i, TimelineRenderPass::State *state)
|
|||||||
m_passes[i] = state;
|
m_passes[i] = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,8 +34,7 @@
|
|||||||
#include <QSGNode>
|
#include <QSGNode>
|
||||||
#include "timelinerenderpass.h"
|
#include "timelinerenderpass.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineRenderState {
|
class TimelineRenderState {
|
||||||
public:
|
public:
|
||||||
@@ -71,7 +70,6 @@ private:
|
|||||||
QVector<TimelineRenderPass::State *> m_passes;
|
QVector<TimelineRenderPass::State *> m_passes;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|
||||||
#endif // TIMELINERENDERSTATE_H
|
#endif // TIMELINERENDERSTATE_H
|
||||||
|
|||||||
@@ -33,8 +33,7 @@
|
|||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <QSGSimpleRectNode>
|
#include <QSGSimpleRectNode>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
QSGSimpleRectNode *createSelectionNode()
|
QSGSimpleRectNode *createSelectionNode()
|
||||||
{
|
{
|
||||||
@@ -135,5 +134,4 @@ TimelineSelectionRenderPass::TimelineSelectionRenderPass()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
#include "timelinerenderpass.h"
|
#include "timelinerenderpass.h"
|
||||||
#include "timelinerenderstate.h"
|
#include "timelinerenderstate.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class TimelineSelectionRenderPass : public TimelineRenderPass
|
class TimelineSelectionRenderPass : public TimelineRenderPass
|
||||||
{
|
{
|
||||||
@@ -51,8 +50,7 @@ protected:
|
|||||||
TimelineSelectionRenderPass();
|
TimelineSelectionRenderPass();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
}
|
|
||||||
|
|
||||||
#endif // TIMELINESELECTIONRENDERPASS_H
|
#endif // TIMELINESELECTIONRENDERPASS_H
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "timelinezoomcontrol.h"
|
#include "timelinezoomcontrol.h"
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
TimelineZoomControl::TimelineZoomControl(QObject *parent) : QObject(parent), m_traceStart(-1), m_traceEnd(-1),
|
TimelineZoomControl::TimelineZoomControl(QObject *parent) : QObject(parent), m_traceStart(-1), m_traceEnd(-1),
|
||||||
m_windowStart(-1), m_windowEnd(-1), m_rangeStart(-1), m_rangeEnd(-1), m_windowLocked(false)
|
m_windowStart(-1), m_windowEnd(-1), m_rangeStart(-1), m_rangeEnd(-1), m_windowLocked(false)
|
||||||
@@ -170,4 +170,4 @@ void TimelineZoomControl::clampRangeToWindow()
|
|||||||
setRange(rangeStart, rangeEnd);
|
setRange(rangeStart, rangeEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Timeline
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace Timeline {
|
||||||
|
|
||||||
class TimelineZoomControl : public QObject {
|
class TimelineZoomControl : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -101,5 +101,7 @@ protected:
|
|||||||
void rebuildWindow();
|
void rebuildWindow();
|
||||||
void clampRangeToWindow();
|
void clampRangeToWindow();
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
} // namespace Timeline
|
||||||
|
|
||||||
#endif // TIMELINEZOOMCONTROL_H
|
#endif // TIMELINEZOOMCONTROL_H
|
||||||
|
|||||||
Reference in New Issue
Block a user