QmlProject: Search for qmlviewer in configured Qt versions (if not found in $PATH)

If no 'qmlviewer' executable is found in the PATH, iterate through the
list of configured Qt versions and try to find a qmlviewer there. This
should help users configuring creator such to play with Qml.

Right now the first qmlviewer found in a Qt version is selected. A UI
to let the user select one explicitly was not possible any more (string
freeze).

This requires a dependency from QmlProjectManager to
Qt4ProjectManager.

Reviewed-by: dt
This commit is contained in:
Kai Koehne
2010-08-19 16:51:27 +02:00
parent 420a2b4e6e
commit 60fffda9eb
9 changed files with 132 additions and 30 deletions

View File

@@ -749,6 +749,7 @@ void QtVersion::setQMakeCommand(const QString& qmakeCommand)
#endif
m_designerCommand.clear();
m_linguistCommand.clear();
m_qmlviewerCommand.clear();
m_uicCommand.clear();
m_toolChainUpToDate = false;
// TODO do i need to optimize this?
@@ -1202,6 +1203,22 @@ QString QtVersion::linguistCommand() const
return m_linguistCommand;
}
QString QtVersion::qmlviewerCommand() const
{
if (!isValid())
return QString();
if (m_qmlviewerCommand.isNull()) {
#ifdef Q_OS_MAC
const QString qmlViewerName = QLatin1String("QMLViewer");
#else
const QString qmlViewerName = QLatin1String("qmlviewer");
#endif
m_qmlviewerCommand = findQtBinary(possibleGuiBinaries(qmlViewerName));
}
return m_qmlviewerCommand;
}
bool QtVersion::supportsTargetId(const QString &id) const
{
updateToolChainAndMkspec();