summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-03-17 20:50:04 +0100
committerTopi Reinio <topi.reinio@qt.io>2020-03-26 15:27:28 +0100
commitbd9a13b370c65f889da1d42852d8107915edd977 (patch)
treeed81ce1c636d7de7d2a9c355da65c808dc6359dd /src
parent737e7524e8992f508e3f6e57010c81b257c5e994 (diff)
Doc: Fix \fn command for qScopeGuard(F &&f)
and tag it in the header file to ensure the documentation is matched. Change-Id: Id1e7cd395ca0ec337845da9a207bfbf95db01064 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qscopeguard.h1
-rw-r--r--src/corelib/tools/qscopeguard.qdoc2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qscopeguard.h b/src/corelib/tools/qscopeguard.h
index 6a5bc6cc61..d288fd63fc 100644
--- a/src/corelib/tools/qscopeguard.h
+++ b/src/corelib/tools/qscopeguard.h
@@ -96,6 +96,7 @@ private:
template <typename F> QScopeGuard(F(&)()) -> QScopeGuard<F(*)()>;
#endif
+//! [qScopeGuard]
template <typename F>
#if __has_cpp_attribute(nodiscard)
Q_REQUIRED_RESULT
diff --git a/src/corelib/tools/qscopeguard.qdoc b/src/corelib/tools/qscopeguard.qdoc
index 572934d890..b36299d296 100644
--- a/src/corelib/tools/qscopeguard.qdoc
+++ b/src/corelib/tools/qscopeguard.qdoc
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename F> const QScopeGuard<F> qScopeGuard(F f)
+ \fn [qScopeGuard] template <typename F> QScopeGuard<typename std::decay<F>::type> qScopeGuard(F &&f)
\inmodule QtCore
\relates QScopeGuard
\brief The qScopeGuard function can be used to call a function at the end