summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qkeysequence.cpp
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2022-05-19 10:41:02 +0200
committerMarc Mutz <[email protected]>2022-06-02 07:24:22 +0200
commitbc922223cf11eae34a5e7ad311258da1c030124f (patch)
tree371c8452f55f728e111873e11a7bae29c7924dab /src/gui/kernel/qkeysequence.cpp
parentdface5814256769f02776b06705c33c0dd13a3e1 (diff)
QKeySequence: constinit ALL the things
C++20 constinit acts as a static_assertion that the initialiation of the object doesn't incur runtime initialization overhead. Task-number: QTBUG-100486 Change-Id: I818f5ca9703273cd41e44e5ce7085cb5c643ca8e Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Laszlo Papp <[email protected]> Reviewed-by: Giuseppe D'Angelo <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src/gui/kernel/qkeysequence.cpp')
-rw-r--r--src/gui/kernel/qkeysequence.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 2507f8720a6..c415a95ab9e 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#if defined(Q_OS_MACOS) || defined(Q_CLANG_QDOC)
-static bool qt_sequence_no_mnemonics = true;
+Q_CONSTINIT static bool qt_sequence_no_mnemonics = true;
struct MacSpecialKey {
int key;
ushort macSymbol;
@@ -117,7 +117,7 @@ static int qtkeyForMacSymbol(const QChar ch)
}
#else
-static bool qt_sequence_no_mnemonics = false;
+Q_CONSTINIT static bool qt_sequence_no_mnemonics = false;
#endif
/*!
@@ -797,7 +797,7 @@ QKeySequence::QKeySequence(StandardKey key)
*/
QKeySequence::QKeySequence()
{
- static QKeySequencePrivate shared_empty;
+ Q_CONSTINIT static QKeySequencePrivate shared_empty;
d = &shared_empty;
d->ref.ref();
}