1
/****************************************************************************
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of Qt Creator.
8
** Commercial License Usage
9
** Licensees holding valid commercial Qt licenses may use this file in
10
** accordance with the commercial license agreement provided with the
11
** Software or, alternatively, in accordance with the terms contained in
12
** a written agreement between you and Digia. For licensing terms and
13
** conditions see http://qt.digia.com/licensing. For further information
14
** use the contact form at http://qt.digia.com/contact-us.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Digia gives you certain additional
25
** rights. These rights are described in the Digia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
****************************************************************************/
34
property string text: qmlProfilerModelProxy.categoryLabel(modelIndex, categoryIndex)
35
property bool expanded: false
36
property int categoryIndex: qmlProfilerModelProxy.correctedCategoryIndexForModel(modelIndex, index)
37
property int modelIndex: qmlProfilerModelProxy.modelIndexForCategory(index);
39
property var descriptions: []
40
property var extdescriptions: []
41
property var eventIds: []
43
visible: qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex) > 0;
45
height: root.singleRowHeight
49
qmlProfilerModelProxy.setExpanded(modelIndex, categoryIndex, expanded);
50
backgroundMarks.requestRedraw();
55
Component.onCompleted: {
59
function updateHeight() {
60
if (expanded != qmlProfilerModelProxy.expanded(modelIndex, categoryIndex))
61
expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex);
62
height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex);
65
function getDescriptions() {
66
visible = qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex) > 0;
73
var labelList = qmlProfilerModelProxy.getLabelsForCategory(modelIndex, categoryIndex);
74
for (var i = 0; i < labelList.length; i++ ) {
75
desc[i] = labelList[i].description;
76
ids[i] = labelList[i].id;
77
extdesc[i] = labelList[i].displayName + ":" + labelList[i].description;
81
extdescriptions = extdesc;
86
target: qmlProfilerModelProxy
100
text: labelContainer.text
102
height: root.singleRowHeight
104
verticalAlignment: Text.AlignVCenter
111
anchors.bottom: parent.bottom
116
y: root.singleRowHeight
119
model: descriptions.length
121
width: labelContainer.width
122
height: root.singleRowHeight
125
border.color:"#c8c8c8"
127
height: root.singleRowHeight
130
text: descriptions[index]
131
textFormat: Text.PlainText
132
elide: Text.ElideRight
133
verticalAlignment: Text.AlignVCenter
138
onEntered: changeToolTip(extdescriptions[index]);
139
onExited: changeToolTip("");
141
if (mouse.modifiers & Qt.ShiftModifier)
142
view.selectPrevFromId(modelIndex,eventIds[index]);
144
view.selectNextFromId(modelIndex,eventIds[index]);
152
source: expanded ? "arrow_down.png" : "arrow_right.png"
154
y: root.singleRowHeight / 2 - height / 2
157
anchors.rightMargin: -10
158
anchors.leftMargin: -10
159
anchors.topMargin: -10
160
anchors.bottomMargin: -10
162
expanded = !expanded;