forked from qt-creator/qt-creator
Core: Add the "resourcePath" to the global macro expander
Example use case: Multiple wizard json files want to reference a shared resource file without using fragile relative paths. Change-Id: I2502083d4c371c25a8b66e7d5d3b4fb9d8697317 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -193,6 +193,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
[]() { return QVariant(Utils::HostOsInfo::isLinuxHost()).toString(); });
|
[]() { return QVariant(Utils::HostOsInfo::isLinuxHost()).toString(); });
|
||||||
expander->registerVariable("HostOs:isUnix", tr("Is Qt Creator running on any unix-based platform?"),
|
expander->registerVariable("HostOs:isUnix", tr("Is Qt Creator running on any unix-based platform?"),
|
||||||
[]() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); });
|
[]() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); });
|
||||||
|
expander->registerVariable("IDE:ResourcePath", tr("The directory where Qt Creator finds its pre-installed resources."),
|
||||||
|
[]() { return ICore::resourcePath(); });
|
||||||
expander->registerPrefix("CurrentDate:", tr("The current date (QDate formatstring)."),
|
expander->registerPrefix("CurrentDate:", tr("The current date (QDate formatstring)."),
|
||||||
[](const QString &fmt) { return QDate::currentDate().toString(fmt); });
|
[](const QString &fmt) { return QDate::currentDate().toString(fmt); });
|
||||||
expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."),
|
expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."),
|
||||||
|
|||||||
Reference in New Issue
Block a user