diff options
| author | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-06-02 10:48:06 +0200 |
|---|---|---|
| committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-06-04 22:32:43 +0200 |
| commit | 37cfc3c6d2e3b290c7fc41cd7545283d24e4433c (patch) | |
| tree | 91d3900ae5c113639467f3f47bd5217c42e29c2c /src/corelib/thread/qfuture.h | |
| parent | 036c3c19e7da5f1a280750d3c68a0cff38678029 (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/qfuture.h')
| -rw-r--r-- | src/corelib/thread/qfuture.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h index 4f9ba0bd6bf..dc8e0d1d2d2 100644 --- a/src/corelib/thread/qfuture.h +++ b/src/corelib/thread/qfuture.h @@ -109,12 +109,31 @@ public: void cancel() { d.cancel(); } bool isCanceled() const { return d.isCanceled(); } - void setPaused(bool paused) { d.setPaused(paused); } - bool isPaused() const { return d.isPaused(); } +#if QT_DEPRECATED_SINCE(6, 0) + QT_DEPRECATED_VERSION_X_6_0("Use setSuspended() instead.") + void setPaused(bool paused) { d.setSuspended(paused); } + + QT_DEPRECATED_VERSION_X_6_0("Use isSuspending() or isSuspended() instead.") + bool isPaused() const + { +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED + return d.isPaused(); +QT_WARNING_POP + } + + QT_DEPRECATED_VERSION_X_6_0("Use toggleSuspended() instead.") + void togglePaused() { d.toggleSuspended(); } + + QT_DEPRECATED_VERSION_X_6_0("Use suspend() instead.") + void pause() { suspend(); } +#endif + bool isSuspending() const { return d.isSuspending(); } bool isSuspended() const { return d.isSuspended(); } - void pause() { setPaused(true); } - void resume() { setPaused(false); } - void togglePaused() { d.togglePaused(); } + void setSuspended(bool suspend) { d.setSuspended(suspend); } + void suspend() { setSuspended(true); } + void resume() { setSuspended(false); } + void toggleSuspended() { d.toggleSuspended(); } bool isStarted() const { return d.isStarted(); } bool isFinished() const { return d.isFinished(); } |
