QmlProfiler: Reimplement zoom slider in QML

This restores the functionality of the old zoom slider. It probably
looks a bit different, but it does the same thing.

Task-number: QTCREATORBUG-10635

Change-Id: Idcb19187df066e4b1336df73b122aa567a732dee
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2013-11-12 12:44:54 +01:00
parent 9a1da15739
commit 9e0175d8bb
3 changed files with 37 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
import QtQuick 2.1
import Monitor 1.0
import QtQuick.Controls 1.0
Rectangle {
id: root
@@ -561,6 +562,34 @@ Rectangle {
id: rangeDetails
}
Rectangle {
objectName: "zoomSliderToolBar"
color: "#9b9b9b"
enabled: false
visible: false
width: labels.width
height: 24
x: 0
y: 0
signal zoomLevelChanged(int value)
function toggleEnabled() {enabled = !enabled}
function toggleVisible() {visible = !visible}
function setZoomLevel(level) {zoomSlider.value = level}
Slider {
id: zoomSlider
anchors.fill: parent
minimumValue: 1
maximumValue: 10000
stepSize: 100
// For some reason the child may generate a meaningless value
// change event before the parent is initialized.
onValueChanged: if (parent) parent.zoomLevelChanged(value)
}
}
Item {
anchors.right: root.right
width: 6