Qt 5.9 | Qt Multimedia | Qt Multimedia Examples | QML Camera Example

Qt 5.9.4 Reference Documentation

# QML Camera Example

This example demonstrates how to use the Qt Multimedia QML API to access camera functions. It shows how to change settings and to capture images.

## Running the Example

To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, visit Building and Running an Example.

## Application Structure

Most of the QML code supports the user interface for this application with the camera types being mostly found in declarative-camera.qml and CaptureControls.qml.

CaptureControls, which is implemented in CaptureControls.qml, generates a column on the right hand side of the screen which includes control buttons for focus (not initially visible), capture, flash modes, white balance, exposure compensation, and if a preview is available, a preview button. The last button exits from the application.

Files:

- multimedia/declarative-camera/CameraButton.qml
- multimedia/declarative-camera/CameraListButton.qml
- multimedia/declarative-camera/CameraListPopup.qml
- multimedia/declarative-camera/CameraPropertyButton.qml
- multimedia/declarative-camera/CameraPropertyPopup.qml
- multimedia/declarative-camera/FocusButton.qml
- multimedia/declarative-camera/PhotoCaptureControls.qml
- multimedia/declarative-camera/PhotoPreview.qml
- multimedia/declarative-camera/Popup.qml
- multimedia/declarative-camera/VideoCaptureControls.qml
- multimedia/declarative-camera/VideoPreview.qml
- multimedia/declarative-camera/ZoomControl.qml
- multimedia/declarative-camera/declarative-camera.qml
- multimedia/declarative-camera/qmlcamera.cpp
- multimedia/declarative-camera/declarative-camera.pro
- multimedia/declarative-camera/declarative-camera.qmlproject
- multimedia/declarative-camera/declarative-camera.qrc

Images:

- multimedia/declarative-camera/images/camera_auto_mode.png
- multimedia/declarative-camera/images/camera_camera_setting.png
- multimedia/declarative-camera/images/camera_flash_auto.png
- multimedia/declarative-camera/images/camera_flash_fill.png
- multimedia/declarative-camera/images/camera_flash_off.png
- multimedia/declarative-camera/images/camera_flash_redeye.png
- multimedia/declarative-camera/images/camera_white_balance_cloudy.png
- multimedia/declarative-camera/images/camera_white_balance_flourescent.png
- multimedia/declarative-camera/images/camera_white_balance_incandescent.png
- multimedia/declarative-camera/images/camera_white_balance_sunny.png
- multimedia/declarative-camera/images/toolbutton.png