The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView. More...
#include <QDeclarativeCamera>
Inherits: QDeclarativeItem.
This class was introduced in Mobility 1.1.
enum | Error { NoError, CameraError, InvalidRequestError, ServiceMissingError, NotSupportedFeatureError } |
enum | ExposureMode { ExposureManual, ExposureAuto, ExposureNight, ExposureBacklight, ..., ExposureModeVendor } |
enum | FlashMode { FlashOff, FlashOn, FlashAuto, FlashRedEyeReduction, ..., FlashManual } |
enum | LockStatus { Unlocked, Searching, Locked } |
enum | State { UnloadedState, LoadedState, ActiveState } |
enum | WhiteBalanceMode { WhiteBalanceManual, WhiteBalanceAuto, WhiteBalanceSunlight, WhiteBalanceCloudy, ..., WhiteBalanceVendor } |
|
|
QDeclarativeCamera ( QDeclarativeItem * parent = 0 ) | |
~QDeclarativeCamera () | |
qreal | aperture () const |
State | cameraState () const |
QSize | captureResolution () const |
QString | capturedImagePath () const |
QImage | capturedImagePreview () const |
qreal | digitalZoom () const |
Error | error () const |
QString | errorString () const |
qreal | exposureCompensation () const |
ExposureMode | exposureMode () const |
int | flashMode () const |
int | isoSensitivity () const |
LockStatus | lockStatus () const |
int | manualWhiteBalance () const |
qreal | maximumDigitalZoom () const |
qreal | maximumOpticalZoom () const |
qreal | opticalZoom () const |
qreal | shutterSpeed () const |
WhiteBalanceMode | whiteBalanceMode () const |
virtual void | paint ( QPainter * painter, const QStyleOptionGraphicsItem * style, QWidget * widget ) |
void | captureImage () |
void | searchAndLock () |
void | setCameraState ( State state ) |
void | setCaptureResolution ( const QSize & size ) |
void | setDigitalZoom ( qreal ) |
void | setExposureCompensation ( qreal ev ) |
void | setExposureMode ( QDeclarativeCamera::ExposureMode ) |
void | setFlashMode ( int ) |
void | setManualIsoSensitivity ( int iso ) |
void | setManualWhiteBalance ( int colorTemp ) const |
void | setOpticalZoom ( qreal ) |
void | setWhiteBalanceMode ( QDeclarativeCamera::WhiteBalanceMode mode ) const |
void | start () |
void | stop () |
void | unlock () |
void | apertureChanged ( qreal aperture ) |
void | cameraStateChanged ( QDeclarativeCamera::State state ) |
void | captureFailed ( const QString & message ) |
void | captureResolutionChanged ( const QSize & resolution ) |
void | digitalZoomChanged ( qreal ) |
void | error ( QDeclarativeCamera::Error error, const QString & errorString ) |
void | errorChanged () |
void | exposureCompensationChanged ( qreal expComp ) |
void | exposureModeChanged ( QDeclarativeCamera::ExposureMode mode ) |
void | flashModeChanged ( int ) |
void | imageCaptured ( const QString & preview ) |
void | imageSaved ( const QString & path ) |
void | isoSensitivityChanged ( int isoValue ) |
void | lockStatusChanged () |
void | manualWhiteBalanceChanged ( int newWhiteBal ) const |
void | maximumDigitalZoomChanged ( qreal zoom ) |
void | maximumOpticalZoomChanged ( qreal ) |
void | opticalZoomChanged ( qreal zoom ) |
void | shutterSpeedChanged ( qreal speed ) |
void | whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const |
virtual void | geometryChanged ( const QRectF & newGeometry, const QRectF & oldGeometry ) |
virtual void | keyPressEvent ( QKeyEvent * event ) |
virtual void | keyReleaseEvent ( QKeyEvent * event ) |
The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::NoError | QCamera::NoError | No errors have occurred. |
QDeclarativeCamera::CameraError | QCamera::CameraError | An error has occurred. |
QDeclarativeCamera::InvalidRequestError | QCamera::InvalidRequestError | System resource doesn't support requested functionality. |
QDeclarativeCamera::ServiceMissingError | QCamera::ServiceMissingError | No camera service available. |
QDeclarativeCamera::NotSupportedFeatureError | QCamera::NotSupportedFeatureError | The feature is not supported. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::ExposureManual | 1 | Manual mode. |
QDeclarativeCamera::ExposureAuto | 0 | Automatic mode. |
QDeclarativeCamera::ExposureNight | 3 | Night mode. |
QDeclarativeCamera::ExposureBacklight | 4 | Backlight exposure mode. |
QDeclarativeCamera::ExposureSpotlight | 5 | Spotlight exposure mode. |
QDeclarativeCamera::ExposureSports | 6 | Spots exposure mode. |
QDeclarativeCamera::ExposureSnow | 7 | Snow exposure mode. |
QDeclarativeCamera::ExposureBeach | 8 | Beach exposure mode. |
QDeclarativeCamera::ExposureLargeAperture | 9 | Use larger aperture with small depth of field. |
QDeclarativeCamera::ExposureSmallAperture | 10 | Use smaller aperture. |
QDeclarativeCamera::ExposurePortrait | 2 | Portrait exposure mode. |
QDeclarativeCamera::ExposureModeVendor | 1000 | The base value for device specific exposure modes. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::FlashOff | 0x2 | Flash is Off. |
QDeclarativeCamera::FlashOn | 0x4 | Flash is On. |
QDeclarativeCamera::FlashAuto | 0x1 | Automatic flash. |
QDeclarativeCamera::FlashRedEyeReduction | 0x8 | Red eye reduction flash. |
QDeclarativeCamera::FlashFill | 0x10 | Use flash to fillin shadows. |
QDeclarativeCamera::FlashTorch | 0x20 | Constant light source, useful for focusing and video capture. |
QDeclarativeCamera::FlashSlowSyncFrontCurtain | 0x40 | Use the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect. |
QDeclarativeCamera::FlashSlowSyncRearCurtain | 0x80 | The similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure. |
QDeclarativeCamera::FlashManual | 0x100 | Flash power is manually set. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::Unlocked | QCamera::Unlocked | The 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. |
QDeclarativeCamera::Searching | QCamera::Searching | The 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. |
QDeclarativeCamera::Locked | QCamera::Locked | The 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.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::UnloadedState | QCamera::UnloadedState | The 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. |
QDeclarativeCamera::LoadedState | QCamera::LoadedState | The 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. |
QDeclarativeCamera::ActiveState | QCamera::ActiveState | In the active state as soon as camera is started the viewfinder displays video frames and the camera is ready for capture. |
The default camera state is ActiveState.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::WhiteBalanceManual | 1 | Manual white balance. In this mode the manual white balance property value is used. |
QDeclarativeCamera::WhiteBalanceAuto | 0 | Auto white balance mode. |
QDeclarativeCamera::WhiteBalanceSunlight | 2 | Sunlight white balance mode. |
QDeclarativeCamera::WhiteBalanceCloudy | 3 | Cloudy white balance mode. |
QDeclarativeCamera::WhiteBalanceShade | 4 | Shade white balance mode. |
QDeclarativeCamera::WhiteBalanceTungsten | 5 | Tungsten white balance mode. |
QDeclarativeCamera::WhiteBalanceFluorescent | 6 | Fluorescent white balance mode. |
QDeclarativeCamera::WhiteBalanceIncandescent | 7 | Incandescent white balance mode. |
QDeclarativeCamera::WhiteBalanceFlash | 8 | Flash white balance mode. |
QDeclarativeCamera::WhiteBalanceSunset | 9 | Sunset white balance mode. |
QDeclarativeCamera::WhiteBalanceVendor | 1000 | Vendor defined white balance mode. |
The lens aperture as an F number (the ratio of the focal length to effective aperture diameter).
This property was introduced in Mobility 1.1.
Access functions:
qreal | aperture () const |
Notifier signal:
void | apertureChanged ( qreal aperture ) |
The current state of the camera object.
Value | Description |
---|---|
UnloadedState | The 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. |
LoadedState | The 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. |
ActiveState | In the active state as soon as camera is started the viewfinder displays video frames and the camera is ready for capture. |
This property was introduced in Mobility 1.1.
Access functions:
State | cameraState () const |
void | setCameraState ( State state ) |
Notifier signal:
void | cameraStateChanged ( QDeclarativeCamera::State state ) |
The resolution to capture the image at. If empty, the system will pick a good size.
This property was introduced in Mobility 1.1.
Access functions:
QSize | captureResolution () const |
void | setCaptureResolution ( const QSize & size ) |
Notifier signal:
void | captureResolutionChanged ( const QSize & resolution ) |
The path to the captured image.
This property was introduced in Mobility 1.1.
Access functions:
QString | capturedImagePath () const |
Notifier signal:
void | imageSaved ( const QString & path ) |
The current digital zoom factor.
This property was introduced in Mobility 1.1.
Access functions:
qreal | digitalZoom () const |
void | setDigitalZoom ( qreal ) |
Notifier signal:
void | digitalZoomChanged ( qreal ) |
A description of the current error, if any.
This property was introduced in Mobility 1.1.
Access functions:
QString | errorString () const |
Notifier signal:
void | errorChanged () |
Adjustment for the automatically calculated exposure. The value is in EV units.
This property was introduced in Mobility 1.1.
Access functions:
qreal | exposureCompensation () const |
void | setExposureCompensation ( qreal ev ) |
Notifier signal:
void | exposureCompensationChanged ( qreal expComp ) |
Camera exposure modes.
This property was introduced in Mobility 1.1.
Access functions:
ExposureMode | exposureMode () const |
void | setExposureMode ( QDeclarativeCamera::ExposureMode ) |
Notifier signal:
void | exposureModeChanged ( QDeclarativeCamera::ExposureMode mode ) |
Value | Description |
---|---|
FlashOff | Flash is Off. |
FlashOn | Flash is On. |
FlashAuto | Automatic flash. |
FlashRedEyeReduction | Red eye reduction flash. |
FlashFill | Use flash to fillin shadows. |
FlashTorch | Constant light source, useful for focusing and video capture. |
FlashSlowSyncFrontCurtain | Use the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect. |
FlashSlowSyncRearCurtain | The similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure. |
FlashManual | Flash power is manually set. |
This property was introduced in Mobility 1.1.
Access functions:
int | flashMode () const |
void | setFlashMode ( int ) |
Notifier signal:
void | flashModeChanged ( int ) |
The sensor's ISO sensitivity.
This property was introduced in Mobility 1.1.
Access functions:
int | isoSensitivity () const |
void | setManualIsoSensitivity ( int iso ) |
Notifier signal:
void | isoSensitivityChanged ( int isoValue ) |
The overall status for all the requested camera locks.
Value | Description |
---|---|
Unlocked | The 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. |
Searching | The 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. |
Locked | The 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 was introduced in Mobility 1.1.
Access functions:
LockStatus | lockStatus () const |
Notifier signal:
void | lockStatusChanged () |
The color temperature used when in manual white balance mode (WhiteBalanceManual).
This property was introduced in Mobility 1.1.
Access functions:
int | manualWhiteBalance () const |
void | setManualWhiteBalance ( int colorTemp ) const |
Notifier signal:
void | manualWhiteBalanceChanged ( int newWhiteBal ) const |
See also whiteBalanceMode.
The maximum digital zoom factor, or 1.0 if digital zoom is not supported.
This property was introduced in Mobility 1.1.
Access functions:
qreal | maximumDigitalZoom () const |
Notifier signal:
void | maximumDigitalZoomChanged ( qreal zoom ) |
The maximum optical zoom factor, or 1.0 if optical zoom is not supported.
This property was introduced in Mobility 1.1.
Access functions:
qreal | maximumOpticalZoom () const |
Notifier signal:
void | maximumOpticalZoomChanged ( qreal ) |
The current optical zoom factor.
This property was introduced in Mobility 1.1.
Access functions:
qreal | opticalZoom () const |
void | setOpticalZoom ( qreal ) |
Notifier signal:
void | opticalZoomChanged ( qreal zoom ) |
The camera's shutter speed, in seconds.
This property was introduced in Mobility 1.1.
Access functions:
qreal | shutterSpeed () const |
Notifier signal:
void | shutterSpeedChanged ( qreal speed ) |
This property was introduced in Mobility 1.1.
Access functions:
WhiteBalanceMode | whiteBalanceMode () const |
void | setWhiteBalanceMode ( QDeclarativeCamera::WhiteBalanceMode mode ) const |
Notifier signal:
void | whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const |
See also WhiteBalanceMode.
Construct a declarative camera object using parent object.
Destructor, clean up memory
Signals the change to a new aperture value.
This function was introduced in Mobility 1.1.
The camera state has changed to value state.
This function was introduced in Mobility 1.1.
This handler is called when an error occurs during capture. A descriptive message is available in message.
This function was introduced in Mobility 1.1.
Start image capture. The onImageCaptured() and onImageSaved() signals will be emitted when the capture is complete.
This function was introduced in Mobility 1.1.
Signal that the resolution has changed to resolution.
This function was introduced in Mobility 1.1.
This function was introduced in Mobility 1.1.
This function was introduced in Mobility 1.1.
Returns any camera error.
This function was introduced in Mobility 1.1.
See also QDeclarativeCamera::Error.
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.
Value | Description |
---|---|
NoError | No errors have occurred. |
CameraError | An error has occurred. |
InvalidRequestError | System resource doesn't support requested functionality. |
ServiceMissingError | No camera service available. |
NotSupportedFeatureError | The feature is not supported. |
This function was introduced in Mobility 1.1.
See also QDeclarativeCamera::Error.
This function was introduced in Mobility 1.1.
Compensation has changed to the new value expComp.
This function was introduced in Mobility 1.1.
Signals that the exposure mode is now mode.
This function was introduced in Mobility 1.1.
This function was introduced in Mobility 1.1.
Reimplemented from QDeclarativeItem::geometryChanged().
Change viewfinder size to newGeometry and returning the oldGeometry
This function was introduced in Mobility 1.1.
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 function was introduced in Mobility 1.1.
See also imageSaved().
This handler is called after the image has been written to the filesystem. The path is a local file path, not a URL.
This function was introduced in Mobility 1.1.
See also imageCaptured().
The iso value has changed to isoValue.
This function was introduced in Mobility 1.1.
Reimplemented from QGraphicsItem::keyPressEvent().
Handler for keypress events. The event is compared to a small set of events.
This function was introduced in Mobility 1.1.
Reimplemented from QGraphicsItem::keyReleaseEvent().
Handle the release of a key in event and take action if needed.
This function was introduced in Mobility 1.1.
This function was introduced in Mobility 1.1.
Indicates that the white balance has been manually changed to newWhiteBal.
This function was introduced in Mobility 1.1.
The maximum digital zoom is now zoom.
This function was introduced in Mobility 1.1.
Optical zoom changed to zoom.
This function was introduced in Mobility 1.1.
Reimplemented from QGraphicsItem::paint().
Paint method. Takes a painter object, a graphics style option and a widget
This function was introduced in Mobility 1.1.
Start focusing, exposure and white balance calculation. If the camera has keyboard focus, searchAndLock() is called automatically when the camera focus button is pressed.
This function was introduced in Mobility 1.1.
The shutter speed has been changed to speed.
This function was introduced in Mobility 1.1.
Starts the camera.
This function was introduced in Mobility 1.1.
Stops the camera.
This function was introduced in Mobility 1.1.
Unlock focus.
If the camera has keyboard focus, unlock() is called automatically when the camera focus button is released.
This function was introduced in Mobility 1.1.
This function was introduced in Mobility 1.1.