diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-04-27 11:50:24 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-04-27 22:55:28 +0000 |
commit | 357ca7d90a927b2f26139f30e59fcef36dca917d (patch) | |
tree | 33f411f0f6bf4dfd5cab200f106b3bdaeb07730d /src/corelib/thread/qrunnable.cpp | |
parent | ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d (diff) |
Tighten template on new QRunnable create method
Only instantiate with object/methods that are invokable with void and
returns void.
Change-Id: Iab2e43bb8e061e3875a6cca8e06ebbfbfa9e6fe8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/thread/qrunnable.cpp')
-rw-r--r-- | src/corelib/thread/qrunnable.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp index 718802010a..068dc1af2a 100644 --- a/src/corelib/thread/qrunnable.cpp +++ b/src/corelib/thread/qrunnable.cpp @@ -78,13 +78,16 @@ QRunnable::~QRunnable() */ /*! - \fn template<typename Callable> QRunnable *QRunnable::create(Callable &&callableToRun); + \fn template<typename Callable, if_callable<Callable>> QRunnable *QRunnable::create(Callable &&callableToRun); \since 5.15 Creates a QRunnable that calls \a callableToRun in run(). Auto-deletion is enabled by default. + \note This function participates in overload resolution only if \c Callable + is a function or function object which can be called with zero arguments. + \note In Qt versions prior to 6.6, this method took copyable functions only. \sa run(), autoDelete() |