summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-05-31 20:52:51 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2020-06-04 10:23:10 +0200
commit99cf6a4aed9c48287c46b05cdb4507c0637dd2e1 (patch)
tree571bb8bc0f70d25e7c20a603e87df9dc5f8b1953
parent9c16be3d9d956f612dda431f4883eab3b09a8b67 (diff)
Remove QT_DEPRECATED API
Change-Id: I2aa2334f7408164bf288d82b28e4e6aff9a2503b Fixes: QTBUG-84593 Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--examples/multimediawidgets/camera/camera.cpp2
-rw-r--r--src/imports/multimedia/qdeclarativecamera.cpp1
-rw-r--r--src/imports/multimedia/qdeclarativecamera_p.h3
-rw-r--r--src/imports/multimedia/qdeclarativecamerafocus.cpp28
-rw-r--r--src/imports/multimedia/qdeclarativecamerafocus_p.h5
-rw-r--r--src/multimedia/camera/qcamera.cpp25
-rw-r--r--src/multimedia/camera/qcamera.h8
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp25
8 files changed, 1 insertions, 96 deletions
diff --git a/examples/multimediawidgets/camera/camera.cpp b/examples/multimediawidgets/camera/camera.cpp
index 839227657..d03a1d1dc 100644
--- a/examples/multimediawidgets/camera/camera.cpp
+++ b/examples/multimediawidgets/camera/camera.cpp
@@ -96,7 +96,7 @@ void Camera::setCamera(const QCameraInfo &cameraInfo)
m_camera.reset(new QCamera(cameraInfo));
connect(m_camera.data(), &QCamera::stateChanged, this, &Camera::updateCameraState);
- connect(m_camera.data(), QOverload<QCamera::Error>::of(&QCamera::error), this, &Camera::displayCameraError);
+ connect(m_camera.data(), &QCamera::errorOccurred, this, &Camera::displayCameraError);
m_mediaRecorder.reset(new QMediaRecorder(m_camera.data()));
connect(m_mediaRecorder.data(), &QMediaRecorder::stateChanged, this, &Camera::updateRecorderState);
diff --git a/src/imports/multimedia/qdeclarativecamera.cpp b/src/imports/multimedia/qdeclarativecamera.cpp
index 3a9bc8fa2..c530fbe0b 100644
--- a/src/imports/multimedia/qdeclarativecamera.cpp
+++ b/src/imports/multimedia/qdeclarativecamera.cpp
@@ -61,7 +61,6 @@ QT_BEGIN_NAMESPACE
void QDeclarativeCamera::_q_errorOccurred(QCamera::Error errorCode)
{
- emit error(Error(errorCode), errorString());
emit errorOccurred(Error(errorCode), errorString());
emit errorChanged();
}
diff --git a/src/imports/multimedia/qdeclarativecamera_p.h b/src/imports/multimedia/qdeclarativecamera_p.h
index 41203ac80..51bd5ddf9 100644
--- a/src/imports/multimedia/qdeclarativecamera_p.h
+++ b/src/imports/multimedia/qdeclarativecamera_p.h
@@ -308,9 +308,6 @@ public Q_SLOTS:
Q_SIGNALS:
void errorChanged();
-#if QT_DEPRECATED_SINCE(5,15)
- void error(QDeclarativeCamera::Error errorCode, const QString &errorString);
-#endif
Q_REVISION(15) void errorOccurred(QDeclarativeCamera::Error errorCode, const QString &errorString);
Q_REVISION(1) void deviceIdChanged();
diff --git a/src/imports/multimedia/qdeclarativecamerafocus.cpp b/src/imports/multimedia/qdeclarativecamerafocus.cpp
index 61c22c066..d8fb62d9a 100644
--- a/src/imports/multimedia/qdeclarativecamerafocus.cpp
+++ b/src/imports/multimedia/qdeclarativecamerafocus.cpp
@@ -189,20 +189,6 @@ QVariantList QDeclarativeCameraFocus::supportedFocusModes() const
return supportedModes;
}
-#if QT_DEPRECATED_SINCE(5, 11)
-/*!
- \qmlmethod bool QtMultimedia::CameraFocus::isFocusModeSupported(mode) const
- \obsolete
-
- Returns true if the supplied \a mode is a supported focus mode, and
- false otherwise.
-*/
-bool QDeclarativeCameraFocus::isFocusModeSupported(QDeclarativeCameraFocus::FocusMode mode) const
-{
- return m_focus->isFocusModeSupported(QCameraFocus::FocusModes(int(mode)));
-}
-#endif
-
void QDeclarativeCameraFocus::setFocusMode(QDeclarativeCameraFocus::FocusMode mode)
{
if (mode != focusMode()) {
@@ -280,20 +266,6 @@ void QDeclarativeCameraFocus::setFocusPointMode(QDeclarativeCameraFocus::FocusPo
}
}
-#if QT_DEPRECATED_SINCE(5, 10)
-/*!
- \qmlmethod bool QtMultimedia::CameraFocus::isFocusPointModeSupported(mode) const
- \obsolete
-
- Returns true if the supplied \a mode is a supported focus point mode, and
- false otherwise.
-*/
-bool QDeclarativeCameraFocus::isFocusPointModeSupported(QDeclarativeCameraFocus::FocusPointMode mode) const
-{
- return m_focus->isFocusPointModeSupported(QCameraFocus::FocusPointMode(mode));
-}
-#endif
-
/*!
\property QDeclarativeCameraFocus::customFocusPoint
diff --git a/src/imports/multimedia/qdeclarativecamerafocus_p.h b/src/imports/multimedia/qdeclarativecamerafocus_p.h
index bd5d54d48..df2514f13 100644
--- a/src/imports/multimedia/qdeclarativecamerafocus_p.h
+++ b/src/imports/multimedia/qdeclarativecamerafocus_p.h
@@ -104,11 +104,6 @@ public:
QPointF customFocusPoint() const;
QAbstractListModel *focusZones() const;
-#if QT_DEPRECATED_SINCE(5, 10)
- Q_INVOKABLE bool isFocusModeSupported(FocusMode mode) const;
- Q_INVOKABLE bool isFocusPointModeSupported(FocusPointMode mode) const;
-#endif
-
public Q_SLOTS:
void setFocusMode(FocusMode);
void setFocusPointMode(FocusPointMode mode);
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index 79412b961..b4515cfad 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -110,7 +110,6 @@ void QCameraPrivate::_q_error(int error, const QString &errorString)
this->errorString = errorString;
emit q->errorOccurred(this->error);
- emit q->error(this->error);
}
void QCameraPrivate::setState(QCamera::State newState)
@@ -879,30 +878,6 @@ void QCamera::unload()
d->setState(QCamera::UnloadedState);
}
-#if QT_DEPRECATED_SINCE(5, 3)
-/*!
- Returns a list of camera device's available from the default service provider.
- \deprecated
- \sa QCameraInfo::availableCameras()
-*/
-
-QList<QByteArray> QCamera::availableDevices()
-{
- return QMediaServiceProvider::defaultServiceProvider()->devices(QByteArray(Q_MEDIASERVICE_CAMERA));
-}
-
-/*!
- Returns the description of the \a device.
- \deprecated
- \sa QCameraInfo::availableCameras(), QCameraInfo::description()
-*/
-
-QString QCamera::deviceDescription(const QByteArray &device)
-{
- return QMediaServiceProvider::defaultServiceProvider()->deviceDescription(QByteArray(Q_MEDIASERVICE_CAMERA), device);
-}
-#endif
-
QCamera::State QCamera::state() const
{
return d_func()->state;
diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h
index 97cf4509b..d088e9beb 100644
--- a/src/multimedia/camera/qcamera.h
+++ b/src/multimedia/camera/qcamera.h
@@ -171,11 +171,6 @@ public:
explicit QCamera(QCamera::Position position, QObject *parent = nullptr);
~QCamera();
-#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED static QList<QByteArray> availableDevices();
- QT_DEPRECATED static QString deviceDescription(const QByteArray &device);
-#endif
-
QMultimedia::AvailabilityStatus availability() const override;
State state() const;
@@ -242,9 +237,6 @@ Q_SIGNALS:
void lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason);
void lockStatusChanged(QCamera::LockType lock, QCamera::LockStatus status, QCamera::LockChangeReason reason);
-#if QT_DEPRECATED_SINCE(5,15)
- void error(QCamera::Error);
-#endif
void errorOccurred(QCamera::Error);
private:
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index 068b30653..c49236f43 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -68,10 +68,6 @@ public slots:
void cleanupTestCase();
private slots:
-#if QT_DEPRECATED_SINCE(5, 3)
- void testAvailableDevices();
- void testDeviceDescription();
-#endif
void testCameraInfo();
void testCtorWithDevice();
void testCtorWithCameraInfo();
@@ -102,27 +98,6 @@ void tst_QCameraBackend::cleanupTestCase()
{
}
-#if QT_DEPRECATED_SINCE(5, 3)
-void tst_QCameraBackend::testAvailableDevices()
-{
- int deviceCount = QMediaServiceProvider::defaultServiceProvider()->devices(QByteArray(Q_MEDIASERVICE_CAMERA)).count();
- QCOMPARE(QCamera::availableDevices().count(), deviceCount);
-}
-
-void tst_QCameraBackend::testDeviceDescription()
-{
- int deviceCount = QMediaServiceProvider::defaultServiceProvider()->devices(QByteArray(Q_MEDIASERVICE_CAMERA)).count();
-
- if (deviceCount == 0)
- QVERIFY(QCamera::deviceDescription(QByteArray("random")).isNull());
- else {
- const auto devices = QCamera::availableDevices();
- for (const QByteArray &device : devices)
- QVERIFY(QCamera::deviceDescription(device).length() > 0);
- }
-}
-#endif
-
void tst_QCameraBackend::testCameraInfo()
{
int deviceCount = QMediaServiceProvider::defaultServiceProvider()->devices(QByteArray(Q_MEDIASERVICE_CAMERA)).count();