forked from qt-creator/qt-creator
MacroExpander: Add a way to generate a new UUID
Change-Id: I5c43419f717d84bd9954a4921eb6e6723d331646 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -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(""); });
|
||||
|
||||
|
Reference in New Issue
Block a user