diff options
Diffstat (limited to 'examples/datavisualization')
-rw-r--r-- | examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml index 5f5bfe1a..1373d4f9 100644 --- a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -65,6 +65,14 @@ Item { axisX.segmentCount: 4 axisY.segmentCount: 4 axisZ.segmentCount: 4 + measureFps: true + + onCurrentFpsChanged: { + if (fps > 10) + fpsText.text = "FPS: " + Math.round(surfaceGraph.currentFps) + else + fpsText.text = "FPS: " + Math.round(surfaceGraph.currentFps * 10.0) / 10.0 + } //! [0] Surface3DSeries { @@ -205,6 +213,25 @@ Item { Rectangle { Layout.fillHeight: true Layout.fillWidth: true + Layout.minimumWidth: fpsText.implicitWidth + 10 + Layout.maximumWidth: fpsText.implicitWidth + 10 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + border.color: "gray" + border.width: 1 + radius: 4 + + Text { + id: fpsText + 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 |