diff options
author | Samuel Mira <samuel.mira@qt.io> | 2021-09-03 18:42:47 +0300 |
---|---|---|
committer | Samuel Mira <samuel.mira@qt.io> | 2021-09-08 12:58:27 +0300 |
commit | f52141f1cf85f84e0b2a93d9c4e88723cf1d622a (patch) | |
tree | 822232a6932fcc368bf7ee30b3021be3723d67fb /examples/multimedia/video/recorder/Style.qml | |
parent | 1115b5220eb5006b5193d634382bc0081f31e95b (diff) |
Improve QML Recorder example
Changed QML and added some cases just for mobile. Tested mostly on
android.
Hid metadata adding feature on mobile since it is not implemented.
Task-number: QTBUG-96077
Pick-to: 6.2 6.2.0
Change-Id: I524767232561bef7716830ed0f9360e7c0662f0f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'examples/multimedia/video/recorder/Style.qml')
-rw-r--r-- | examples/multimedia/video/recorder/Style.qml | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/examples/multimedia/video/recorder/Style.qml b/examples/multimedia/video/recorder/Style.qml index 8e1136e92..f00a3c9f1 100644 --- a/examples/multimedia/video/recorder/Style.qml +++ b/examples/multimedia/video/recorder/Style.qml @@ -52,11 +52,27 @@ pragma Singleton import QtQuick QtObject { + + function isMobile() { + return Qt.platform.os === "android" || Qt.platform.os === "ios"; + } + + function calculateRatio(windowWidth, windowHeight) { + var refWidth = 800.; + Style.ratio = windowWidth/refWidth; + } + + property real ratio : 1 + + property real screenWidth: isMobile()? 400 : 800 + property real screenHeigth: isMobile()? 900 : 600 + property real height: 25 - property real widthTiny: 40 - property real widthShort: 80 - property real widthMedium: 160 - property real widthLong: 240 + property real widthTiny: 40*ratio + property real widthShort: 80*ratio + property real widthMedium: 160*ratio + property real widthLong: 220*ratio property real intraSpacing: 5 property real interSpacing: 15 + property real fontSize: 11 } |