diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 959bc243097..4629aa3d5fc 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -171,9 +171,16 @@ QString CMakeManager::findQtDir(const ProjectExplorer::Environment &env) QFileInfo qmake(path + "/" + possibleCommand); if (qmake.exists()) { if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) { - QDir dir(qmake.absoluteDir()); - dir.cdUp(); - return dir.absolutePath(); + QProcess proc; + proc.start(qmake.absoluteFilePath(), QStringList() << "-query" << "QT_INSTALL_DATA"); + if (proc.waitForFinished()) { + return proc.readAll().trimmed(); + } else { + proc.kill(); + QDir dir(qmake.absoluteDir()); + dir.cdUp(); + return dir.absolutePath(); + } } } } diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index abded6110f1..fe4e3d48770 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -870,9 +870,12 @@ void QtVersion::setPath(const QString &path) QString QtVersion::dumperLibrary() const { uint hash = qHash(path()); + QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); + if (qtInstallData.isEmpty()) + qtInstallData = path(); QStringList directories; directories - << (path() + "/qtc-debugging-helper/") + << (qtInstallData + "/qtc-debugging-helper/") << (QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash)) + "/" << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash)) + "/"; foreach(const QString &directory, directories) { @@ -1390,9 +1393,12 @@ QString QtVersion::buildDebuggingHelperLibrary() QString output; uint hash = qHash(path()); + QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); + if (qtInstallData.isEmpty()) + qtInstallData = path(); QStringList directories; directories - << path() + "/qtc-debugging-helper/" + << qtInstallData + "/qtc-debugging-helper/" << QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash) +"/" << QDesktopServices::storageLocation (QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash) +"/";