diff options
author | Ulf Hermann <[email protected]> | 2017-09-27 14:57:05 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2017-09-27 14:22:58 +0000 |
commit | d8a41f27064a1a168c84fcdbe6573581750b536c (patch) | |
tree | 0f5c493ef9c8951fd4a5e911bc8a2de931add1c4 | |
parent | 38d00cc8b66a1ca2cab5199762124c31bcd2c48a (diff) |
QmlProfiler: Add QT_INSTALL_QML paths to FileInProjectFinder
This enables us to find QML files that are part of Qt, also if they are
not in the same location on the host and target systems.
Change-Id: Idcd0be8ae4301000c4123e39edeb04b43efb4659
Reviewed-by: hjk <[email protected]>
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp index fe90e76406f..3bc12296b49 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp @@ -34,6 +34,7 @@ #include <qmljs/parser/qmljsast_p.h> #include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljstools/qmljsmodelmanager.h> +#include <qtsupport/qtkitinformation.h> #include <utils/qtcassert.h> @@ -242,16 +243,21 @@ void QmlProfilerDetailsRewriter::populateFileFinder(const ProjectExplorer::Targe // ... and find the sysroot if we have any target at all. QString activeSysroot; + QStringList additionalSearchDirectories; if (target) { - const ProjectExplorer::Kit *kit = target->kit(); - if (kit && ProjectExplorer::SysRootKitInformation::hasSysRoot(kit)) - activeSysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString(); + if (const ProjectExplorer::Kit *kit = target->kit()) { + if (ProjectExplorer::SysRootKitInformation::hasSysRoot(kit)) + activeSysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString(); + if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit)) + additionalSearchDirectories.append(qtVersion->qmakeProperty("QT_INSTALL_QML")); + } } // Finally, do populate m_projectFinder m_projectFinder.setProjectDirectory(projectDirectory); m_projectFinder.setProjectFiles(sourceFiles); m_projectFinder.setSysroot(activeSysroot); + m_projectFinder.setAdditionalSearchDirectories(additionalSearchDirectories); m_filesCache.clear(); } |