summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-13 12:33:40 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-13 12:52:15 +0200
commit1549721eb6334752b71327e58f55ba014577f3b5 (patch)
tree460c3b55d86594d189e1bb0aef6ebe2ad604cb9d /examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml
parent0f9aab7f371f70b49d3bea2299069077f845cf12 (diff)
Tweak qmloscilloscope UI layout to better fit portrait
Change-Id: I018377eff88a7d8c110f3d30e91b5262df71b04f Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml')
-rw-r--r--examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml286
1 files changed, 150 insertions, 136 deletions
diff --git a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml
index b9284777..6034109b 100644
--- a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml
+++ b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml
@@ -96,176 +96,190 @@ Item {
Rectangle {
width: parent.width
- height: flatShadingToggle.height
+ height: flatShadingToggle.height * 2
anchors.left: parent.left
anchors.top: parent.top
color: surfaceGraph.theme.backgroundColor
- RowLayout {
- id: buttonLayout
- Layout.minimumHeight: flatShadingToggle.height
+ ColumnLayout {
anchors.fill: parent
- spacing: 0
-
- Rectangle {
+ RowLayout {
+ id: sliderLayout
+ anchors.top: parent.top
Layout.fillHeight: true
Layout.fillWidth: true
- Layout.minimumWidth: samplesText.implicitWidth + 120
- Layout.maximumWidth: samplesText.implicitWidth + 120
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- border.color: "gray"
- border.width: 1
- radius: 4
-
- RowLayout {
- anchors.fill: parent
- anchors.margins: parent.border.width + 1
-
- Slider {
- id: sampleSlider
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- Layout.minimumWidth: 100
- minimumValue: mainView.sampleCache * 2
- maximumValue: minimumValue * 10
- stepSize: mainView.sampleCache
- updateValueWhileDragging: false
- value: minimumValue * 2
- }
+ Layout.minimumHeight: flatShadingToggle.height
+ spacing: 0
+
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.minimumWidth: samplesText.implicitWidth + 120
+ Layout.maximumWidth: samplesText.implicitWidth + 120
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ border.color: "gray"
+ border.width: 1
+ radius: 4
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.margins: parent.border.width + 1
+
+ Slider {
+ id: sampleSlider
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.minimumWidth: 80
+ minimumValue: mainView.sampleCache * 2
+ maximumValue: minimumValue * 10
+ stepSize: mainView.sampleCache
+ updateValueWhileDragging: false
+ value: minimumValue * 2
+ }
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.minimumWidth: samplesText.implicitWidth + 10
- Layout.maximumWidth: samplesText.implicitWidth + 10
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- Text {
- id: samplesText
- text: "Samples: " + (mainView.sampleRows * mainView.sampleColumns)
- anchors.fill: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.minimumWidth: samplesText.implicitWidth + 10
+ Layout.maximumWidth: samplesText.implicitWidth + 10
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ Text {
+ id: samplesText
+ text: "Samples: " + (mainView.sampleRows * mainView.sampleColumns)
+ anchors.fill: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
}
}
}
- }
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.minimumWidth: frequencyText.implicitWidth + 120
- Layout.maximumWidth: frequencyText.implicitWidth + 120
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- border.color: "gray"
- border.width: 1
- radius: 4
-
- RowLayout {
- anchors.fill: parent
- anchors.margins: parent.border.width + 1
-
- Slider {
- id: frequencySlider
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- Layout.minimumWidth: 100
- minimumValue: 2
- maximumValue: 60
- stepSize: 2
- updateValueWhileDragging: true
- value: 30
- }
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.minimumWidth: frequencyText.implicitWidth + 120
+ Layout.maximumWidth: frequencyText.implicitWidth + 120
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ border.color: "gray"
+ border.width: 1
+ radius: 4
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.margins: parent.border.width + 1
+
+ Slider {
+ id: frequencySlider
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.minimumWidth: 80
+ minimumValue: 2
+ maximumValue: 60
+ stepSize: 2
+ updateValueWhileDragging: true
+ value: 30
+ }
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.minimumWidth: frequencyText.implicitWidth + 10
- Layout.maximumWidth: frequencyText.implicitWidth + 10
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- Text {
- id: frequencyText
- text: "Target freq: " + frequencySlider.value + " Hz"
- anchors.fill: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.minimumWidth: frequencyText.implicitWidth + 10
+ Layout.maximumWidth: frequencyText.implicitWidth + 10
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ Text {
+ id: frequencyText
+ text: "Freq: " + frequencySlider.value + " Hz"
+ anchors.fill: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
}
}
}
- }
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- Layout.minimumWidth: selectionText.implicitWidth + 10
- Layout.maximumWidth: selectionText.implicitWidth + 10
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- border.color: "gray"
- border.width: 1
- radius: 4
-
- Text {
- id: selectionText
- text: "No selection"
- anchors.fill: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.minimumWidth: selectionText.implicitWidth + 10
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ border.color: "gray"
+ border.width: 1
+ radius: 4
+
+ Text {
+ id: selectionText
+ text: "No selection"
+ anchors.fill: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
}
}
- NewButton {
- id: flatShadingToggle
+ RowLayout {
+ id: buttonLayout
Layout.fillHeight: true
Layout.fillWidth: true
-
- text: "Show Flat"
- enabled: surfaceSeries.flatShadingSupported
-
- onClicked: {
- if (surfaceSeries.flatShadingEnabled === true) {
- surfaceSeries.flatShadingEnabled = false;
- text = "Show Flat"
- } else {
- surfaceSeries.flatShadingEnabled = true;
- text = "Show Smooth"
+ Layout.minimumHeight: flatShadingToggle.height
+ anchors.bottom: parent.bottom
+ spacing: 0
+
+ NewButton {
+ id: flatShadingToggle
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ text: "Show Flat"
+ enabled: surfaceSeries.flatShadingSupported
+
+ onClicked: {
+ if (surfaceSeries.flatShadingEnabled === true) {
+ surfaceSeries.flatShadingEnabled = false;
+ text = "Show Flat"
+ } else {
+ surfaceSeries.flatShadingEnabled = true;
+ text = "Show Smooth"
+ }
}
}
- }
- NewButton {
- id: surfaceGridToggle
- Layout.fillHeight: true
- Layout.fillWidth: true
+ NewButton {
+ id: surfaceGridToggle
+ Layout.fillHeight: true
+ Layout.fillWidth: true
- text: "Show Surface Grid"
+ text: "Show Surface Grid"
- onClicked: {
- if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe) {
- surfaceSeries.drawMode &= ~Surface3DSeries.DrawWireframe;
- text = "Show Surface Grid"
- } else {
- surfaceSeries.drawMode |= Surface3DSeries.DrawWireframe;
- text = "Hide Surface Grid"
+ onClicked: {
+ if (surfaceSeries.drawMode & Surface3DSeries.DrawWireframe) {
+ surfaceSeries.drawMode &= ~Surface3DSeries.DrawWireframe;
+ text = "Show Surface Grid"
+ } else {
+ surfaceSeries.drawMode |= Surface3DSeries.DrawWireframe;
+ text = "Hide Surface Grid"
+ }
}
}
- }
- NewButton {
- id: exitButton
- Layout.fillHeight: true
- Layout.fillWidth: true
+ NewButton {
+ id: exitButton
+ Layout.fillHeight: true
+ Layout.fillWidth: true
- text: "Quit"
+ text: "Quit"
- onClicked: Qt.quit(0);
+ onClicked: Qt.quit(0);
+ }
}
}
+
}
//! [1]