diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 31f47223adf..35b3269e8d3 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -40,6 +40,7 @@ #include #include +#include #include using QtSupport::QtVersionManager; @@ -309,6 +310,16 @@ QStringList ExamplesListModel::exampleSources(QString *examplesFallback, QString QStringList sources; QString resourceDir = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/"); + // overriding examples with a custom XML file + QString exampleFileEnvKey = QLatin1String("QTC_EXAMPLE_FILE"); + if (Utils::Environment::systemEnvironment().hasKey(exampleFileEnvKey)) { + QString filePath = Utils::Environment::systemEnvironment().value(exampleFileEnvKey); + if (filePath.endsWith(QLatin1String(".xml")) && QFileInfo(filePath).exists()) { + sources.append(filePath); + return sources; + } + } + // Qt Creator shipped tutorials sources << (resourceDir + QLatin1String("/qtcreator_tutorials.xml"));