summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-03-01 09:47:48 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-03-01 09:16:24 +0000
commit03e1c18f78c1103e149d7daee76ec070c8b001cf (patch)
treeff1b88167df963aa759fc9b56d13dec826acb816
parent745de1b34d27e44bc9a2792456ea057981ddbc7d (diff)
downloadqt-creator-03e1c18f78c1103e149d7daee76ec070c8b001cf.tar.gz
Qt Designer Custom Widget wizard: Generate XML as raw string literal
It makes it easier to customize it later on. Change-Id: Ie4ac7830a5544746d621b5ba34d174b3f8e3676a Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp
index 8afff94d74..06790ac547 100644
--- a/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp
+++ b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp
@@ -60,7 +60,7 @@ bool @PLUGIN_CLASS@::isContainer() const
QString @PLUGIN_CLASS@::domXml() const
{
- return QLatin1String("@WIDGET_DOMXML@");
+ return QLatin1String(@WIDGET_DOMXML@);
}
QString @PLUGIN_CLASS@::includeFile() const
diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
index 4f0d460483..28e67ec3ec 100644
--- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
+++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
@@ -114,7 +114,8 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara
sm.insert(QLatin1String("WIDGET_TOOLTIP"), cStringQuote(wo.toolTip));
sm.insert(QLatin1String("WIDGET_WHATSTHIS"), cStringQuote(wo.whatsThis));
sm.insert(QLatin1String("WIDGET_ISCONTAINER"), wo.isContainer ? QLatin1String("true") : QLatin1String("false"));
- sm.insert(QLatin1String("WIDGET_DOMXML"), cStringQuote(wo.domXml));
+ sm.insert(QLatin1String("WIDGET_DOMXML"), QLatin1String("R\"(")
+ + wo.domXml.trimmed() + QLatin1String(")\""));
const QString pluginSourceContents = processTemplate(p.templatePath + QLatin1String("/tpl_single.cpp"), sm, errorMessage);
if (pluginSourceContents.isEmpty())