Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.24 KB | None | 0 0
  1. import Felgo 3.0
  2. import QtQuick 2.0
  3.  
  4. import QtMultimedia 5.9 as QMM
  5.  
  6. App {
  7.     id: app
  8.     // You get free licenseKeys from https://felgo.com/licenseKey
  9.     // With a licenseKey you can:
  10.     //  * Publish your games & apps for the app stores
  11.     //  * Remove the Felgo Splash Screen or set a custom one (available with the Pro Licenses)
  12.     //  * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
  13.     // licenseKey: "657C6859AF3E2CE1E3BC84508657F4F6CEC3E36DC54DDF999F7ED9A5EDCC1A516870A9C3215BC1F733F7B1E8F3AD3FE346A7EDF713BA8639208DD874FEE2DF5E26CCBF96E7D29C5DCAFAB675AC93479E2971033C6883B695B4D25459999F3A54B4F38B313A6EFBBDC627637440C84AFAADA8AF9B82CD5DAF1965D4F1B05F0C2AB547E7780A9B6B8F4C0CE2687834C3AEF8ECCFDD2D07F561F79557908FF9D0C79EC7AB968B5F3A846020BF0B798B653A56ADB8967D9E4F8F16DEC4E01E6D4A2B136A3FFADA9F43E94CE3B76DDCEAAB12680966C70ECCA219A431CB5FD67ED5572F5B84903BAAEC33A40CEAE970131CC021FD9EFD7D914C1EA9B131C2FB00D5B67516BA34F93AB597C0210F05A60AECD156946083A2B03137BE9B16D265EB5A2312D1CFB5E0E711C395EBAE1741B89DDF5B23FD93797418E94E6996EC95C9ECF55F7B924BB32623B148004346C01914EA"
  14.    
  15.     Rectangle{
  16.         id: rect
  17.  
  18.         width: parent.width
  19.         height: 30
  20.         MouseArea{
  21.             anchors.fill: parent
  22.             onClicked: {
  23.                 loader.source = ""
  24.                 GSignals.clearComponentCache()
  25.                 loader.sourceComponent = cameraPlayer
  26.                 loader.item.stopCamera()
  27.                 loader.item.startCamera()
  28.             }
  29.         }
  30.     }
  31.  
  32.     Loader{
  33.         id: loader
  34.  
  35.         anchors.top: rect.bottom
  36.         width: parent.width
  37.         height: parent.height - 40
  38.     }
  39.  
  40.     Component {
  41.         id: cameraPlayer
  42.  
  43.         Rectangle{
  44.  
  45.             function startCamera()
  46.             {
  47.                 camera.start()
  48.             }
  49.             function stopCamera()
  50.             {
  51.                 camera.stop()
  52.             }
  53.  
  54.             anchors.fill: parent
  55.             QMM.Camera {
  56.                 id: camera
  57.             }
  58.  
  59.             QMM.VideoOutput {
  60.                 id: videoOutput
  61.  
  62.                 autoOrientation: true
  63.                 width: parent.width
  64.                 source: camera
  65.             }
  66.         }
  67.     }  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement