summaryrefslogtreecommitdiffstats
path: root/examples/video/qmlvideo/qml/qmlvideo/main.qml
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2012-02-06 15:40:49 +0000
committerQt by Nokia <qt-info@nokia.com>2012-02-08 22:30:49 +0100
commitc1ec175b24bde1523fcbd7e33d0f46f3bbc1def9 (patch)
treea6f5fd12fa4ec15843f896b7108e0d5e36ee4015 /examples/video/qmlvideo/qml/qmlvideo/main.qml
parentb6f54c8833347ddb13b12cfd682cd12de72664d8 (diff)
Tidy up frame rate display in video examples
* Use a Column element to position QML and video frame rate counters. * When using small-screen layouts, hide frame rate counters when dialogs or menus are displayed. * Do not display instantaneous frame rate. If changes in this rate trigger a repaint, then the rate itself is changed. If the repaint occurs in less time than the QElapsedTimer resolution, the displayed instantaneous rate is always zero. * Add a label, so it is clear which is the QML repaint rate, and which is the video frame rate. Change-Id: Ie58ab162ab44bd7f1c4b297eed929b9baa73552c Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Diffstat (limited to 'examples/video/qmlvideo/qml/qmlvideo/main.qml')
-rw-r--r--examples/video/qmlvideo/qml/qmlvideo/main.qml11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/video/qmlvideo/qml/qmlvideo/main.qml b/examples/video/qmlvideo/qml/qmlvideo/main.qml
index 261a3357b..a2dc29ed6 100644
--- a/examples/video/qmlvideo/qml/qmlvideo/main.qml
+++ b/examples/video/qmlvideo/qml/qmlvideo/main.qml
@@ -69,16 +69,27 @@ Rectangle {
Loader {
id: performanceLoader
+
+ Connections {
+ target: inner
+ onVisibleChanged:
+ if (performanceLoader.item)
+ performanceLoader.item.enabled = !inner.visible
+ ignoreUnknownSignals: true
+ }
+
function init() {
console.log("[qmlvideo] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
}
+
onLoaded: {
item.parent = root
item.anchors.fill = root
item.logging = root.perfMonitorsLogging
item.displayed = root.perfMonitorsVisible
+ item.enabled = false
item.init()
}
}