Important: Please read the Qt Code of Conduct -

QML: Overlapping webcam and webview

  • I'm trying to have a webcam show at the same time that I have a local website running. Unfortunately, every attempt at make at having these items show at the same time has been failing me. It either shows the local site, or the webcam. I've stripped the code for the sake of simplicity.

    the QML:

    import QtQuick 2.2
    import QtQuick.Controls 1.1
    import QtWebView 1.1
    import QtQuick.Layouts 1.1
    import QtQuick.Controls.Styles 1.2
    import QtMultimedia 5.3
    ApplicationWindow {
        property bool showProgress: webView.loading
                                    && Qt.platform.os !== "ios"
                                    && Qt.platform.os !== "winrt"
        visible: true
        x: initialX
        y: initialY
        width: initialWidth
        height: initialHeight
        title: webView.title
        Camera {
          id: camera
          objectName: "qmlCam"
        Row {
            spacing: 0
            VideoOutput {
              id: viewfinder
              source: camera
              //anchors.fill: parent.left
            Image {
              id: photoPreview
              //anchors.fill: viewfinder
            WebView {
                id: webView
                url: base64url
                onLoadingChanged: {
                    if (loadRequest.errorString)

Log in to reply