Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Felgo 3.0
- import QtQuick 2.0
- import QtMultimedia 5.9 as QMM
- App {
- id: app
- // You get free licenseKeys from https://felgo.com/licenseKey
- // With a licenseKey you can:
- // * Publish your games & apps for the app stores
- // * Remove the Felgo Splash Screen or set a custom one (available with the Pro Licenses)
- // * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
- // licenseKey:
- // Local storage component
- Storage {
- id: storage
- }
- Constant{ id: constant }
- Rectangle{
- id: rect
- width: parent.width
- height: dp(80)
- Text{
- anchors.fill: parent
- text: "click me"
- }
- MouseArea{
- anchors.fill: parent
- onClicked: {
- loader.source = ""
- GSignals.clearComponentCache()
- loader.sourceComponent = cameraPlayer
- loader.item.stopCamera()
- loader.item.startCamera()
- }
- }
- }
- Loader{
- id: loader
- anchors.top: rect.bottom
- width: parent.width
- height: parent.height - dp(80)
- }
- Component {
- id: cameraPlayer
- Rectangle{
- function startCamera()
- {
- camera.start()
- }
- function stopCamera()
- {
- camera.stop()
- }
- anchors.fill: parent
- QMM.Camera {
- id: camera
- }
- QMM.VideoOutput {
- id: videoOutput
- autoOrientation: true
- width: parent.width
- source: camera
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement