summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-26 22:43:05 +0300
committerMarc Mutz <marc.mutz@kdab.com>2019-08-10 22:13:49 +0200
commitc58ca4256d881ffed865602fd3da8efb6ebc9d5f (patch)
tree2619858d2e21ebee531d8c9e2a7af39e23683fca /src/corelib/global
parentb7d073e9905bf9812ba96cecdcf6871a95517d30 (diff)
Deprecate QStringViewLiteral
As a macro, we can't directly deprecate it, but need to make it call something deprecated. That is a new ctor with a new enum type added. The type might be useful for other such ventures, so put it into qglobal.h Remove the QT_NO_UNICODE_LITERAL protection, as it's always false these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20 lines above. [ChangeLog][QtCore][QStringView] Deprecated the (undocumented) QStringViewLiteral macro. Just use u"" or QStringView(u"") instead. Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 77ca63803f..303b240a54 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -382,6 +382,14 @@ typedef double qreal;
#define QT_DEPRECATED_VERSION_5(minor) QT_DEPRECATED_VERSION_5_##minor
#define QT_DEPRECATED_VERSION(major, minor) QT_DEPRECATED_VERSION_##major(minor)
+#ifdef __cplusplus
+// A tag to help mark stuff deprecated (cf. QStringViewLiteral)
+namespace QtPrivate {
+enum class Deprecated_t {};
+constexpr Q_DECL_UNUSED Deprecated_t Deprecated = {};
+}
+#endif
+
/*
The Qt modules' export macros.
The options are: