diff options
author | hjk <hjk@qt.io> | 2023-01-18 17:26:08 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-02-20 18:06:33 +0100 |
commit | 7b1ba955a6da3d4414fa206ec1c06c1fc6e16161 (patch) | |
tree | 1b9602f27e8ef3fa6effd858c1d145e36f4165b4 /src/tools/uic/main.cpp | |
parent | b74db90be055904c43953695e51b216100de71bb (diff) |
uic: Add a -no-qt-namespace option
To suppress the generation of the Ui class within QT_BEGIN_NAMESPACE
and QT_END_NAMESPACE.
Change-Id: I6552b41d8e9eccb0475618d7ed7f7cea7f826625
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/tools/uic/main.cpp')
-rw-r--r-- | src/tools/uic/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/uic/main.cpp b/src/tools/uic/main.cpp index 8728212f35..d46b788419 100644 --- a/src/tools/uic/main.cpp +++ b/src/tools/uic/main.cpp @@ -93,6 +93,11 @@ int runUic(int argc, char *argv[]) postfixOption.setValueName(u"postfix"_s); parser.addOption(postfixOption); + QCommandLineOption noQtNamespaceOption(u"no-qt-namespace"_s); + noQtNamespaceOption.setDescription( + u"Disable wrapping the definition of the generated class in QT_{BEGIN,END}_NAMESPACE."_s); + parser.addOption(noQtNamespaceOption); + QCommandLineOption translateOption(QStringList{u"tr"_s, u"translate"_s}); translateOption.setDescription(u"Use <function> for i18n."_s); translateOption.setValueName(u"function"_s); @@ -149,6 +154,7 @@ int runUic(int argc, char *argv[]) driver.option().autoConnection = !parser.isSet(noAutoConnectionOption); driver.option().headerProtection = !parser.isSet(noProtOption); driver.option().implicitIncludes = !parser.isSet(noImplicitIncludesOption); + driver.option().qtNamespace = !parser.isSet(noQtNamespaceOption); driver.option().idBased = parser.isSet(idBasedOption); driver.option().postfix = parser.value(postfixOption); driver.option().translateFunction = parser.value(translateOption); |