opened
sanusbaum
username_0
I have not been able to find a way to use a secondary camera stream with the QML example. I've tried numerous searches, and looking at the code, but I don't understand enough of it to implement using the second camera on a device. Is this a missing feature of the library/example? Does anyone know how to change the camera or can provide guidance? 

Thanks.
Unable to change to the front-facing camera with QML
issue
created
ftylitak
username_1
Hello @username_0 

accoring to Qt documentation of [Camera QML](https://doc.qt.io/qt-5/qml-qtmultimedia-camera.html), you just need to change the [Camera.position](https://doc.qt.io/qt-5/qml-qtmultimedia-camera.html#position-prop) property to **Camera.FrontFace**. 

This would mean that in main.qml contained in the QZXingLive example, go to the definition of Camera QML module and add the following line:

link: https://github.com/username_1/qzxing/blob/15ddcaf18145ac3ff4bfbd5b48c31b7cd040e9dd/examples/QZXingLive/main.qml#L47
```qml
    Camera
    {
        id:camera
        focus {
            focusMode: CameraFocus.FocusContinuous
            focusPointMode: CameraFocus.FocusPointAuto
        }
       position: Camera.FrontFace //add this line
    }
```
Does this solves your requirements?
comment
created
sanusbaum
username_0
Hi,

yes it does. I actually just solved this a different way, earlier today, using this (where applicationData was a QObject storing the device id index with m_qzxingQml->rootContext()->setContextProperty("applicationData", &deviceIndex)):

    Camera
    {
        id:camera
        deviceId: QtMultimedia.availableCameras[applicationData.deviceId].deviceId
        focus {
            focusMode: CameraFocus.FocusContinuous
            focusPointMode: CameraFocus.FocusPointAuto
        }
    }

So I just selected the camera device id with a device id index from QtMultimedia.availableCameras. 

Thanks for your help!
comment
closed
sanusbaum
username_0
issue