summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-17 12:51:26 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-18 02:09:11 +0200
commit9a94c4a415179377197f02580ea8fbcb0c5ce517 (patch)
treeba9cb9bf07668dccd922d9474b008714240d9892 /src/corelib/global/qglobal.cpp
parent8b8ff64be273d9e74ac64d7efd1d5f6b2c70d362 (diff)
Long live qToUnderlying
"Cherry-pick" of C++2b's std::to_underlying. [ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been added, to convert an value of enumeration type to its underlying value. Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9f18e9a894..b320faa72f 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3878,6 +3878,15 @@ bool qunsetenv(const char *varName)
*/
/*!
+ \fn template <typename Enum> std::underlying_type_t<Enum> qToUnderlying(Enum e)
+ \relates <QtGlobal>
+ \since 6.2
+
+ Converts the enumerator \e to the equivalent value expressed in its
+ enumeration's underlying type.
+*/
+
+/*!
\macro QT_TR_NOOP(sourceText)
\relates <QtGlobal>