aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2013-12-02 16:16:33 +0100
committerUlf Hermann <ulf.hermann@digia.com>2013-12-03 14:42:30 +0100
commit68740869efbddb8b6f03fe312fe6ba6e89af58ce (patch)
tree6615a037cfebf26e68973e7410f0a78814f9bc40
parent0a7109126051fa13e6f2e27845897792a2ba24cb (diff)
QmlProfiler: Update timeline contentWidth also if width changes
As the contentWidth depends on both the width of the flickable and the currently selected time range it should be updated if either of them change. Otherwise we can miss changes and show stale data. Change-Id: Iab9e17eef3490531175a2374fb3da0e0071f3bd1 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
-rw-r--r--src/plugins/qmlprofiler/qml/MainView.qml19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml
index bc40aa5437..c7e12a3de7 100644
--- a/src/plugins/qmlprofiler/qml/MainView.qml
+++ b/src/plugins/qmlprofiler/qml/MainView.qml
@@ -76,19 +76,12 @@ Rectangle {
onRangeChanged: {
var startTime = zoomControl.startTime();
var endTime = zoomControl.endTime();
- var duration = Math.abs(endTime - startTime);
- mainviewTimePerPixel = duration / root.width;
+ mainviewTimePerPixel = Math.abs(endTime - startTime) / root.width;
backgroundMarks.updateMarks(startTime, endTime);
view.updateFlickRange(startTime, endTime);
- if (duration > 0) {
- var candidateWidth = qmlProfilerModelProxy.traceDuration() *
- flick.width / duration;
- if (flick.contentWidth !== candidateWidth)
- flick.contentWidth = candidateWidth;
- }
-
+ flick.setContentWidth();
}
}
@@ -325,6 +318,12 @@ Rectangle {
}
Flickable {
+ function setContentWidth() {
+ var duration = Math.abs(zoomControl.endTime() - zoomControl.startTime());
+ if (duration > 0)
+ contentWidth = qmlProfilerModelProxy.traceDuration() * width / duration;
+ }
+
id: flick
anchors.top: parent.top
anchors.topMargin: labels.y
@@ -336,6 +335,8 @@ Rectangle {
boundsBehavior: Flickable.StopAtBounds
onContentXChanged: view.updateZoomControl()
+ onWidthChanged: setContentWidth()
+
clip:true
SelectionRange {