Skip to content
Snippets Groups Projects
Commit a9fdb868 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Added fall-back for the QML viewer to first check if there is one bundled with Qt Creator.

parent 9ec8bc89
No related branches found
No related tags found
No related merge requests found
......@@ -491,8 +491,19 @@ void QmlRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReade
m_qmlViewerArgs = reader.restoreValue(QLatin1String("qmlviewerargs")).toString();
m_scriptFile = reader.restoreValue(QLatin1String("mainscript")).toString();
if (m_qmlViewer.isEmpty())
m_qmlViewer = Utils::SynchronousProcess::locateBinary(QLatin1String("qmlviewer"));
if (m_qmlViewer.isEmpty()) {
// first see if there is a bundled qmlviewer
#ifdef Q_OS_WIN32
const QLatin1String qmlViewerExe("qmlviewer.exe");
#else
const QLatin1String qmlViewerExe("qmlviewer");
#endif
const QFileInfo info(QCoreApplication::applicationDirPath(), qmlViewerExe);
if (info.exists() && info.isExecutable())
m_qmlViewer = info.absoluteFilePath();
else // if not, then try to locate it elsewhere
m_qmlViewer = Utils::SynchronousProcess::locateBinary(QLatin1String("qmlviewer"));
}
if (m_scriptFile.isEmpty())
m_scriptFile = tr("<Current File>");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment