summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfuturewatcher.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-06-02 10:48:06 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2020-06-04 22:32:43 +0200
commit37cfc3c6d2e3b290c7fc41cd7545283d24e4433c (patch)
tree91d3900ae5c113639467f3f47bd5217c42e29c2c /src/corelib/thread/qfuturewatcher.h
parent036c3c19e7da5f1a280750d3c68a0cff38678029 (diff)
Deprecate the pause-related APIs of QFuture* classes
Deprecated the pause-related APIs of QFuture* classes and added alternatives having "suspend" in the name instead. With 2f15927f01ceef0aca490746302a5ea57ea9441c new isSuspended()/suspended() APIs have been added to QFuture* classes for checking if pause/suspension is still in progress or it already took effect. To keep the naming more consistent, renamed: - setPaused() -> setSuspended() - pause() -> suspend() - togglePaused() -> toggleSuspended() - QFutureWatcher::paused() -> QFutureWatcher::suspending() Note that QFuture*::isPaused() now corresponds to (isSuspending() || isSuspended()). [ChangeLog][Deprecation Notice] Deprecated pause-related APIs of QFuture and QFutureWatcher. Added alternatives having "suspend" in the name instead. Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/corelib/thread/qfuturewatcher.h')
-rw-r--r--src/corelib/thread/qfuturewatcher.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/corelib/thread/qfuturewatcher.h b/src/corelib/thread/qfuturewatcher.h
index 0c8c1ec247..d2b8eeace1 100644
--- a/src/corelib/thread/qfuturewatcher.h
+++ b/src/corelib/thread/qfuturewatcher.h
@@ -69,7 +69,11 @@ public:
bool isFinished() const;
bool isRunning() const;
bool isCanceled() const;
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED_VERSION_X_6_0("Use isSuspending() or isSuspended() instead.")
bool isPaused() const;
+#endif
+ bool isSuspending() const;
bool isSuspended() const;
void waitForFinished();
@@ -82,7 +86,11 @@ Q_SIGNALS:
void started();
void finished();
void canceled();
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED_VERSION_X_6_0("Use suspending() instead.")
void paused();
+#endif
+ void suspending();
void suspended();
void resumed();
void resultReadyAt(int resultIndex);
@@ -93,10 +101,21 @@ Q_SIGNALS:
public Q_SLOTS:
void cancel();
+ void setSuspended(bool suspend);
+ void suspend();
+ void resume();
+ void toggleSuspended();
+
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED_VERSION_X_6_0("Use setSuspended() instead.")
void setPaused(bool paused);
+
+ QT_DEPRECATED_VERSION_X_6_0("Use suspended() instead.")
void pause();
- void resume();
+
+ QT_DEPRECATED_VERSION_X_6_0("Use toggleSuspended() instead.")
void togglePaused();
+#endif
protected:
void connectNotify (const QMetaMethod &signal) override;
@@ -148,8 +167,11 @@ public:
bool isFinished() const;
bool isRunning() const;
bool isCanceled() const;
+#if QT_DEPRECATED_SINCE(6, 0)
bool isPaused() const;
- bool isSuspended() const
+#endif
+ bool isSuspending() const;
+ bool isSuspended() const;
void waitForFinished();
@@ -159,7 +181,10 @@ Q_SIGNALS:
void started();
void finished();
void canceled();
+#if QT_DEPRECATED_SINCE(6, 0)
void paused();
+#endif
+ void suspending();
void suspended();
void resumed();
void resultReadyAt(int resultIndex);
@@ -170,11 +195,17 @@ Q_SIGNALS:
public Q_SLOTS:
void cancel();
+ void setSuspended(bool suspend);
+ void suspend();
+ void resume();
+ void toggleSuspended();
+#if QT_DEPRECATED_SINCE(6, 0)
void setPaused(bool paused);
void pause();
- void resume();
void togglePaused();
-#endif
+#endif // QT_DEPRECATED_SINCE(6, 0)
+
+#endif // Q_QDOC
private:
QFuture<T> m_future;