QtMobility Reference Documentation

QML Camera Element

The Camera element allows you to add camera viewfinder to a scene. More...

Inherits Item

Camera instantiates the C++ class QDeclarativeCamera

This element was introduced in Mobility 1.1.

Properties

Signal Handlers

Detailed Description

This element is part of the QtMultimediaKit 1.1 module.

 import Qt 4.7
 import QtMultimediaKit 1.1

 Camera {
     focus : visible // to receive focus and capture key events when visible

     flashMode: Camera.FlashRedEyeReduction
     whiteBalanceMode: Camera.WhiteBalanceFlash
     exposureCompensation: -1.0

     onImageCaptured : {
         photoPreview.source = preview  // Show the preview in an Image element
     }

 }

You can use the Camera element to capture images from a camera, and manipulate the capture and processing settings that get applied to the image.

Note: On Symbian, your process requires the UserEnvironment capability to use this element.

Property Documentation

read-onlyaperture : real

The lens aperture as an F number (the ratio of the focal length to effective aperture diameter).

This property group was introduced in Mobility 1.1.


cameraState : enumeration

The current state of the camera object.

ValueDescription
UnloadedStateThe initial camera state, with camera not loaded, the camera capabilities except of supported capture modes are unknown. While the supported settings are unknown in this state, it's allowed to set the camera capture settings like codec, resolution, or frame rate.
LoadedStateThe camera is loaded and ready to be configured.

In the Idle state it's allowed to query camera capabilities, set capture resolution, codecs, etc.

The viewfinder is not active in the loaded state.

ActiveStateIn the active state as soon as camera is started the viewfinder displays video frames and the camera is ready for capture.

This property group was introduced in Mobility 1.1.


captureResolution : size

The resolution to capture the image at. If empty, the system will pick a good size.

This property group was introduced in Mobility 1.1.


read-onlycapturedImagePath : string

The path to the captured image.

This property group was introduced in Mobility 1.1.


digitalZoom : real

The current digital zoom factor.

This property group was introduced in Mobility 1.1.


read-onlyerrorString : string

A description of the current error, if any.

This property group was introduced in Mobility 1.1.


exposureCompensation : real

Adjustment for the automatically calculated exposure. The value is in EV units.

This property group was introduced in Mobility 1.1.


exposureMode : enumeration

ValueDescription
ExposureManualManual mode.
ExposureAutoAutomatic mode.
ExposureNightNight mode.
ExposureBacklightBacklight exposure mode.
ExposureSpotlightSpotlight exposure mode.
ExposureSportsSpots exposure mode.
ExposureSnowSnow exposure mode.
ExposureBeachBeach exposure mode.
ExposureLargeApertureUse larger aperture with small depth of field.
ExposureSmallApertureUse smaller aperture.
ExposurePortraitPortrait exposure mode.
ExposureModeVendorThe base value for device specific exposure modes.

This property group was introduced in Mobility 1.1.


flashMode : enumeration

ValueDescription
FlashOffFlash is Off.
FlashOnFlash is On.
FlashAutoAutomatic flash.
FlashRedEyeReductionRed eye reduction flash.
FlashFillUse flash to fillin shadows.
FlashTorchConstant light source, useful for focusing and video capture.
FlashSlowSyncFrontCurtainUse the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect.
FlashSlowSyncRearCurtainThe similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure.
FlashManualFlash power is manually set.

This property group was introduced in Mobility 1.1.


isoSensitivity : real

The sensor's ISO sensitivity.

This property group was introduced in Mobility 1.1.


read-onlylockStatus : enumeration

The overall status for all the requested camera locks.

ValueDescription
UnlockedThe application is not interested in camera settings value. The camera may keep this parameter without changes, this is common with camera focus, or adjust exposure and white balance constantly to keep the viewfinder image nice.
SearchingThe application has requested the camera focus, exposure or white balance lock with searchAndLock(). This state indicates the camera is focusing or calculating exposure and white balance.
LockedThe camera focus, exposure or white balance is locked. The camera is ready to capture, application may check the exposure parameters.

The locked state usually means the requested parameter stays the same, except in the cases when the parameter is requested to be constantly updated. For example in continuous focusing mode, the focus is considered locked as long and the object is in focus, even while the actual focusing distance may be constantly changing.

This property group was introduced in Mobility 1.1.


manualWhiteBalance : int

The color temperature used when in manual white balance mode (WhiteBalanceManual).

This property group was introduced in Mobility 1.1.

See also whiteBalanceMode.


read-onlymaximumDigitalZoom : real

The maximum digital zoom factor, or 1.0 if digital zoom is not supported.

This property group was introduced in Mobility 1.1.


read-onlymaximumOpticalZoom : real

The maximum optical zoom factor, or 1.0 if optical zoom is not supported.

This property group was introduced in Mobility 1.1.


opticalZoom : real

The current optical zoom factor.

This property group was introduced in Mobility 1.1.


read-onlyshutterSpeed : real

The camera's shutter speed, in seconds.

This property group was introduced in Mobility 1.1.


whiteBalanceMode : enumeration

ValueDescription
WhiteBalanceManualManual white balance. In this mode the manual white balance property value is used.
WhiteBalanceAutoAuto white balance mode.
WhiteBalanceSunlightSunlight white balance mode.
WhiteBalanceCloudyCloudy white balance mode.
WhiteBalanceShadeShade white balance mode.
WhiteBalanceTungstenTungsten white balance mode.
WhiteBalanceFluorescentFluorescent white balance mode.
WhiteBalanceIncandescentIncandescent white balance mode.
WhiteBalanceFlashFlash white balance mode.
WhiteBalanceSunsetSunset white balance mode.
WhiteBalanceVendorVendor defined white balance mode.

This property group was introduced in Mobility 1.1.

See also manualWhiteBalance.


Signal Handler Documentation

Camera::apertureChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::cameraStateChanged ( Camera::State )

This documentation was introduced in Mobility 1.1.


Camera::captureResolutionChanged ( Item )

This documentation was introduced in Mobility 1.1.


Camera::digitalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::errorChanged ()

This documentation was introduced in Mobility 1.1.


Camera::exposureCompensationChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::exposureModeChanged ( Camera::ExposureMode )

This documentation was introduced in Mobility 1.1.


Camera::flashModeChanged ( int mode )

The flash mode is now mode.

This documentation was introduced in Mobility 1.1.

See also QDeclarativeCamera::FlashMode.


Camera::imageCaptured ( string )

This documentation was introduced in Mobility 1.1.


Camera::imageSaved ( string )

This documentation was introduced in Mobility 1.1.


Camera::isoSensitivityChanged ( int )

This documentation was introduced in Mobility 1.1.


Camera::lockStatusChanged ()

This documentation was introduced in Mobility 1.1.


Camera::manualWhiteBalanceChanged ( int )

This documentation was introduced in Mobility 1.1.


Camera::maximumDigitalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::maximumOpticalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::onCaptureFailed ( message )

This handler is called when an error occurs during capture. A descriptive message is available in message.

This documentation was introduced in Mobility 1.1.


Camera::onError ( error, errorString )

This handler is called when an error occurs. The enumeration value error is one of the values defined below, and a descriptive string value is available in errorString.

ValueDescription
NoErrorNo errors have occurred.
CameraErrorAn error has occurred.
InvalidRequestErrorSystem resource doesn't support requested functionality.
ServiceMissingErrorNo camera service available.
NotSupportedFeatureErrorThe feature is not supported.

This documentation was introduced in Mobility 1.1.


Camera::onImageCaptured ( preview )

This handler is called when an image has been captured but not yet saved to the filesystem. The preview parameter can be used as the URL supplied to an Image element.

This documentation was introduced in Mobility 1.1.

See also onImageSaved.


Camera::onImageSaved ( path )

This handler is called after the image has been written to the filesystem. The path is a local file path, not a URL.

This documentation was introduced in Mobility 1.1.

See also onImageCaptured.


Camera::opticalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::shutterSpeedChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::stateChanged ( Camera::State )

This documentation was introduced in Mobility 1.1.


Camera::whiteBalanceModeChanged ( Camera::WhiteBalanceMode )

This documentation was introduced in Mobility 1.1.


X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.