From d57879c3e2fde7a4992d6c2c171e2e3ae3f91b35 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 26 Feb 2021 16:36:47 +0100 Subject: Remove QCameraFocus::focusPointMode property It doesn't make a whole lot of sense to have this. The only thing that we can properly support is setting a focus point, but that doesn't require all the additional API here. Add support for retrieving the current focus point of the camera if the camera support it. Change-Id: I3ef31db8f0bfeb9d7e5d4e84ee8614637779a2c5 Reviewed-by: Doris Verria Reviewed-by: Lars Knoll --- src/imports/multimedia/qdeclarativecamerafocus.cpp | 80 ++-------------------- 1 file changed, 4 insertions(+), 76 deletions(-) (limited to 'src/imports/multimedia/qdeclarativecamerafocus.cpp') diff --git a/src/imports/multimedia/qdeclarativecamerafocus.cpp b/src/imports/multimedia/qdeclarativecamerafocus.cpp index 02d4995be..0a50b12f8 100644 --- a/src/imports/multimedia/qdeclarativecamerafocus.cpp +++ b/src/imports/multimedia/qdeclarativecamerafocus.cpp @@ -68,7 +68,6 @@ QT_BEGIN_NAMESPACE focus { focusMode: Camera.FocusMacro - focusPointMode: Camera.FocusPointCustom customFocusPoint: Qt.point(0.2, 0.2) // Focus relative to top-left corner } } @@ -104,7 +103,6 @@ QDeclarativeCameraFocus::QDeclarativeCameraFocus(QCamera *camera, QObject *paren } emit supportedFocusModeChanged(); - emit supportedFocusPointModesChanged(); }); } @@ -114,9 +112,8 @@ QDeclarativeCameraFocus::~QDeclarativeCameraFocus() = default; This property holds the current camera focus mode. - In automatic focusing modes, the \l focusPointMode - property provides information and control - over how automatic focusing is performed. + In automatic focusing modes, the \l focusPoint + property provides a hint on where the camera should focus. */ /*! @@ -149,9 +146,9 @@ QDeclarativeCameraFocus::~QDeclarativeCameraFocus() = default; \li Manual or fixed focus mode. \endtable - In automatic focusing modes, the \l focusPointMode property + In automatic focusing modes, the \l focusPoint property provides information and control - over how automatic focusing is performed. + over the area of the image that is being focused. */ QDeclarativeCameraFocus::FocusMode QDeclarativeCameraFocus::focusMode() const { @@ -185,75 +182,6 @@ void QDeclarativeCameraFocus::setFocusMode(QDeclarativeCameraFocus::FocusMode mo emit focusModeChanged(focusMode()); } } -/*! - \property QDeclarativeCameraFocus::focusPointMode - - This property holds the current camera focus point mode. It is used in - automatic focusing modes to determine what to focus on. - - If the current focus point mode is \l QCameraFocus::FocusPointCustom, the - \l customFocusPoint property allows you to specify which part of - the frame to focus on. -*/ -/*! - \qmlproperty enumeration CameraFocus::focusPointMode - - This property holds the current camera focus point mode. It is used in automatic - focusing modes to determine what to focus on. If the current - focus point mode is \c Camera.FocusPointCustom, the \l customFocusPoint - property allows you to specify which part of the frame to focus on. - - The property can take one of the following values: - \table - \header - \li Value - \li Description - \row - \li FocusPointAuto - \li Automatically select one or multiple focus points. - \row - \li FocusPointCenter - \li Focus to the frame center. - \row - \li FocusPointFaceDetection - \li Focus on faces in the frame. - \row - \li FocusPointCustom - \li Focus to the custom point, defined by the customFocusPoint property. - \endtable -*/ -QDeclarativeCameraFocus::FocusPointMode QDeclarativeCameraFocus::focusPointMode() const -{ - return QDeclarativeCameraFocus::FocusPointMode(m_focus->focusPointMode()); -} - -/*! - \qmlproperty list CameraFocus::supportedFocusPointModes - - This property holds the supported focus point modes of the camera. - - \since 5.10 - \sa focusPointMode -*/ -QVariantList QDeclarativeCameraFocus::supportedFocusPointModes() const -{ - QVariantList supportedModes; - - for (int i = int(FocusPointAuto); i <= int(FocusPointCustom); i++) { - if (m_focus->isFocusPointModeSupported(QCameraFocus::FocusPointMode(i))) - supportedModes.append(i); - } - - return supportedModes; -} - -void QDeclarativeCameraFocus::setFocusPointMode(QDeclarativeCameraFocus::FocusPointMode mode) -{ - if (mode != focusPointMode()) { - m_focus->setFocusPointMode(QCameraFocus::FocusPointMode(mode)); - emit focusPointModeChanged(focusPointMode()); - } -} /*! \property QDeclarativeCameraFocus::customFocusPoint -- cgit v1.2.3