Tracing: Don't use "row" and "column" as IDs

Fixes: QTCREATORBUG-21478
Change-Id: I9bda68abc4980ab9bc4247e48f5bc8bfc788c2dd
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-11-14 14:34:36 +01:00
parent fed9ac43f0
commit aaab74e276
4 changed files with 25 additions and 23 deletions

View File

@@ -96,7 +96,7 @@ Item {
} }
Column { Column {
id: column id: labelsArea
property QtObject parentModel: model property QtObject parentModel: model
anchors.top: txt.bottom anchors.top: txt.bottom
visible: expanded visible: expanded
@@ -111,7 +111,7 @@ Item {
: draggerParent.contentHeight : draggerParent.contentHeight
active: contentBottom > offset active: contentBottom > offset
width: labelContainer.width width: labelContainer.width
height: column.parentModel ? column.parentModel.rowHeight(index + 1) : 0 height: labelsArea.parentModel ? labelsArea.parentModel.rowHeight(index + 1) : 0
sourceComponent: RowLabel { sourceComponent: RowLabel {
label: labels[index]; label: labels[index];
@@ -123,8 +123,8 @@ Item {
} }
} }
onSetRowHeight: { onSetRowHeight: {
column.parentModel.setExpandedRowHeight(index + 1, newHeight); labelsArea.parentModel.setExpandedRowHeight(index + 1, newHeight);
loader.height = column.parentModel.rowHeight(index + 1); loader.height = labelsArea.parentModel.rowHeight(index + 1);
} }
} }
} }

View File

@@ -95,7 +95,7 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
id: column id: renderArea
Repeater { Repeater {
model: modelProxy.models model: modelProxy.models
@@ -103,8 +103,8 @@ Rectangle {
model: modelData model: modelData
zoomer: overview.zoomer zoomer: overview.zoomer
notes: modelProxy.notes notes: modelProxy.notes
width: column.width width: renderArea.width
height: column.height / modelProxy.models.length height: renderArea.height / modelProxy.models.length
} }
} }
} }
@@ -116,7 +116,7 @@ Rectangle {
return prev; return prev;
}, {}); }, {});
property int vertSpace: column.height / 7 property int vertSpace: renderArea.height / 7
property color noteColor: Theme.color(Theme.Timeline_HighlightColor) property color noteColor: Theme.color(Theme.Timeline_HighlightColor)
readonly property double spacing: parent.width / zoomer.traceDuration readonly property double spacing: parent.width / zoomer.traceDuration

View File

@@ -60,7 +60,7 @@ Item {
Item { Item {
x: -(timeDisplay.offsetX % timeDisplay.pixelsPerBlock) x: -(timeDisplay.offsetX % timeDisplay.pixelsPerBlock)
y: 0 y: 0
id: row id: timeDisplayArea
property int firstBlock: timeDisplay.offsetX / timeDisplay.pixelsPerBlock property int firstBlock: timeDisplay.offsetX / timeDisplay.pixelsPerBlock
property int offset: repeater.model > 0 ? repeater.model - (firstBlock % repeater.model) : 0; property int offset: repeater.model > 0 ? repeater.model - (firstBlock % repeater.model) : 0;
@@ -71,18 +71,18 @@ Item {
+ 2)) + 2))
Item { Item {
id: column id: timeDisplayItem
// Changing the text in text nodes is expensive. We minimize the number of changes // Changing the text in text nodes is expensive. We minimize the number of changes
// by rotating the nodes during scrolling. // by rotating the nodes during scrolling.
property int stableIndex: (index + row.offset) % repeater.model property int stableIndex: (index + timeDisplayArea.offset) % repeater.model
height: timeDisplay.height height: timeDisplay.height
y: 0 y: 0
x: width * stableIndex x: width * stableIndex
width: timeDisplay.pixelsPerBlock width: timeDisplay.pixelsPerBlock
property double blockStartTime: (row.firstBlock + stableIndex) property double blockStartTime: (timeDisplayArea.firstBlock + stableIndex)
* timeDisplay.timePerBlock * timeDisplay.timePerBlock
+ timeDisplay.alignedWindowStart + timeDisplay.alignedWindowStart
@@ -97,7 +97,8 @@ Item {
font.pixelSize: timeDisplay.fontSize font.pixelSize: timeDisplay.fontSize
anchors.rightMargin: timeDisplay.textMargin anchors.rightMargin: timeDisplay.textMargin
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: TimeFormatter.format(column.blockStartTime, timeDisplay.rangeDuration) text: TimeFormatter.format(timeDisplayItem.blockStartTime,
timeDisplay.rangeDuration)
visible: width > 0 visible: width > 0
color: Theme.color(Theme.PanelTextColorLight) color: Theme.color(Theme.PanelTextColorLight)
elide: Text.ElideLeft elide: Text.ElideLeft
@@ -117,7 +118,8 @@ Item {
width: timeDisplay.pixelsPerSection width: timeDisplay.pixelsPerSection
Rectangle { Rectangle {
visible: column.stableIndex !== 0 || (-row.x < parent.x + x) visible: timeDisplayItem.stableIndex !== 0
|| (-timeDisplayArea.x < parent.x + x)
color: Theme.color(Theme.Timeline_DividerColor) color: Theme.color(Theme.Timeline_DividerColor)
width: 1 width: 1
anchors.top: parent.top anchors.top: parent.top

View File

@@ -78,19 +78,19 @@ Item {
Column { Column {
id: rows id: scaleArea
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
Repeater { Repeater {
id: rowRepeater id: rowRepeater
model: timeMarks.rowCount model: timeMarks.rowCount
Rectangle { Rectangle {
id: row id: scaleItem
color: ((index + (startOdd ? 1 : 0)) % 2) color: ((index + (startOdd ? 1 : 0)) % 2)
? Theme.color(Theme.Timeline_BackgroundColor1) ? Theme.color(Theme.Timeline_BackgroundColor1)
: Theme.color(Theme.Timeline_BackgroundColor2) : Theme.color(Theme.Timeline_BackgroundColor2)
anchors.left: rows.left anchors.left: scaleArea.left
anchors.right: rows.right anchors.right: scaleArea.right
height: timeMarks.model ? timeMarks.model.rowHeight(index) : 0 height: timeMarks.model ? timeMarks.model.rowHeight(index) : 0
property double minVal: timeMarks.model ? timeMarks.model.rowMinValue(index) : 0 property double minVal: timeMarks.model ? timeMarks.model.rowMinValue(index) : 0
@@ -123,17 +123,17 @@ Item {
anchors.leftMargin: 2 anchors.leftMargin: 2
anchors.topMargin: 2 anchors.topMargin: 2
anchors.left: parent.left anchors.left: parent.left
text: prettyPrintScale(row.maxVal) text: prettyPrintScale(scaleItem.maxVal)
} }
Repeater { Repeater {
model: row.valDiff / row.stepVal model: scaleItem.valDiff / scaleItem.stepVal
Item { Item {
anchors.left: scaleParent.left anchors.left: scaleParent.left
anchors.right: scaleParent.right anchors.right: scaleParent.right
height: row.stepVal * row.height / row.valDiff height: scaleItem.stepVal * scaleItem.height / scaleItem.valDiff
y: row.height - (index + 1) * height y: scaleItem.height - (index + 1) * height
visible: y > scaleTopLabel.height visible: y > scaleTopLabel.height
TimelineText { TimelineText {
font.pixelSize: 8 font.pixelSize: 8
@@ -141,7 +141,7 @@ Item {
anchors.bottomMargin: 2 anchors.bottomMargin: 2
anchors.leftMargin: 2 anchors.leftMargin: 2
anchors.left: parent.left anchors.left: parent.left
text: prettyPrintScale(row.minVal + index * row.stepVal) text: prettyPrintScale(scaleItem.minVal + index * scaleItem.stepVal)
} }
Rectangle { Rectangle {