How to change camera or capture resolution in Qt6 ?
-
Camera has cameraFormat.resolution property , and it not read-only in documentation.
// by binding
cameraFormat.resolution:Qt.size(1080,1440) it will be "Invalid property assignment: "resolution" is a read-only property",
// by javascript
camera.cameraFormat.resolution = Qt.size(1080,1440) // Error: Cannot assign QSizeF to QSize
camera.cameraFormat.resolution = "1080x1440" // Error: Cannot assign QString to QSize
Qt5 Imagecapture has supportedResolutions and resolution properties, Qt6 insteal.
how to do it in Qt6 ? -
Camera has cameraFormat.resolution property , and it not read-only in documentation.
// by binding
cameraFormat.resolution:Qt.size(1080,1440) it will be "Invalid property assignment: "resolution" is a read-only property",
// by javascript
camera.cameraFormat.resolution = Qt.size(1080,1440) // Error: Cannot assign QSizeF to QSize
camera.cameraFormat.resolution = "1080x1440" // Error: Cannot assign QString to QSize
Qt5 Imagecapture has supportedResolutions and resolution properties, Qt6 insteal.
how to do it in Qt6 ?@LZHD For video recording there is https://doc.qt.io/qt-6/qml-qtmultimedia-mediarecorder.html which has https://doc.qt.io/qt-6/qml-qtmultimedia-mediarecorder.html#videoResolution-prop
Also see https://doc.qt.io/qt-6/qml-qtmultimedia-capturesession.html