forked from qt-creator/qt-creator
Qt Versions: Differentiate between qmlscene and qmlviewer
Qt5 features both qmlviewer (QtQuick1) and qmlscene. We can't just assume that everybody wants to use qmlscene. Change-Id: I6668b7776869826575ce035f1e9ace47908013ff Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -71,6 +71,8 @@ QString DesktopQtVersion::type() const
|
||||
QStringList DesktopQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret = BaseQtVersion::warningReason();
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty())
|
||||
ret << QCoreApplication::translate("Qt Version", "No qmlscene installed.");
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
|
||||
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return ret;
|
||||
|
@@ -71,6 +71,8 @@ QString SimulatorQtVersion::type() const
|
||||
QStringList SimulatorQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret = BaseQtVersion::warningReason();
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty())
|
||||
ret << QCoreApplication::translate("QtVersion", "No qmlscene installed.");
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
|
||||
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return ret;
|
||||
|
@@ -601,6 +601,16 @@ QString BaseQtVersion::linguistCommand() const
|
||||
return m_linguistCommand;
|
||||
}
|
||||
|
||||
QString BaseQtVersion::qmlsceneCommand() const
|
||||
{
|
||||
if (!isValid())
|
||||
return QString();
|
||||
|
||||
if (m_qmlsceneCommand.isNull())
|
||||
m_qmlsceneCommand = findQtBinary(QmlScene);
|
||||
return m_qmlsceneCommand;
|
||||
}
|
||||
|
||||
QString BaseQtVersion::qmlviewerCommand() const
|
||||
{
|
||||
if (!isValid())
|
||||
@@ -619,6 +629,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
|
||||
} else {
|
||||
ensureMkSpecParsed();
|
||||
switch (binary) {
|
||||
case QmlScene:
|
||||
case QmlViewer:
|
||||
baseDir = m_mkspecValues.value(QLatin1String("QT.qml.bins"));
|
||||
break;
|
||||
@@ -642,22 +653,21 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
|
||||
|
||||
QStringList possibleCommands;
|
||||
switch (binary) {
|
||||
case QmlScene: {
|
||||
#if defined(Q_OS_WIN)
|
||||
possibleCommands << QLatin1String("qmlscene.exe");
|
||||
#else
|
||||
possibleCommands << QLatin1String("qmlscene");
|
||||
#endif
|
||||
}
|
||||
case QmlViewer: {
|
||||
if (qtVersion() < QtVersionNumber(5, 0, 0)) {
|
||||
#if defined(Q_OS_WIN)
|
||||
possibleCommands << QLatin1String("qmlviewer.exe");
|
||||
possibleCommands << QLatin1String("qmlviewer.exe");
|
||||
#elif defined(Q_OS_MAC)
|
||||
possibleCommands << QLatin1String("QMLViewer.app/Contents/MacOS/QMLViewer");
|
||||
possibleCommands << QLatin1String("QMLViewer.app/Contents/MacOS/QMLViewer");
|
||||
#else
|
||||
possibleCommands << QLatin1String("qmlviewer");
|
||||
possibleCommands << QLatin1String("qmlviewer");
|
||||
#endif
|
||||
} else {
|
||||
#if defined(Q_OS_WIN)
|
||||
possibleCommands << QLatin1String("qmlscene.exe");
|
||||
#else
|
||||
possibleCommands << QLatin1String("qmlscene");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Designer:
|
||||
|
@@ -138,6 +138,7 @@ public:
|
||||
virtual QString uicCommand() const;
|
||||
virtual QString designerCommand() const;
|
||||
virtual QString linguistCommand() const;
|
||||
QString qmlsceneCommand() const;
|
||||
QString qmlviewerCommand() const;
|
||||
|
||||
virtual QString qtVersionString() const;
|
||||
@@ -239,7 +240,7 @@ private:
|
||||
void ctor(const Utils::FileName &qmakePath);
|
||||
void updateSourcePath() const;
|
||||
void updateVersionInfo() const;
|
||||
enum Binaries { QmlViewer, Designer, Linguist, Uic };
|
||||
enum Binaries { QmlViewer, QmlScene, Designer, Linguist, Uic };
|
||||
QString findQtBinary(Binaries binary) const;
|
||||
void updateMkspec() const;
|
||||
void setId(int id); // used by the qtversionmanager for legacy restore
|
||||
@@ -276,6 +277,7 @@ private:
|
||||
mutable QString m_uicCommand;
|
||||
mutable QString m_designerCommand;
|
||||
mutable QString m_linguistCommand;
|
||||
mutable QString m_qmlsceneCommand;
|
||||
mutable QString m_qmlviewerCommand;
|
||||
|
||||
mutable bool m_qmakeIsExecutable;
|
||||
|
Reference in New Issue
Block a user