From 01a5f9cfc7f2cbe857fbb5421ba4e119ab0dc7fc Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@theqtcompany.com> Date: Thu, 4 Jun 2015 16:25:38 +0200 Subject: [PATCH] MacroExpander: Allow "comment" expansion %{#: is now treated as a comment and expands to an empty string } This is useful to add comments about copyright, etc. into the wizard templates. Change-Id: I6e25c724edfa4b865d2d4f74b0f4900982d9ea47 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com> --- src/plugins/coreplugin/coreplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index e4903e8d19e..906394e9eaa 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -211,6 +211,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."), [](const QString &fmt) { return QTime::currentTime().toString(fmt); }); + expander->registerPrefix("#:", tr("A comment."), [](const QString &) { return QStringLiteral(""); }); + // Make sure all wizards are there when the user might access the keyboard shortcuts: connect(ICore::instance(), &ICore::optionsDialogRequested, []() { IWizardFactory::allWizardFactories(); }); -- GitLab