summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qnamespace.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-11 20:57:26 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-14 20:58:51 +0200
commita095a999a3904a53e78857759a79a0e8c7d8a474 (patch)
treecffb4b7a44eff0355d2852c9d9db41aa3a36e988 /src/corelib/global/qnamespace.h
parenta8dc2a5b6dda85d63dd8f9f7570069df008941c6 (diff)
Long live Q_IMPLICIT!
C++20 will give us explicit(bool). While we can't use it just yet in its full potential, we can introduce a macro to start marking our implicit conversions (aka `explicit(false)`), removing the need for /* implicit */-like comments. Port a few usages to it. Change-Id: I336d5e4c8d51d8329627900d1059e59062c5cafd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global/qnamespace.h')
-rw-r--r--src/corelib/global/qnamespace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 2cbe482fd4..d19f50512a 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1873,7 +1873,7 @@ class QKeyCombination
int combination;
public:
- constexpr /* implicit */ QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
+ constexpr Q_IMPLICIT QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
: combination(int(key))
{}
@@ -1909,7 +1909,7 @@ public:
#if QT_DEPRECATED_SINCE(6, 0)
QT_DEPRECATED_VERSION_X(6, 0, "Use QKeyCombination instead of int")
- constexpr /* implicit */ operator int() const noexcept
+ constexpr Q_IMPLICIT operator int() const noexcept
{
return combination;
}