Skip to content
Snippets Groups Projects
Commit d5326f37 authored by Kai Koehne's avatar Kai Koehne
Browse files

Pass library paths specified in .qmlproject file on to qmlviewer

parent 85773474
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,14 @@ QStringList QmlProject::files() const
return files;
}
QStringList QmlProject::libraryPaths() const
{
QStringList libraryPaths;
if (m_projectItem)
libraryPaths = m_projectItem.data()->libraryPaths();
return libraryPaths;
}
void QmlProject::refreshProjectFile()
{
refresh(QmlProject::ProjectFile | Files);
......@@ -403,9 +411,18 @@ QStringList QmlRunConfiguration::viewerArguments() const
{
QStringList args;
// arguments in .user file
if (!m_qmlViewerArgs.isEmpty())
args.append(m_qmlViewerArgs);
// arguments from .qmlproject file
if (qmlProject()) {
foreach (const QString &libraryPath, qmlProject()->libraryPaths()) {
args.append(QLatin1String("-L"));
args.append(libraryPath);
}
}
const QString s = mainScript();
if (! s.isEmpty())
args.append(s);
......@@ -642,7 +659,8 @@ void QmlRunControl::start()
{
m_applicationLauncher.start(ApplicationLauncher::Gui, m_executable, m_commandLineArguments);
emit started();
emit addToOutputWindow(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)));
emit addToOutputWindow(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
m_commandLineArguments.join(QLatin1String(" "))));
}
void QmlRunControl::stop()
......
......@@ -186,6 +186,7 @@ public:
QDir projectDir() const;
QStringList files() const;
QStringList libraryPaths() const;
private slots:
void refreshProjectFile();
......
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