Fix enums for QML camera types.

CameraExposure, CameraFlash and CameraFocus had signals and functions
using enum-type arguments declared in QDeclarativeCamera. This doesn't
work since an enum and a function using it both need to be declared in
the same class in order to work from QML.
The relevant enums have been duplicated (not moved, in order to
preserve QML source compatibility) from QDeclarativeCamera to
QDeclarativeCameraExposure, QDeclarativeCameraFlash and
QDeclarativeCameraFocus.

Change-Id: Ib307d7c6c9dbc59b1b82782913397160be38d4cd
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2014-03-13 18:07:12 +01:00
committed by The Qt Project
parent 904881d4a3
commit 4aeda4943e
6 changed files with 98 additions and 41 deletions

View File

@@ -64,19 +64,34 @@ class QDeclarativeCameraFlash : public QObject
{
Q_OBJECT
Q_PROPERTY(bool ready READ isFlashReady NOTIFY flashReady)
Q_PROPERTY(int mode READ flashMode WRITE setFlashMode NOTIFY flashModeChanged)
Q_PROPERTY(FlashMode mode READ flashMode WRITE setFlashMode NOTIFY flashModeChanged)
Q_ENUMS(FlashMode)
public:
enum FlashMode {
FlashAuto = QCameraExposure::FlashAuto,
FlashOff = QCameraExposure::FlashOff,
FlashOn = QCameraExposure::FlashOn,
FlashRedEyeReduction = QCameraExposure::FlashRedEyeReduction,
FlashFill = QCameraExposure::FlashFill,
FlashTorch = QCameraExposure::FlashTorch,
FlashVideoLight = QCameraExposure::FlashVideoLight,
FlashSlowSyncFrontCurtain = QCameraExposure::FlashSlowSyncFrontCurtain,
FlashSlowSyncRearCurtain = QCameraExposure::FlashSlowSyncRearCurtain,
FlashManual = QCameraExposure::FlashManual
};
~QDeclarativeCameraFlash();
int flashMode() const;
FlashMode flashMode() const;
bool isFlashReady() const;
public Q_SLOTS:
void setFlashMode(int);
void setFlashMode(FlashMode);
Q_SIGNALS:
void flashReady(bool status);
void flashModeChanged(int);
void flashModeChanged(FlashMode);
private:
friend class QDeclarativeCamera;