diff options
Diffstat (limited to 'examples/datavisualization')
-rw-r--r-- | examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml | 286 |
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] |