Timeline: Create new library from contents of QmlProfiler

Change-Id: I964b2f149e237eb25a08600e8dab8968e8bc0cb9
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-12-10 12:53:49 +01:00
parent acc4d1a412
commit c40d9e9d17
90 changed files with 307 additions and 198 deletions

View File

@@ -12,7 +12,8 @@ SUBDIRS = \
qmldebug \
qmleditorwidgets \
glsl \
ssh
ssh \
timeline
for(l, SUBDIRS) {
QTC_LIB_DEPENDS =

View File

@@ -13,6 +13,7 @@ Project {
"qmldebug/qmldebug.qbs",
"qtcreatorcdbext/qtcreatorcdbext.qbs",
"ssh/ssh.qbs",
"timeline/timeline.qbs",
"utils/process_stub.qbs",
"utils/process_ctrlc_stub.qbs",
"utils/utils.qbs",

34
src/libs/timeline/README Normal file
View File

@@ -0,0 +1,34 @@
The timeline library can be used to display timeline data, primarily for performance analysis. It
provides a comprehensive set of visual components as well as a set of models that can be extended to
hold custom timeline data. You can use all the provided QML to get a complete GUI similar to the QML
profiler or you can mix and match the QML components with your own.
Models
------
At the core of the timeline library is the TimelineModel. You can create multiple TimelineModels to
represent different categories of data. The TimelineModelAggregator class is then used to manage
those models. TimelineModels are expected to load their contents all at once and then only change if
you clear() and possibly reload them. To complement that, you can use the TimelineNotesModel. The
TimelineNotesModel is designed to hold less, but mutable, data that spans all TimelineModels in a
TimelineModelAggregator.
Views
-----
Expose the TimelineRenderer class to QML and add a TimelineModel to it to get a visualization of the
data in the model. TimelineRenderer will generally use the TimelineRenderPasses the TimelineModel
suggests. It contains a caching system for keeping different versions of the visualization,
depending on position and zoom level, so that the picture always stays sharp and numerical overflows
are avoided. To do that it needs a TimelineZoomControl which manages zooming and scrolling.
A simplified display for the contents of a TimelineModel, based on the same render passes as the
TimelineRenderer, can be found in TimelineOverviewRenderer. TimelineOverviewRenderer will squeeze
the data into a fixed height and only allow all the data to be displayed at once. It won't react to
zooming or scrolling and can easily be used for a more concise overview.
Various utilities are provided in the QML code. CategoryLabels can be used to provide a legend for
data rendered using a TimelineRenderer. TimeMarks provides colored bars that can be layered behind
a TimelineRenderer to make the rows easier to distinguish. TimeDisplay provides a legend for the
time spanned by a timeline.

View File

@@ -84,7 +84,7 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: "qrc:/qmlprofiler/ico_prev.png"
iconSource: "qrc:/timeline/ico_prev.png"
tooltip: qsTr("Jump to previous event.")
onClicked: buttons.jumpToPrev()
}
@@ -95,7 +95,7 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: "qrc:/qmlprofiler/ico_next.png"
iconSource: "qrc:/timeline/ico_next.png"
tooltip: qsTr("Jump to next event.")
onClicked: buttons.jumpToNext()
}
@@ -106,7 +106,7 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: "qrc:/qmlprofiler/ico_zoom.png"
iconSource: "qrc:/timeline/ico_zoom.png"
tooltip: qsTr("Show zoom slider.")
checkable: true
checked: false
@@ -119,7 +119,7 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: "qrc:/qmlprofiler/ico_filter.png"
iconSource: "qrc:/timeline/ico_filter.png"
tooltip: qsTr("Filter Categories")
checkable: true
onCheckedChanged: buttons.filterMenuChanged()
@@ -131,8 +131,8 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: checked ? "qrc:/qmlprofiler/ico_rangeselected.png" :
"qrc:/qmlprofiler/ico_rangeselection.png"
iconSource: checked ? "qrc:/timeline/ico_rangeselected.png" :
"qrc:/timeline/ico_rangeselection.png"
tooltip: qsTr("Select range.")
checkable: true
checked: false
@@ -145,7 +145,7 @@ ToolBar {
anchors.bottom: parent.bottom
implicitWidth: buttonWidth
iconSource: "qrc:/qmlprofiler/ico_selectionmode.png"
iconSource: "qrc:/timeline/ico_selectionmode.png"
tooltip: qsTr("View event information on mouseover.")
checkable: true
checked: false

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 144 B

After

Width:  |  Height:  |  Size: 144 B

View File

Before

Width:  |  Height:  |  Size: 664 B

After

Width:  |  Height:  |  Size: 664 B

View File

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 164 B

View File

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View File

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 715 B

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 745 B

View File

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

View File

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View File

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

View File

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 584 B

View File

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

View File

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

@@ -0,0 +1,36 @@
<RCC>
<qresource prefix="/timeline">
<file>Detail.qml</file>
<file>CategoryLabel.qml</file>
<file>MainView.qml</file>
<file>RangeDetails.qml</file>
<file>RangeMover.qml</file>
<file>TimeDisplay.qml</file>
<file>lock_closed.png</file>
<file>lock_open.png</file>
<file>ico_edit.png</file>
<file>TimeMarks.qml</file>
<file>Overview.qml</file>
<file>SelectionRange.qml</file>
<file>SelectionRangeDetails.qml</file>
<file>arrow_down.png</file>
<file>arrow_right.png</file>
<file>dialog_shadow.png</file>
<file>range_handle.png</file>
<file>ico_selectionmode.png</file>
<file>ico_zoom.png</file>
<file>ico_prev.png</file>
<file>ico_next.png</file>
<file>ico_rangeselection.png</file>
<file>ico_rangeselected.png</file>
<file>ico_note.png</file>
<file>ButtonsBar.qml</file>
<file>ico_filter.png</file>
<file>timelineitems.vert</file>
<file>timelineitems.frag</file>
<file>notes.vert</file>
<file>notes.frag</file>
<file>TimelineLabels.qml</file>
<file>TimelineContent.qml</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,45 @@
QT += qml quick
DEFINES += TIMELINE_LIBRARY
include(../../qtcreatorlibrary.pri)
SOURCES += \
$$PWD/timelinemodel.cpp \
$$PWD/timelinemodelaggregator.cpp \
$$PWD/timelinerenderer.cpp \
$$PWD/timelinezoomcontrol.cpp \
$$PWD/timelineitemsrenderpass.cpp \
$$PWD/timelineselectionrenderpass.cpp \
$$PWD/timelinenotesrenderpass.cpp \
$$PWD/timelinerenderpass.cpp \
$$PWD/timelinerenderstate.cpp \
$$PWD/timelinenotesmodel.cpp \
$$PWD/timelineabstractrenderer.cpp \
$$PWD/timelineoverviewrenderer.cpp
HEADERS += \
$$PWD/timeline_global.h \
$$PWD/timelinemodel.h \
$$PWD/timelinemodel_p.h \
$$PWD/timelinemodelaggregator.h \
$$PWD/timelinerenderer.h \
$$PWD/timelinezoomcontrol.h \
$$PWD/timelineitemsrenderpass.h \
$$PWD/timelineselectionrenderpass.h \
$$PWD/timelinenotesrenderpass.h \
$$PWD/timelinerenderpass.h \
$$PWD/timelinerenderstate.h \
$$PWD/timelinenotesmodel.h \
$$PWD/timelinenotesmodel_p.h \
$$PWD/timelinerenderer_p.h \
$$PWD/timelinerenderstate_p.h \
$$PWD/timelineabstractrenderer.h \
$$PWD/timelineabstractrenderer_p.h \
$$PWD/timelineoverviewrenderer_p.h \
$$PWD/timelineoverviewrenderer.h
RESOURCES += \
$$PWD/qml/timeline.qrc
DISTFILES += README

View File

@@ -0,0 +1,37 @@
import qbs 1.0
import QtcLibrary
QtcLibrary {
name: "Timeline"
Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] }
Depends { name: "Utils" }
Group {
name: "General"
files: [
"README",
"timelineabstractrenderer.cpp", "timelineabstractrenderer.h",
"timelineabstractrenderer_p.h",
"timelineitemsrenderpass.cpp", "timelineitemsrenderpass.h",
"timelinemodel.cpp", "timelinemodel.h", "timelinemodel_p.h",
"timelinemodelaggregator.cpp", "timelinemodelaggregator.h",
"timelinenotesmodel.cpp", "timelinenotesmodel.h", "timelinenotesmodel_p.h",
"timelinenotesrenderpass.cpp", "timelinenotesrenderpass.h",
"timelineoverviewrenderer.cpp", "timelineoverviewrenderer.h",
"timelineoverviewrenderer_p.h",
"timelinerenderer.cpp", "timelinerenderer.h", "timelinerenderer_p.h",
"timelinerenderpass.cpp", "timelinerenderpass.h",
"timelinerenderstate.cpp", "timelinerenderstate.h", "timelinerenderstate_p.h",
"timelineselectionrenderpass.cpp", "timelineselectionrenderpass.h",
"timelinezoomcontrol.cpp", "timelinezoomcontrol.h"
]
}
Group {
name: "QML"
prefix: "qml/"
files: ["timeline.qrc"]
}
}

View File

@@ -0,0 +1,4 @@
QTC_LIB_NAME = Timeline
QTC_LIB_DEPENDS = utils

View File

@@ -0,0 +1,43 @@
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef TIMELINE_GLOBAL_H
#define TIMELINE_GLOBAL_H
#include <QtGlobal>
#if defined(TIMELINE_LIBRARY)
# define TIMELINE_EXPORT Q_DECL_EXPORT
#else
# define TIMELINE_EXPORT Q_DECL_IMPORT
#endif
#endif // TIMELINE_GLOBAL_H

View File

@@ -31,21 +31,21 @@
#ifndef TIMELINEABSTRACTRENDERER_H
#define TIMELINEABSTRACTRENDERER_H
#include <QQuickItem>
#include <QSGTransformNode>
#include <QQuickItem>
#include "timelinezoomcontrol.h"
#include "timelinemodel.h"
#include "timelinenotesmodel.h"
#include "timelinerenderpass.h"
#include <QQuickItem>
#include <QSGTransformNode>
#include <QQuickItem>
namespace Timeline {
class TimelineRenderPass;
class TimelineRenderState;
class TimelineAbstractRenderer : public QQuickItem
class TIMELINE_EXPORT TimelineAbstractRenderer : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(Timeline::TimelineModel *model READ model WRITE setModel NOTIFY modelChanged)

View File

@@ -372,9 +372,8 @@ private:
TimelineItemsMaterialShader::TimelineItemsMaterialShader()
: QSGMaterialShader()
{
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qmlprofiler/timelineitems.vert"));
setShaderSourceFile(QOpenGLShader::Fragment,
QStringLiteral(":/qmlprofiler/timelineitems.frag"));
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/timeline/timelineitems.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/timeline/timelineitems.frag"));
}
void TimelineItemsMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial,

View File

@@ -37,7 +37,7 @@
namespace Timeline {
class TimelineItemsRenderPass : public TimelineRenderPass
class TIMELINE_EXPORT TimelineItemsRenderPass : public TimelineRenderPass
{
public:
static const TimelineItemsRenderPass *instance();

View File

@@ -40,7 +40,7 @@
namespace Timeline {
/*!
\class QmlProfiler::TimelineModel
\class Timeline::TimelineModel
\brief The TimelineModel class provides a sorted model for timeline data.
The TimelineModel lets you keep range data sorted by both start and end times, so that

View File

@@ -31,17 +31,14 @@
#ifndef TIMELINEMODEL_H
#define TIMELINEMODEL_H
#include "qmlprofiler_global.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h"
#include "timeline_global.h"
#include "timelinerenderpass.h"
#include <QVariant>
#include <QColor>
namespace Timeline {
class QMLPROFILER_EXPORT TimelineModel : public QObject
class TIMELINE_EXPORT TimelineModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int modelId READ modelId CONSTANT)

View File

@@ -35,7 +35,7 @@
namespace Timeline {
class QMLPROFILER_EXPORT TimelineModel::TimelineModelPrivate {
class TIMELINE_EXPORT TimelineModel::TimelineModelPrivate {
public:
static const int DefaultRowHeight = 30;

View File

@@ -30,10 +30,8 @@
#include "timelinemodelaggregator.h"
#include "qmlprofilerrangemodel.h"
#include "qmlprofileranimationsmodel.h"
#include "qmlprofilerplugin.h"
#include "qmlprofilernotesmodel.h"
#include "timelinemodel.h"
#include "timelinenotesmodel.h"
#include <QStringList>
#include <QVariant>

View File

@@ -31,13 +31,12 @@
#ifndef TIMELINEMODELAGGREGATOR_H
#define TIMELINEMODELAGGREGATOR_H
#include "qmlprofilertimelinemodel.h"
#include "qmlprofilermodelmanager.h"
#include "timelinerenderer.h"
#include "timelinemodel.h"
#include "timelinenotesmodel.h"
namespace Timeline {
class TimelineModelAggregator : public QObject
class TIMELINE_EXPORT TimelineModelAggregator : public QObject
{
Q_OBJECT
Q_PROPERTY(int height READ height NOTIFY heightChanged)

View File

@@ -35,7 +35,7 @@
namespace Timeline {
class QMLPROFILER_EXPORT TimelineNotesModel : public QObject
class TIMELINE_EXPORT TimelineNotesModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY changed)

View File

@@ -30,7 +30,7 @@
#include "timelinenotesrenderpass.h"
#include "timelinerenderstate.h"
#include "qmlprofilernotesmodel.h"
#include "timelinenotesmodel.h"
namespace Timeline {
@@ -222,8 +222,8 @@ private:
NotesMaterialShader::NotesMaterialShader()
: QSGMaterialShader()
{
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qmlprofiler/notes.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qmlprofiler/notes.frag"));
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/timeline/notes.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/timeline/notes.frag"));
}
void NotesMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)

View File

@@ -36,7 +36,7 @@
namespace Timeline {
class TimelineNotesRenderPass : public TimelineRenderPass
class TIMELINE_EXPORT TimelineNotesRenderPass : public TimelineRenderPass
{
public:
static const TimelineNotesRenderPass *instance();

View File

@@ -35,7 +35,7 @@
namespace Timeline {
class TimelineOverviewRenderer : public TimelineAbstractRenderer
class TIMELINE_EXPORT TimelineOverviewRenderer : public TimelineAbstractRenderer
{
public:
TimelineOverviewRenderer(QQuickItem *parent = 0);

View File

@@ -30,9 +30,8 @@
#include "timelinerenderer_p.h"
#include "timelinerenderpass.h"
#include "qmlprofilernotesmodel.h"
#include "timelinenotesmodel.h"
#include "timelineitemsrenderpass.h"
#include "qmlprofilerbindingloopsrenderpass.h"
#include "timelineselectionrenderpass.h"
#include "timelinenotesrenderpass.h"
@@ -41,7 +40,6 @@
#include <QQmlProperty>
#include <QTimer>
#include <QPixmap>
#include <QGraphicsSceneMouseEvent>
#include <QVarLengthArray>
#include <QSGTransformNode>
#include <QSGSimpleRectNode>

View File

@@ -31,19 +31,20 @@
#ifndef TIMELINERENDERER_H
#define TIMELINERENDERER_H
#include <QSGTransformNode>
#include <QQuickItem>
#include "timelinezoomcontrol.h"
#include "timelinemodel.h"
#include "timelinenotesmodel.h"
#include "timelineabstractrenderer.h"
#include <QSGTransformNode>
#include <QQuickItem>
namespace Timeline {
class TimelineRenderPass;
class TimelineRenderState;
class TimelineRenderer : public TimelineAbstractRenderer
class TIMELINE_EXPORT TimelineRenderer : public TimelineAbstractRenderer
{
Q_OBJECT

View File

@@ -31,6 +31,7 @@
#ifndef TIMELINERENDERPASS_H
#define TIMELINERENDERPASS_H
#include "timeline_global.h"
#include <QVector>
QT_FORWARD_DECLARE_CLASS(QSGNode)
@@ -39,9 +40,9 @@ namespace Timeline {
class TimelineAbstractRenderer;
class TimelineRenderState;
class TimelineRenderPass {
class TIMELINE_EXPORT TimelineRenderPass {
public:
class State {
class TIMELINE_EXPORT State {
public:
virtual const QVector<QSGNode *> &expandedRows() const;
virtual const QVector<QSGNode *> &collapsedRows() const;

View File

@@ -37,7 +37,7 @@
namespace Timeline {
class TimelineRenderState {
class TIMELINE_EXPORT TimelineRenderState {
public:
TimelineRenderState(qint64 start, qint64 end, qreal scale, int numPasses);
~TimelineRenderState();

View File

@@ -37,7 +37,7 @@
namespace Timeline {
class TimelineSelectionRenderPass : public TimelineRenderPass
class TIMELINE_EXPORT TimelineSelectionRenderPass : public TimelineRenderPass
{
public:
static const TimelineSelectionRenderPass *instance();

View File

@@ -31,11 +31,12 @@
#ifndef TIMELINEZOOMCONTROL_H
#define TIMELINEZOOMCONTROL_H
#include "timeline_global.h"
#include <QTimer>
namespace Timeline {
class TimelineZoomControl : public QObject {
class TIMELINE_EXPORT TimelineZoomControl : public QObject {
Q_OBJECT
Q_PROPERTY(qint64 traceStart READ traceStart WRITE setTraceStart NOTIFY traceChanged)

View File

@@ -1,41 +1,9 @@
<RCC>
<qresource prefix="/qmlprofiler">
<file>Detail.qml</file>
<file>CategoryLabel.qml</file>
<file>MainView.qml</file>
<file>RangeDetails.qml</file>
<file>RangeMover.qml</file>
<file>TimeDisplay.qml</file>
<file>clean_pane_small.png</file>
<file>recordOff.png</file>
<file>recordOn.png</file>
<file>lock_closed.png</file>
<file>lock_open.png</file>
<file>ico_edit.png</file>
<file>TimeMarks.qml</file>
<file>Overview.qml</file>
<file>SelectionRange.qml</file>
<file>SelectionRangeDetails.qml</file>
<file>arrow_down.png</file>
<file>arrow_right.png</file>
<file>dialog_shadow.png</file>
<file>range_handle.png</file>
<file>ico_selectionmode.png</file>
<file>ico_zoom.png</file>
<file>ico_prev.png</file>
<file>ico_next.png</file>
<file>ico_rangeselection.png</file>
<file>ico_rangeselected.png</file>
<file>ico_note.png</file>
<file>ButtonsBar.qml</file>
<file>ico_filter.png</file>
<file>timelineitems.vert</file>
<file>timelineitems.frag</file>
<file>bindingloops.vert</file>
<file>bindingloops.frag</file>
<file>notes.vert</file>
<file>notes.frag</file>
<file>TimelineLabels.qml</file>
<file>TimelineContent.qml</file>
</qresource>
</RCC>

View File

@@ -9,6 +9,7 @@ SOURCES += \
qmlprofileranimationsmodel.cpp \
qmlprofilerattachdialog.cpp \
qmlprofilerbasemodel.cpp \
qmlprofilerbindingloopsrenderpass.cpp \
qmlprofilerclientmanager.cpp \
qmlprofilerdatamodel.cpp \
qmlprofilerdetailsrewriter.cpp \
@@ -30,20 +31,7 @@ SOURCES += \
qmlprofilertreeview.cpp \
qmlprofilerviewmanager.cpp \
qv8profilerdatamodel.cpp \
qv8profilereventview.cpp \
timelinemodel.cpp \
timelinemodelaggregator.cpp \
timelinerenderer.cpp \
timelinezoomcontrol.cpp \
timelineitemsrenderpass.cpp \
qmlprofilerbindingloopsrenderpass.cpp \
timelineselectionrenderpass.cpp \
timelinenotesrenderpass.cpp \
timelinerenderpass.cpp \
timelinerenderstate.cpp \
timelinenotesmodel.cpp \
timelineabstractrenderer.cpp \
timelineoverviewrenderer.cpp
qv8profilereventview.cpp
HEADERS += \
abstractqmlprofilerrunner.h \
@@ -53,6 +41,7 @@ HEADERS += \
qmlprofilerattachdialog.h \
qmlprofilerbasemodel.h \
qmlprofilerbasemodel_p.h \
qmlprofilerbindingloopsrenderpass.h \
qmlprofilerclientmanager.h \
qmlprofilerconstants.h \
qmlprofilerdatamodel.h \
@@ -75,47 +64,11 @@ HEADERS += \
qmlprofilertreeview.h \
qmlprofilerviewmanager.h \
qv8profilerdatamodel.h \
qv8profilereventview.h \
timelinemodel.h \
timelinemodel_p.h \
timelinemodelaggregator.h \
timelinerenderer.h \
timelinezoomcontrol.h \
timelineitemsrenderpass.h \
qmlprofilerbindingloopsrenderpass.h \
timelineselectionrenderpass.h \
timelinenotesrenderpass.h \
timelinerenderpass.h \
timelinerenderstate.h \
timelinenotesmodel.h \
timelinenotesmodel_p.h \
timelinerenderer_p.h \
timelinerenderstate_p.h \
timelineabstractrenderer.h \
timelineabstractrenderer_p.h \
timelineoverviewrenderer_p.h \
timelineoverviewrenderer.h
qv8profilereventview.h
RESOURCES += \
qml/qmlprofiler.qrc
DISTFILES += \
qml/ButtonsBar.qml \
qml/Detail.qml \
qml/CategoryLabel.qml \
qml/MainView.qml \
qml/RangeDetails.qml \
qml/RangeMover.qml \
qml/TimeDisplay.qml \
qml/TimelineContent.qml \
qml/TimelineLabels.qml \
qml/TimeMarks.qml \
qml/SelectionRange.qml \
qml/SelectionRangeDetails.qml \
qml/Overview.qml \
qml/timelineitems.frag \
qml/timelineitems.vert \
qml/bindingloops.frag \
qml/bindingloops.vert \
qml/notes.frag \
qml/notes.vert
qml/bindingloops.vert

View File

@@ -3,13 +3,13 @@ import qbs 1.0
QtcPlugin {
name: "QmlProfiler"
Depends { name: "Qt"; submodules: ["widgets", "network"] }
Depends { name: "Qt.quick"; condition: product.condition; }
Depends { name: "Qt"; submodules: ["widgets", "network", "quick"] }
Depends { name: "Aggregation" }
Depends { name: "QmlJS" }
Depends { name: "QmlDebug" }
Depends { name: "QtcSsh" }
Depends { name: "Utils" }
Depends { name: "Timeline" }
Depends { name: "Core" }
Depends { name: "AnalyzerBase" }
@@ -50,49 +50,12 @@ QtcPlugin {
"qmlprofilerviewmanager.cpp", "qmlprofilerviewmanager.h",
"qv8profilerdatamodel.cpp", "qv8profilerdatamodel.h",
"qv8profilereventview.h", "qv8profilereventview.cpp",
"timelineabstractrenderer.cpp", "timelineabstractrenderer.h",
"timelineabstractrenderer_p.h",
"timelineitemsrenderpass.cpp", "timelineitemsrenderpass.h",
"timelinemodel.cpp", "timelinemodel.h", "timelinemodel_p.h",
"timelinemodelaggregator.cpp", "timelinemodelaggregator.h",
"timelinenotesmodel.cpp", "timelinenotesmodel.h", "timelinenotesmodel_p.h",
"timelinenotesrenderpass.cpp", "timelinenotesrenderpass.h",
"timelineoverviewrenderer.cpp", "timelineoverviewrenderer.h",
"timelineoverviewrenderer_p.h",
"timelinerenderer.cpp", "timelinerenderer.h", "timelinerenderer_p.h",
"timelinerenderpass.cpp", "timelinerenderpass.h",
"timelinerenderstate.cpp", "timelinerenderstate.h", "timelinerenderstate_p.h",
"timelineselectionrenderpass.cpp", "timelineselectionrenderpass.h",
"timelinezoomcontrol.cpp", "timelinezoomcontrol.h"
]
}
Group {
name: "QML"
prefix: "qml/"
files: [
"ButtonsBar.qml",
"Detail.qml",
"CategoryLabel.qml",
"MainView.qml",
"Overview.qml",
"RangeDetails.qml",
"RangeMover.qml",
"SelectionRange.qml",
"SelectionRangeDetails.qml",
"TimeDisplay.qml",
"TimelineContent.qml",
"TimelineLabels.qml",
"TimeMarks.qml",
"qmlprofiler.qrc",
"bindingloops.frag",
"bindingloops.vert",
"notes.frag",
"notes.vert",
"timelineitems.frag",
"timelineitems.vert"
]
files: ["qmlprofiler.qrc"]
}
}

View File

@@ -5,6 +5,7 @@ QTC_LIB_DEPENDS += \
qmldebug \
qmljs \
ssh \
timeline \
utils
QTC_PLUGIN_DEPENDS += \
analyzerbase \

View File

@@ -308,8 +308,7 @@ BindingLoopMaterialShader::BindingLoopMaterialShader()
: QSGMaterialShader()
{
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qmlprofiler/bindingloops.vert"));
setShaderSourceFile(QOpenGLShader::Fragment,
QStringLiteral(":/qmlprofiler/bindingloops.frag"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qmlprofiler/bindingloops.frag"));
}
void BindingLoopMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *)

View File

@@ -31,9 +31,9 @@
#ifndef QMLPROFILERBINDINGLOOPSRENDERPASS_H
#define QMLPROFILERBINDINGLOOPSRENDERPASS_H
#include "timelineabstractrenderer.h"
#include "timelinerenderpass.h"
#include "timelinerenderstate.h"
#include "timeline/timelineabstractrenderer.h"
#include "timeline/timelinerenderpass.h"
#include "timeline/timelinerenderstate.h"
#include "qmlprofilerrangemodel.h"
#include <QSGMaterial>

View File

@@ -29,6 +29,7 @@
****************************************************************************/
#include "qmlprofilernotesmodel.h"
#include "qmlprofilerdatamodel.h"
namespace QmlProfiler {

View File

@@ -32,7 +32,7 @@
#define QMLPROFILERNOTESMODEL_H
#include "qmlprofilermodelmanager.h"
#include "timelinenotesmodel.h"
#include "timeline/timelinenotesmodel.h"
#include <QList>
#include <QHash>

View File

@@ -32,9 +32,9 @@
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h"
#include "qmlprofilerbindingloopsrenderpass.h"
#include "timelinenotesrenderpass.h"
#include "timelineitemsrenderpass.h"
#include "timelineselectionrenderpass.h"
#include "timeline/timelinenotesrenderpass.h"
#include "timeline/timelineitemsrenderpass.h"
#include "timeline/timelineselectionrenderpass.h"
#include <QCoreApplication>
#include <QVector>

View File

@@ -71,7 +71,7 @@ QmlProfilerStateWidget::QmlProfilerStateWidget(QmlProfilerStateManager *stateMan
QVBoxLayout *layout = new QVBoxLayout(this);
resize(200,70);
d->shadowPic.load(QLatin1String(":/qmlprofiler/dialog_shadow.png"));
d->shadowPic.load(QLatin1String(":/timeline/dialog_shadow.png"));
d->text = new QLabel(this);
d->text->setAlignment(Qt::AlignCenter);

View File

@@ -31,7 +31,10 @@
#ifndef QMLPROFILERTIMELINEMODEL_H
#define QMLPROFILERTIMELINEMODEL_H
#include "timelinemodel.h"
#include "qmlprofiler_global.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h"
#include "timeline/timelinemodel.h"
namespace QmlProfiler {

View File

@@ -37,7 +37,6 @@
#include "qmlprofilerclientmanager.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdetailsrewriter.h"
#include "timelinerenderer.h"
#include "qmlprofilernotesmodel.h"
#include <analyzerbase/analyzermanager.h>

View File

@@ -32,19 +32,21 @@
#include "qmlprofilertool.h"
#include "qmlprofilerstatemanager.h"
#include "qmlprofilermodelmanager.h"
#include "timelinemodelaggregator.h"
#include "qmlprofilernotesmodel.h"
#include "qmlprofileranimationsmodel.h"
#include "qmlprofilerrangemodel.h"
#include "qmlprofilerplugin.h"
#include "timelineoverviewrenderer.h"
// Needed for the load&save actions in the context menu
#include <analyzerbase/ianalyzertool.h>
// Communication with the other views (limit events to range)
#include "qmlprofilerviewmanager.h"
#include "timelinezoomcontrol.h"
#include "timeline/timelinezoomcontrol.h"
#include "timeline/timelinemodelaggregator.h"
#include "timeline/timelinerenderer.h"
#include "timeline/timelineoverviewrenderer.h"
// Needed for the load&save actions in the context menu
#include <analyzerbase/ianalyzertool.h>
#include <utils/styledbar.h>
@@ -148,7 +150,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
d->m_modelProxy);
d->m_mainView->rootContext()->setContextProperty(QLatin1String("zoomControl"),
d->m_zoomControl);
d->m_mainView->setSource(QUrl(QLatin1String("qrc:/qmlprofiler/MainView.qml")));
d->m_mainView->setSource(QUrl(QLatin1String("qrc:/timeline/MainView.qml")));
QQuickItem *rootObject = d->m_mainView->rootObject();
connect(rootObject, SIGNAL(updateCursorPosition()), this, SLOT(updateCursorPosition()));

View File

@@ -20,5 +20,5 @@ SUBDIRS += \
valgrind
qtHaveModule(declarative) {
SUBDIRS += qml qmlprofiler
SUBDIRS += qml timeline
}

View File

@@ -18,6 +18,7 @@ Project {
"profilewriter/profilewriter.qbs",
"qml/qml.qbs",
"qtcprocess/qtcprocess.qbs",
"timeline/timeline.qbs",
"treeviewfind/treeviewfind.qbs",
"utils/utils.qbs",
"utils_stringutils/utils_stringutils.qbs",

View File

@@ -0,0 +1,11 @@
import qbs
Project {
name: "Timeline autotests"
property path timelineDir: project.ide_source_tree
+ "/src/libs/timeline"
references: [
"timelinemodel/timelinemodel.qbs"
]
}

View File

@@ -1,4 +1,4 @@
QTC_PLUGIN_DEPENDS += qmlprofiler
QTC_LIB_DEPENDS += timeline
include(../../qttest.pri)
SOURCES += \

View File

@@ -0,0 +1,14 @@
import qbs
QtcAutotest {
Depends { name: "Timeline" }
Depends { name: "Qt.gui" }
name: "Timeline Model autotest"
Group {
name: "Test sources"
files: [
"tst_timelinemodel.cpp"
]
}
}

View File

@@ -29,9 +29,8 @@
****************************************************************************/
#include <QtTest>
#include <qmlprofiler/timelinemodel.h>
using namespace Timeline;
#include <QColor>
#include <timeline/timelinemodel.h>
static const int DefaultRowHeight = 30;
static const int NumItems = 10;
@@ -39,7 +38,7 @@ static const qint64 ItemDuration = 1 << 19;
static const qint64 ItemSpacing = 1 << 20;
class DummyModelPrivate;
class DummyModel : public TimelineModel
class DummyModel : public Timeline::TimelineModel
{
Q_OBJECT
friend class tst_TimelineModel;