diff options
author | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2012-05-14 11:54:55 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-14 08:37:41 +0200 |
commit | 08d45baac2b56b625194e7b62ce8bff0529218fc (patch) | |
tree | 53f426dfb02469b34943782251513ba49c782de0 /src/imports | |
parent | 112820ef4600e933c43562164813b1e19d74b246 (diff) | |
download | qtmultimedia-08d45baac2b56b625194e7b62ce8bff0529218fc.tar.gz |
Fixed QML Camera errors reporting
Added missing connection to QCamera::error() signal
Added Camera.errorCode property
Change-Id: Ie0dd71d760b4b5b79b2aefaba97bc383ef2a9750
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/multimedia/qdeclarativecamera.cpp | 28 | ||||
-rw-r--r-- | src/imports/multimedia/qdeclarativecamera_p.h | 7 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/imports/multimedia/qdeclarativecamera.cpp b/src/imports/multimedia/qdeclarativecamera.cpp index d00c9d70a..882eac13d 100644 --- a/src/imports/multimedia/qdeclarativecamera.cpp +++ b/src/imports/multimedia/qdeclarativecamera.cpp @@ -57,9 +57,9 @@ QT_BEGIN_NAMESPACE -void QDeclarativeCamera::_q_error(int errorCode, const QString &errorString) +void QDeclarativeCamera::_q_error(QCamera::Error errorCode) { - emit error(Error(errorCode), errorString); + emit error(Error(errorCode), errorString()); emit errorChanged(); } @@ -186,6 +186,7 @@ QDeclarativeCamera::QDeclarativeCamera(QObject *parent) : connect(m_camera, SIGNAL(captureModeChanged(QCamera::CaptureModes)), this, SIGNAL(captureModeChanged())); connect(m_camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)), this, SIGNAL(lockStatusChanged())); connect(m_camera, SIGNAL(stateChanged(QCamera::State)), this, SLOT(_q_updateState(QCamera::State))); + connect(m_camera, SIGNAL(error(QCamera::Error)), this, SLOT(_q_error(QCamera::Error))); // Note we map availabilityError->availability connect(m_camera, SIGNAL(availabilityErrorChanged(QtMultimedia::AvailabilityError)), this, SLOT(_q_availabilityChanged(QtMultimedia::AvailabilityError))); @@ -216,7 +217,7 @@ void QDeclarativeCamera::componentComplete() Returns any camera error. \sa QDeclarativeCameraError::Error */ -QDeclarativeCamera::Error QDeclarativeCamera::error() const +QDeclarativeCamera::Error QDeclarativeCamera::errorCode() const { return QDeclarativeCamera::Error(m_camera->error()); } @@ -513,9 +514,26 @@ void QDeclarativeCamera::setDigitalZoom(qreal value) */ /*! - \qmlsignal QtMultimedia5::Camera::onError(error, errorString) + \qmlproperty enumeration QtMultimedia5::Camera::errorCode - This handler is called when an error occurs. The enumeration value \a error is one of the + Error state of the camera. + + \sa QtMultimedia5::Camera::onError +*/ + +/*! + \qmlproperty string QtMultimedia5::Camera::errorString + + A string describing a camera's error state. + + \sa QtMultimedia5::Camera::onError +*/ + + +/*! + \qmlsignal QtMultimedia5::Camera::onError(errorCode, errorString) + + This handler is called when an error occurs. The enumeration value \a errorCode is one of the values defined below, and a descriptive string value is available in \a errorString. \table diff --git a/src/imports/multimedia/qdeclarativecamera_p.h b/src/imports/multimedia/qdeclarativecamera_p.h index 4850c6a9e..d6155dd30 100644 --- a/src/imports/multimedia/qdeclarativecamera_p.h +++ b/src/imports/multimedia/qdeclarativecamera_p.h @@ -82,6 +82,7 @@ class QDeclarativeCamera : public QObject, public QQmlParserStatus Q_PROPERTY(CaptureMode captureMode READ captureMode WRITE setCaptureMode NOTIFY captureModeChanged) Q_PROPERTY(State cameraState READ cameraState WRITE setCameraState NOTIFY cameraStateChanged) Q_PROPERTY(LockStatus lockStatus READ lockStatus NOTIFY lockStatusChanged) + Q_PROPERTY(Error errorCode READ errorCode NOTIFY errorChanged) Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged) Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged) @@ -220,7 +221,7 @@ public: CaptureMode captureMode() const; State cameraState() const; - Error error() const; + Error errorCode() const; QString errorString() const; LockStatus lockStatus() const; @@ -249,7 +250,7 @@ public Q_SLOTS: Q_SIGNALS: void errorChanged(); - void error(QDeclarativeCamera::Error error, const QString &errorString); + void error(QDeclarativeCamera::Error errorCode, const QString &errorString); void captureModeChanged(); void cameraStateChanged(QDeclarativeCamera::State); @@ -267,7 +268,7 @@ Q_SIGNALS: private Q_SLOTS: void _q_updateState(QCamera::State); - void _q_error(int, const QString &); + void _q_error(QCamera::Error); void _q_availabilityChanged(QtMultimedia::AvailabilityError); protected: |