Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
0a3b20f5
Commit
0a3b20f5
authored
Aug 08, 2013
by
Christiaan Janssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QmlProfiler: reworked
Change-Id: I66a236a024d76e7bef6edfb91ae30b5dd098b76b Reviewed-by:
Kai Koehne
<
kai.koehne@digia.com
>
parent
7764f351
Changes
61
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
7923 additions
and
2935 deletions
+7923
-2935
src/libs/qmldebug/qmldebug.qbs
src/libs/qmldebug/qmldebug.qbs
+1
-0
src/libs/qmldebug/qmlprofilereventtypes.h
src/libs/qmldebug/qmlprofilereventtypes.h
+4
-0
src/libs/qmldebug/qmlprofilertraceclient.cpp
src/libs/qmldebug/qmlprofilertraceclient.cpp
+32
-2
src/libs/qmldebug/qmlprofilertraceclient.h
src/libs/qmldebug/qmlprofilertraceclient.h
+16
-4
src/plugins/qmlprofiler/abstracttimelinemodel.cpp
src/plugins/qmlprofiler/abstracttimelinemodel.cpp
+82
-0
src/plugins/qmlprofiler/abstracttimelinemodel.h
src/plugins/qmlprofiler/abstracttimelinemodel.h
+113
-0
src/plugins/qmlprofiler/qml/Detail.qml
src/plugins/qmlprofiler/qml/Detail.qml
+0
-2
src/plugins/qmlprofiler/qml/Label.qml
src/plugins/qmlprofiler/qml/Label.qml
+28
-30
src/plugins/qmlprofiler/qml/MainView.qml
src/plugins/qmlprofiler/qml/MainView.qml
+79
-78
src/plugins/qmlprofiler/qml/Overview.js
src/plugins/qmlprofiler/qml/Overview.js
+52
-59
src/plugins/qmlprofiler/qml/Overview.qml
src/plugins/qmlprofiler/qml/Overview.qml
+15
-16
src/plugins/qmlprofiler/qml/RangeDetails.qml
src/plugins/qmlprofiler/qml/RangeDetails.qml
+39
-37
src/plugins/qmlprofiler/qml/SelectionRange.qml
src/plugins/qmlprofiler/qml/SelectionRange.qml
+1
-1
src/plugins/qmlprofiler/qml/TimeMarks.qml
src/plugins/qmlprofiler/qml/TimeMarks.qml
+21
-14
src/plugins/qmlprofiler/qmlprofiler.pro
src/plugins/qmlprofiler/qmlprofiler.pro
+24
-4
src/plugins/qmlprofiler/qmlprofiler.qbs
src/plugins/qmlprofiler/qmlprofiler.qbs
+22
-2
src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
+44
-22
src/plugins/qmlprofiler/qmlprofilerclientmanager.h
src/plugins/qmlprofiler/qmlprofilerclientmanager.h
+8
-13
src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp
src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp
+0
-1685
src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp
src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp
+11
-6
src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h
src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h
+6
-4
src/plugins/qmlprofiler/qmlprofilerengine.cpp
src/plugins/qmlprofiler/qmlprofilerengine.cpp
+1
-1
src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp
src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp
+479
-0
src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h
src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.h
+172
-0
src/plugins/qmlprofiler/qmlprofilereventview.cpp
src/plugins/qmlprofiler/qmlprofilereventview.cpp
+228
-429
src/plugins/qmlprofiler/qmlprofilereventview.h
src/plugins/qmlprofiler/qmlprofilereventview.h
+29
-67
src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+364
-0
src/plugins/qmlprofiler/qmlprofilermodelmanager.h
src/plugins/qmlprofiler/qmlprofilermodelmanager.h
+159
-0
src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp
src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp
+458
-0
src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h
src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.h
+123
-0
src/plugins/qmlprofiler/qmlprofilerplugin.cpp
src/plugins/qmlprofiler/qmlprofilerplugin.cpp
+10
-4
src/plugins/qmlprofiler/qmlprofilerplugin.h
src/plugins/qmlprofiler/qmlprofilerplugin.h
+10
-0
src/plugins/qmlprofiler/qmlprofilerprocessedmodel.cpp
src/plugins/qmlprofiler/qmlprofilerprocessedmodel.cpp
+182
-0
src/plugins/qmlprofiler/qmlprofilerprocessedmodel.h
src/plugins/qmlprofiler/qmlprofilerprocessedmodel.h
+62
-0
src/plugins/qmlprofiler/qmlprofilersimplemodel.cpp
src/plugins/qmlprofiler/qmlprofilersimplemodel.cpp
+114
-0
src/plugins/qmlprofiler/qmlprofilersimplemodel.h
src/plugins/qmlprofiler/qmlprofilersimplemodel.h
+88
-0
src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp
src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp
+56
-44
src/plugins/qmlprofiler/qmlprofilerstatemanager.h
src/plugins/qmlprofiler/qmlprofilerstatemanager.h
+8
-10
src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp
src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp
+25
-18
src/plugins/qmlprofiler/qmlprofilerstatewidget.h
src/plugins/qmlprofiler/qmlprofilerstatewidget.h
+5
-2
src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
+721
-0
src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h
src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.h
+146
-0
src/plugins/qmlprofiler/qmlprofilertool.cpp
src/plugins/qmlprofiler/qmlprofilertool.cpp
+28
-45
src/plugins/qmlprofiler/qmlprofilertracefile.cpp
src/plugins/qmlprofiler/qmlprofilertracefile.cpp
+562
-0
src/plugins/qmlprofiler/qmlprofilertracefile.h
src/plugins/qmlprofiler/qmlprofilertracefile.h
+134
-0
src/plugins/qmlprofiler/qmlprofilertraceview.cpp
src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+47
-34
src/plugins/qmlprofiler/qmlprofilertraceview.h
src/plugins/qmlprofiler/qmlprofilertraceview.h
+6
-3
src/plugins/qmlprofiler/qmlprofilertreeview.cpp
src/plugins/qmlprofiler/qmlprofilertreeview.cpp
+91
-0
src/plugins/qmlprofiler/qmlprofilertreeview.h
src/plugins/qmlprofiler/qmlprofilertreeview.h
+72
-0
src/plugins/qmlprofiler/qmlprofilerv8eventsview.cpp
src/plugins/qmlprofiler/qmlprofilerv8eventsview.cpp
+1016
-0
src/plugins/qmlprofiler/qmlprofilerv8eventsview.h
src/plugins/qmlprofiler/qmlprofilerv8eventsview.h
+202
-0
src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
+27
-23
src/plugins/qmlprofiler/qmlprofilerviewmanager.h
src/plugins/qmlprofiler/qmlprofilerviewmanager.h
+3
-2
src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
src/plugins/qmlprofiler/qv8profilerdatamodel.cpp
+31
-31
src/plugins/qmlprofiler/qv8profilerdatamodel.h
src/plugins/qmlprofiler/qv8profilerdatamodel.h
+7
-3
src/plugins/qmlprofiler/qv8profilereventview.cpp
src/plugins/qmlprofiler/qv8profilereventview.cpp
+725
-0
src/plugins/qmlprofiler/qv8profilereventview.h
src/plugins/qmlprofiler/qv8profilereventview.h
+163
-0
src/plugins/qmlprofiler/timelinemodelaggregator.cpp
src/plugins/qmlprofiler/timelinemodelaggregator.cpp
+373
-0
src/plugins/qmlprofiler/timelinemodelaggregator.h
src/plugins/qmlprofiler/timelinemodelaggregator.h
+122
-0
src/plugins/qmlprofiler/timelinerenderer.cpp
src/plugins/qmlprofiler/timelinerenderer.cpp
+239
-207
src/plugins/qmlprofiler/timelinerenderer.h
src/plugins/qmlprofiler/timelinerenderer.h
+37
-33
No files found.
src/libs/qmldebug/qmldebug.qbs
View file @
0a3b20f5
...
@@ -6,6 +6,7 @@ QtcLibrary {
...
@@ -6,6 +6,7 @@ QtcLibrary {
cpp.defines: base.concat("QMLDEBUG_LIB")
cpp.defines: base.concat("QMLDEBUG_LIB")
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["gui", "network"] }
Depends { name: "Qt"; submodules: ["gui", "network"] }
files: [
files: [
...
...
src/libs/qmldebug/qmlprofilereventtypes.h
View file @
0a3b20f5
...
@@ -38,6 +38,8 @@ enum QmlEventType {
...
@@ -38,6 +38,8 @@ enum QmlEventType {
Creating
,
Creating
,
Binding
,
Binding
,
HandlingSignal
,
HandlingSignal
,
PixmapCacheEvent
,
SceneGraphFrameEvent
,
MaximumQmlEventType
MaximumQmlEventType
};
};
...
@@ -46,6 +48,8 @@ enum BindingType {
...
@@ -46,6 +48,8 @@ enum BindingType {
QmlBinding
,
QmlBinding
,
V8Binding
,
V8Binding
,
OptimizedBinding
,
OptimizedBinding
,
QPainterEvent
,
AnimationFrame
,
MaximumBindingType
MaximumBindingType
};
};
...
...
src/libs/qmldebug/qmlprofilertraceclient.cpp
View file @
0a3b20f5
...
@@ -170,7 +170,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
...
@@ -170,7 +170,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
}
else
if
(
event
==
AnimationFrame
)
{
}
else
if
(
event
==
AnimationFrame
)
{
int
frameRate
,
animationCount
;
int
frameRate
,
animationCount
;
stream
>>
frameRate
>>
animationCount
;
stream
>>
frameRate
>>
animationCount
;
emit
this
->
frame
(
time
,
frameRate
,
animationCount
);
emit
rangedEvent
(
QmlDebug
::
Painting
,
QmlDebug
::
AnimationFrame
,
time
,
0
,
QStringList
(),
QmlDebug
::
QmlEventLocation
(),
frameRate
,
animationCount
,
0
,
0
,
0
);
d
->
maximumTime
=
qMax
(
time
,
d
->
maximumTime
);
d
->
maximumTime
=
qMax
(
time
,
d
->
maximumTime
);
}
else
if
(
event
==
StartTrace
)
{
}
else
if
(
event
==
StartTrace
)
{
emit
this
->
traceStarted
(
time
);
emit
this
->
traceStarted
(
time
);
...
@@ -181,6 +182,32 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
...
@@ -181,6 +182,32 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
}
}
}
else
if
(
messageType
==
Complete
)
{
}
else
if
(
messageType
==
Complete
)
{
emit
complete
();
emit
complete
();
}
else
if
(
messageType
==
SceneGraphFrame
)
{
int
sgEventType
;
int
count
=
0
;
qint64
params
[
5
];
stream
>>
sgEventType
;
while
(
!
stream
.
atEnd
())
{
stream
>>
params
[
count
++
];
}
while
(
count
<
5
)
params
[
count
++
]
=
0
;
emit
rangedEvent
(
SceneGraphFrameEvent
,
sgEventType
,
time
,
0
,
QStringList
(),
QmlDebug
::
QmlEventLocation
(),
params
[
0
],
params
[
1
],
params
[
2
],
params
[
3
],
params
[
4
]);
}
else
if
(
messageType
==
PixmapCacheEvent
)
{
int
pixEvTy
,
width
=
0
,
height
=
0
,
refcount
=
0
;
QString
pixUrl
;
stream
>>
pixEvTy
>>
pixUrl
;
if
(
pixEvTy
==
(
int
)
PixmapReferenceCountChanged
||
pixEvTy
==
(
int
)
PixmapCacheCountChanged
)
{
stream
>>
refcount
;
}
else
if
(
pixEvTy
==
(
int
)
PixmapSizeKnown
)
{
stream
>>
width
>>
height
;
refcount
=
1
;
}
emit
rangedEvent
(
QmlDebug
::
PixmapCacheEvent
,
pixEvTy
,
time
,
0
,
QStringList
(),
QmlDebug
::
QmlEventLocation
(
pixUrl
,
0
,
0
),
width
,
height
,
refcount
,
0
,
0
);
d
->
maximumTime
=
qMax
(
time
,
d
->
maximumTime
);
}
else
{
}
else
{
int
range
;
int
range
;
stream
>>
range
;
stream
>>
range
;
...
@@ -240,7 +267,10 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
...
@@ -240,7 +267,10 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
BindingType
bindingType
=
QmlBinding
;
BindingType
bindingType
=
QmlBinding
;
if
((
QmlEventType
)
range
==
Binding
)
if
((
QmlEventType
)
range
==
Binding
)
bindingType
=
d
->
bindingTypes
.
pop
();
bindingType
=
d
->
bindingTypes
.
pop
();
emit
this
->
range
((
QmlEventType
)
range
,
bindingType
,
startTime
,
time
-
startTime
,
data
,
location
);
if
((
QmlEventType
)
range
==
Painting
)
bindingType
=
QPainterEvent
;
emit
rangedEvent
((
QmlEventType
)
range
,
bindingType
,
startTime
,
time
-
startTime
,
data
,
location
,
0
,
0
,
0
,
0
,
0
);
if
(
d
->
rangeCount
[
range
]
==
0
)
{
if
(
d
->
rangeCount
[
range
]
==
0
)
{
int
count
=
d
->
rangeDatas
[
range
].
count
()
+
int
count
=
d
->
rangeDatas
[
range
].
count
()
+
d
->
rangeStartTimes
[
range
].
count
()
+
d
->
rangeStartTimes
[
range
].
count
()
+
...
...
src/libs/qmldebug/qmlprofilertraceclient.h
View file @
0a3b20f5
...
@@ -71,10 +71,23 @@ public:
...
@@ -71,10 +71,23 @@ public:
RangeLocation
,
RangeLocation
,
RangeEnd
,
RangeEnd
,
Complete
,
Complete
,
PixmapCacheEvent
,
SceneGraphFrame
,
MaximumMessage
MaximumMessage
};
};
enum
PixmapEventType
{
PixmapSizeKnown
,
PixmapReferenceCountChanged
,
PixmapCacheCountChanged
,
PixmapLoadingStarted
,
PixmapLoadingFinished
,
PixmapLoadingError
,
MaximumPixmapEventType
};
bool
isEnabled
()
const
;
bool
isEnabled
()
const
;
bool
isRecording
()
const
;
bool
isRecording
()
const
;
void
setRecording
(
bool
);
void
setRecording
(
bool
);
...
@@ -89,10 +102,9 @@ signals:
...
@@ -89,10 +102,9 @@ signals:
void
event
(
int
event
,
qint64
time
);
void
event
(
int
event
,
qint64
time
);
void
traceFinished
(
qint64
time
);
void
traceFinished
(
qint64
time
);
void
traceStarted
(
qint64
time
);
void
traceStarted
(
qint64
time
);
void
range
(
int
type
,
int
bindingType
,
qint64
startTime
,
qint64
length
,
void
rangedEvent
(
int
type
,
int
bindingType
,
qint64
startTime
,
qint64
length
,
const
QStringList
&
data
,
const
QmlDebug
::
QmlEventLocation
&
location
);
const
QStringList
&
data
,
const
QmlDebug
::
QmlEventLocation
&
location
,
void
frame
(
qint64
time
,
int
frameRate
,
int
animationCount
);
qint64
param1
,
qint64
param2
,
qint64
param3
,
qint64
param4
,
qint64
param5
);
void
recordingChanged
(
bool
arg
);
void
recordingChanged
(
bool
arg
);
void
enabledChanged
();
void
enabledChanged
();
...
...
src/plugins/qmlprofiler/abstracttimelinemodel.cpp
0 → 100644
View file @
0a3b20f5
/****************************************************************************
**
** Copyright (C) 2013 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://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: 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.
**
****************************************************************************/
#include "abstracttimelinemodel.h"
namespace
QmlProfiler
{
AbstractTimelineModel
::
AbstractTimelineModel
(
QObject
*
parent
)
:
QObject
(
parent
),
m_modelManager
(
0
)
{}
AbstractTimelineModel
::~
AbstractTimelineModel
()
{}
void
AbstractTimelineModel
::
setModelManager
(
QmlProfilerModelManager
*
modelManager
)
{
m_modelManager
=
modelManager
;
connect
(
modelManager
->
simpleModel
(),
SIGNAL
(
changed
()),
this
,
SLOT
(
dataChanged
()));
m_modelId
=
modelManager
->
registerModelProxy
();
}
qint64
AbstractTimelineModel
::
traceStartTime
()
const
{
return
m_modelManager
->
traceTime
()
->
startTime
();
}
qint64
AbstractTimelineModel
::
traceEndTime
()
const
{
return
m_modelManager
->
traceTime
()
->
endTime
();
}
qint64
AbstractTimelineModel
::
traceDuration
()
const
{
return
m_modelManager
->
traceTime
()
->
duration
();
}
int
AbstractTimelineModel
::
getState
()
const
{
return
(
int
)
m_modelManager
->
state
();
}
int
AbstractTimelineModel
::
rowCount
()
const
{
int
count
=
0
;
for
(
int
i
=
0
;
i
<
categoryCount
();
i
++
)
count
+=
categoryDepth
(
i
);
return
count
;
}
int
AbstractTimelineModel
::
getBindingLoopDest
(
int
index
)
const
{
Q_UNUSED
(
index
);
return
-
1
;
}
}
src/plugins/qmlprofiler/abstracttimelinemodel.h
0 → 100644
View file @
0a3b20f5
/****************************************************************************
**
** Copyright (C) 2013 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://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: 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 ABSTRACTTIMELINEMODEL_H
#define ABSTRACTTIMELINEMODEL_H
#include "qmlprofiler_global.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilersimplemodel.h"
#include <QObject>
#include <QVariant>
#include <QColor>
namespace
QmlProfiler
{
class
QMLPROFILER_EXPORT
AbstractTimelineModel
:
public
QObject
{
Q_OBJECT
public:
explicit
AbstractTimelineModel
(
QObject
*
parent
=
0
);
~
AbstractTimelineModel
();
void
setModelManager
(
QmlProfilerModelManager
*
modelManager
);
virtual
int
categories
()
const
=
0
;
virtual
QStringList
categoryTitles
()
const
=
0
;
virtual
QString
name
()
const
=
0
;
virtual
int
count
()
const
=
0
;
virtual
bool
isEmpty
()
const
=
0
;
virtual
bool
eventAccepted
(
const
QmlProfilerSimpleModel
::
QmlEventData
&
event
)
const
=
0
;
Q_INVOKABLE
virtual
qint64
lastTimeMark
()
const
=
0
;
Q_INVOKABLE
qint64
traceStartTime
()
const
;
Q_INVOKABLE
qint64
traceEndTime
()
const
;
Q_INVOKABLE
qint64
traceDuration
()
const
;
Q_INVOKABLE
int
getState
()
const
;
Q_INVOKABLE
virtual
bool
expanded
(
int
category
)
const
=
0
;
Q_INVOKABLE
virtual
void
setExpanded
(
int
category
,
bool
expanded
)
=
0
;
Q_INVOKABLE
virtual
int
categoryDepth
(
int
categoryIndex
)
const
=
0
;
Q_INVOKABLE
virtual
int
categoryCount
()
const
=
0
;
Q_INVOKABLE
virtual
int
rowCount
()
const
;
Q_INVOKABLE
virtual
const
QString
categoryLabel
(
int
categoryIndex
)
const
=
0
;
virtual
int
findFirstIndex
(
qint64
startTime
)
const
=
0
;
virtual
int
findFirstIndexNoParents
(
qint64
startTime
)
const
=
0
;
virtual
int
findLastIndex
(
qint64
endTime
)
const
=
0
;
virtual
int
getEventType
(
int
index
)
const
=
0
;
virtual
int
getEventCategory
(
int
index
)
const
=
0
;
virtual
int
getEventRow
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
qint64
getDuration
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
qint64
getStartTime
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
qint64
getEndTime
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
int
getEventId
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
int
getBindingLoopDest
(
int
index
)
const
;
Q_INVOKABLE
virtual
QColor
getColor
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
float
getHeight
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
const
QVariantList
getLabelsForCategory
(
int
category
)
const
=
0
;
Q_INVOKABLE
virtual
const
QVariantList
getEventDetails
(
int
index
)
const
=
0
;
// returned map should contain "file", "line", "column" properties, or be empty
Q_INVOKABLE
virtual
const
QVariantMap
getEventLocation
(
int
index
)
const
=
0
;
Q_INVOKABLE
virtual
int
getEventIdForHash
(
const
QString
&
eventHash
)
const
=
0
;
Q_INVOKABLE
virtual
int
getEventIdForLocation
(
const
QString
&
filename
,
int
line
,
int
column
)
const
=
0
;
signals:
void
countChanged
();
void
dataAvailable
();
void
stateChanged
();
void
emptyChanged
();
void
expandedChanged
();
protected:
QmlProfilerModelManager
*
m_modelManager
;
int
m_modelId
;
};
}
#endif // ABSTRACTTIMELINEMODEL_H
src/plugins/qmlprofiler/qml/Detail.qml
View file @
0a3b20f5
...
@@ -34,7 +34,6 @@ Item {
...
@@ -34,7 +34,6 @@ Item {
id
:
detail
id
:
detail
property
string
label
property
string
label
property
string
content
property
string
content
signal
linkActivated
(
string
url
)
height
:
childrenRect
.
height
+
2
height
:
childrenRect
.
height
+
2
width
:
childrenRect
.
width
width
:
childrenRect
.
width
...
@@ -55,7 +54,6 @@ Item {
...
@@ -55,7 +54,6 @@ Item {
font.pixelSize
:
12
font.pixelSize
:
12
anchors.baseline
:
lbl
.
baseline
anchors.baseline
:
lbl
.
baseline
anchors.left
:
guideline
.
right
anchors.left
:
guideline
.
right
onLinkActivated
:
detail
.
linkActivated
(
link
)
textFormat
:
Text
.
PlainText
textFormat
:
Text
.
PlainText
}
}
}
}
src/plugins/qmlprofiler/qml/Label.qml
View file @
0a3b20f5
...
@@ -31,23 +31,24 @@ import QtQuick 1.0
...
@@ -31,23 +31,24 @@ import QtQuick 1.0
Item
{
Item
{
id
:
labelContainer
id
:
labelContainer
property
alias
text
:
txt
.
text
property
string
text
:
qmlProfilerModelProxy
.
categoryLabel
(
modelIndex
,
categoryIndex
)
property
bool
expanded
:
false
property
bool
expanded
:
false
property
int
typeIndex
:
index
property
int
categoryIndex
:
qmlProfilerModelProxy
.
correctedCategoryIndexForModel
(
modelIndex
,
index
)
property
int
modelIndex
:
qmlProfilerModelProxy
.
modelIndexForCategory
(
index
);
property
variant
descriptions
:
[]
property
variant
descriptions
:
[]
property
variant
extdescriptions
:
[]
property
variant
extdescriptions
:
[]
property
variant
eventIds
:
[]
property
variant
eventIds
:
[]
visible
:
qmlProfilerModelProxy
.
categoryDepth
(
modelIndex
,
categoryIndex
)
>
0
;
height
:
root
.
singleRowHeight
height
:
root
.
singleRowHeight
width
:
150
width
:
150
onExpandedChanged
:
{
onExpandedChanged
:
{
var
rE
=
labels
.
rowExpanded
;
qmlProfilerModelProxy
.
setExpanded
(
modelIndex
,
categoryIndex
,
expanded
);
rE
[
typeIndex
]
=
expanded
;
labels
.
rowExpanded
=
rE
;
backgroundMarks
.
requestRedraw
();
backgroundMarks
.
requestRedraw
();
view
.
setRowExpanded
(
typeIndex
,
expanded
);
getDescriptions
(
);
updateHeight
();
updateHeight
();
}
}
...
@@ -56,20 +57,24 @@ Item {
...
@@ -56,20 +57,24 @@ Item {
}
}
function
updateHeight
()
{
function
updateHeight
()
{
height
=
root
.
singleRowHeight
*
(
1
+
if
(
expanded
!=
qmlProfilerModelProxy
.
expanded
(
modelIndex
,
categoryIndex
))
(
expanded
?
qmlProfiler
Data
Model
.
uniqueEventsOfType
(
type
Index
)
:
expanded
=
qmlProfilerModel
Proxy
.
expanded
(
modelIndex
,
category
Index
)
;
qmlProfiler
Data
Model
.
maxNestingForType
(
type
Index
)
))
;
height
=
root
.
singleRowHeight
*
qmlProfilerModel
Proxy
.
categoryDepth
(
modelIndex
,
category
Index
);
}
}
function
getDescriptions
()
{
function
getDescriptions
()
{
visible
=
qmlProfilerModelProxy
.
categoryDepth
(
modelIndex
,
categoryIndex
)
>
0
;
if
(
!
visible
)
return
;
var
desc
=
[];
var
desc
=
[];
var
ids
=
[];
var
ids
=
[];
var
extdesc
=
[];
var
extdesc
=
[];
for
(
var
i
=
0
;
i
<
qmlProfiler
Data
Model
.
uniqueEventsOfType
(
typeIndex
);
i
++
)
{
var
labelList
=
qmlProfilerModel
Proxy
.
getLabelsForCategory
(
modelIndex
,
categoryIndex
);
desc
[
i
]
=
qmlProfilerDataModel
.
eventTextForType
(
typeIndex
,
i
);
for
(
var
i
=
0
;
i
<
labelList
.
length
;
i
++
)
{
ids
[
i
]
=
qmlProfilerDataModel
.
eventIdForType
(
typeIndex
,
i
)
;
desc
[
i
]
=
labelList
[
i
].
description
;
extdesc
[
i
]
=
qmlProfilerDataModel
.
eventDisplayNameForType
(
typeIndex
,
i
)
+
ids
[
i
]
=
labelList
[
i
].
id
;
"
:
"
+
desc
[
i
]
;
extdesc
[
i
]
=
labelList
[
i
].
displayName
+
"
:
"
+
labelList
[
i
].
description
;
}
}
descriptions
=
desc
;
descriptions
=
desc
;
eventIds
=
ids
;
eventIds
=
ids
;
...
@@ -78,20 +83,13 @@ Item {
...
@@ -78,20 +83,13 @@ Item {
}
}
Connections
{
Connections
{
target
:
qmlProfilerDataModel
target
:
qmlProfilerModelProxy
onReloadDetailLabels
:
getDescriptions
();
onExpandedChanged
:
{
updateHeight
();
}
onStateChanged
:
{
onStateChanged
:
{
// Empty
getDescriptions
();
if
(
qmlProfilerDataModel
.
getCurrentStateFromQml
()
==
0
)
{
descriptions
=
[];
eventIds
=
[];
extdescriptions
=
[];
updateHeight
();
}
else
// Done
if
(
qmlProfilerDataModel
.
getCurrentStateFromQml
()
==
3
)
{
getDescriptions
();
}
}
}
}
}
...
@@ -99,6 +97,7 @@ Item {
...
@@ -99,6 +97,7 @@ Item {
id
:
txt
id
:
txt
x
:
5
x
:
5
font.pixelSize
:
12
font.pixelSize
:
12
text
:
labelContainer
.
text
color
:
"
#232323
"
color
:
"
#232323
"
height
:
root
.
singleRowHeight
height
:
root
.
singleRowHeight
width
:
140
width
:
140
...
@@ -140,9 +139,9 @@ Item {
...
@@ -140,9 +139,9 @@ Item {
onExited
:
changeToolTip
(
""
);
onExited
:
changeToolTip
(
""
);
onClicked
:
{
onClicked
:
{
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
view
.
selectPrevFromId
(
eventIds
[
index
]);
view
.
selectPrevFromId
(
modelIndex
,
eventIds
[
index
]);
else
else
view
.
selectNextFromId
(
eventIds
[
index
]);
view
.
selectNextFromId
(
modelIndex
,
eventIds
[
index
]);
}
}
}
}
}
}
...
@@ -150,7 +149,6 @@ Item {
...
@@ -150,7 +149,6 @@ Item {
}
}
Image
{
Image
{
visible
:
descriptions
.
length
>
0
source
:
expanded
?
"
arrow_down.png
"
:
"
arrow_right.png
"
source
:
expanded
?
"
arrow_down.png
"
:
"
arrow_right.png
"
x
:
parent
.
width
-
12
x
:
parent
.
width
-
12
y
:
root
.
singleRowHeight
/
2
-
height
/
2
y
:
root
.
singleRowHeight
/
2
-
height
/
2
...
...
src/plugins/qmlprofiler/qml/MainView.qml
View file @
0a3b20f5
...
@@ -51,14 +51,6 @@ Rectangle {
...
@@ -51,14 +51,6 @@ Rectangle {
signal
selectedEventChanged
(
int
eventId
)
signal
selectedEventChanged
(
int
eventId
)
property
bool
lockItemSelection
:
false
property
bool
lockItemSelection
:
false
property
variant
names
:
[
qsTr
(
"
Painting
"
),
qsTr
(
"
Compiling
"
),
qsTr
(
"
Creating
"
),
qsTr
(
"
Binding
"
),
qsTr
(
"
Handling Signal
"
)]
property
variant
colors
:
[
"
#99CCB3
"
,
"
#99CCCC
"
,
"
#99B3CC
"
,
"
#9999CC
"
,
"
#CC99B3
"
,
"
#CC99CC
"
,
"
#CCCC99
"
,
"
#CCB399
"
]
property
variant
mainviewTimePerPixel
:
0
property
variant
mainviewTimePerPixel
:
0
signal
updateCursorPosition
signal
updateCursorPosition
...
@@ -95,7 +87,7 @@ Rectangle {
...
@@ -95,7 +87,7 @@ Rectangle {
backgroundMarks
.
updateMarks
(
startTime
,
endTime
);
backgroundMarks
.
updateMarks
(
startTime
,
endTime
);
view
.
updateFlickRange
(
startTime
,
endTime
);
view
.
updateFlickRange
(
startTime
,
endTime
);
if
(
duration
>
0
)
{
if
(
duration
>
0
)
{
var
candidateWidth
=
qmlProfiler
Data
Model
.
traceDuration
()
*
var
candidateWidth
=
qmlProfilerModel
Proxy
.
traceDuration
()
*
flick
.
width
/
duration
;
flick
.
width
/
duration
;
if
(
flick
.
contentWidth
!==
candidateWidth
)
if
(
flick
.
contentWidth
!==
candidateWidth
)
flick
.
contentWidth
=
candidateWidth
;
flick
<