summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/coreplugin.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-11-30 14:55:40 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-11-30 15:49:25 +0000
commit09102ddc7b8a848ddd2df3cf9d0d2b9413966deb (patch)
treef23361d9875c7e88530f79362bc80d1577b3ec12 /src/plugins/coreplugin/coreplugin.cpp
parent62e9d51c46362f5eea1d5d5b86119d3faf5ed07d (diff)
downloadqt-creator-09102ddc7b8a848ddd2df3cf9d0d2b9413966deb.tar.gz
MacroExpander: Add a way to generate a new UUID
Change-Id: I5c43419f717d84bd9954a4921eb6e6723d331646 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/coreplugin/coreplugin.cpp')
-rw-r--r--src/plugins/coreplugin/coreplugin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index 0e5c60f07e..849cfa7b7c 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -61,6 +61,7 @@
#include <QDebug>
#include <QDateTime>
#include <QMenu>
+#include <QUuid>
using namespace Core;
using namespace Core::Internal;
@@ -204,6 +205,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
[](const QString &fmt) { return QDate::currentDate().toString(fmt); });
expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."),
[](const QString &fmt) { return QTime::currentTime().toString(fmt); });
+ expander->registerVariable("UUID", tr("Generate a new UUID."),
+ []() { return QUuid::createUuid().toString(); });
expander->registerPrefix("#:", tr("A comment."), [](const QString &) { return QStringLiteral(""); });