summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-03-05 11:31:09 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-03 17:17:11 +0200
commitfdac1e22053f4144be0c4c501e6396cd873dd158 (patch)
tree8ba7af2c2dcd5cc5482d8aee7e2317ab1efe4902 /src/tools/rcc
parente23ea6a5d3bf09921bb98150a4f0f504e77ef4a3 (diff)
Add support for using an inline namespaces for -qtnamespace
Inline namespaces serve the purpose for which the original -qtnamespace option was added and allow for macro simplification (no need for any using directives). This makes it possible to use namespaced builds of Qt also for Qt for Python and similar use cases which have issues with the additional namespace. [ChangeLog][QtCore] It is now possible to use an inline namespace for -qtnamespace (option -qtinlinenamespace). Task-number: PYSIDE-2590 Change-Id: Ia0cecf041321933a2e02d1fd8ae0e9cda699cd1e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/tools/rcc')
-rw-r--r--src/tools/rcc/rcc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 14c4979b6d..444e9c4ae5 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -1382,7 +1382,9 @@ bool RCCResourceLibrary::writeInitializer()
"# define QT_RCC_MANGLE_NAMESPACE(name) name\n"
"#endif\n\n");
- writeString("#ifdef QT_NAMESPACE\n"
+ writeString("#if defined(QT_INLINE_NAMESPACE)\n"
+ "inline namespace QT_NAMESPACE {\n"
+ "#elif defined(QT_NAMESPACE)\n"
"namespace QT_NAMESPACE {\n"
"#endif\n\n");
}