forked from qt-creator/qt-creator
McuSupport: Improvements with version detection
Task-number: QTCREATORBUG-25261 Change-Id: I1b378eb4a4d132b64e4c36e0a0cdafd402570785 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
christiaan.janssen
parent
08f8dd355d
commit
b5781e6028
@@ -195,4 +195,27 @@
|
|||||||
\li Select \uicontrol Run to specify run settings.
|
\li Select \uicontrol Run to specify run settings.
|
||||||
Usually, you can use the default settings.
|
Usually, you can use the default settings.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\section1 Supported Qt for MCUs SDKs
|
||||||
|
|
||||||
|
Since version 4.12.4, \QC supports version 1.3 and later of the Qt for MCUs SDK.
|
||||||
|
For older versions refer to the following table.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header
|
||||||
|
\li \QC version
|
||||||
|
\li Qt for MCUs SDK version
|
||||||
|
\row
|
||||||
|
\li 4.12.4 or later
|
||||||
|
\li 1.3 or later
|
||||||
|
\row
|
||||||
|
\li 4.12.2 or 4.12.3
|
||||||
|
\li 1.2
|
||||||
|
\row
|
||||||
|
\li 4.12.0 or 4.12.1
|
||||||
|
\li 1.1
|
||||||
|
\row
|
||||||
|
\li 4.11.x
|
||||||
|
\li 1.0
|
||||||
|
\endtable
|
||||||
*/
|
*/
|
||||||
|
@@ -276,15 +276,18 @@ void McuPackage::updateStatus()
|
|||||||
|
|
||||||
void McuPackage::updateStatusUi()
|
void McuPackage::updateStatusUi()
|
||||||
{
|
{
|
||||||
m_infoLabel->setType(validStatus() ? InfoLabel::Ok : InfoLabel::NotOk);
|
switch (m_status) {
|
||||||
|
case ValidPackage: m_infoLabel->setType(InfoLabel::Ok); break;
|
||||||
|
case ValidPackageMismatchedVersion: m_infoLabel->setType(InfoLabel::Warning); break;
|
||||||
|
default: m_infoLabel->setType(InfoLabel::NotOk); break;
|
||||||
|
}
|
||||||
m_infoLabel->setText(statusText());
|
m_infoLabel->setText(statusText());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString McuPackage::statusText() const
|
QString McuPackage::statusText() const
|
||||||
{
|
{
|
||||||
const QString displayPackagePath = FilePath::fromString(m_path).toUserOutput();
|
const QString displayPackagePath = FilePath::fromString(m_path).toUserOutput();
|
||||||
const QString displayVersions = m_versions.isEmpty() ? "" :
|
const QString displayVersions = QStringList(m_versions.toList()).join(" or ");
|
||||||
QString(" (%1)").arg(QStringList(m_versions.toList()).join(" / "));
|
|
||||||
const QString displayRequiredPath = QString("%1 %2").arg(
|
const QString displayRequiredPath = QString("%1 %2").arg(
|
||||||
FilePath::fromString(m_detectionPath).toUserOutput(),
|
FilePath::fromString(m_detectionPath).toUserOutput(),
|
||||||
displayVersions);
|
displayVersions);
|
||||||
@@ -305,9 +308,9 @@ QString McuPackage::statusText() const
|
|||||||
break;
|
break;
|
||||||
case ValidPackageMismatchedVersion: {
|
case ValidPackageMismatchedVersion: {
|
||||||
const QString versionWarning = m_versions.size() == 1 ?
|
const QString versionWarning = m_versions.size() == 1 ?
|
||||||
tr("version %1 is recommended").arg(m_versions.first()) :
|
tr("but only version %1 is supported").arg(m_versions.first()) :
|
||||||
tr("versions %1 are recommended").arg(displayVersions);
|
tr("but only versions %1 are supported").arg(displayVersions);
|
||||||
response = tr("Path %1 is valid, %2 was found, but %3.")
|
response = tr("Path %1 is valid, %2 was found, %3.")
|
||||||
.arg(displayPackagePath, displayDetectedPath, versionWarning);
|
.arg(displayPackagePath, displayDetectedPath, versionWarning);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -609,6 +609,7 @@ static McuTargetDescription parseDescriptionJson(const QByteArray &data)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://doc.qt.io/qtcreator/creator-developing-mcu.html#supported-qt-for-mcus-sdks
|
||||||
const QHash<QString, QString> oldSdkQtcRequiredVersion = {
|
const QHash<QString, QString> oldSdkQtcRequiredVersion = {
|
||||||
{{"1.0"}, {"4.11.x"}},
|
{{"1.0"}, {"4.11.x"}},
|
||||||
{{"1.1"}, {"4.12.0 or 4.12.1"}},
|
{{"1.1"}, {"4.12.0 or 4.12.1"}},
|
||||||
@@ -622,8 +623,8 @@ bool checkDeprecatedSdkError(const Utils::FilePath &qulDir, QString &message)
|
|||||||
|
|
||||||
if (oldSdkQtcRequiredVersion.contains(sdkDetectedVersion)) {
|
if (oldSdkQtcRequiredVersion.contains(sdkDetectedVersion)) {
|
||||||
message = McuTarget::tr("Qt for MCUs SDK version %1 detected, "
|
message = McuTarget::tr("Qt for MCUs SDK version %1 detected, "
|
||||||
"only supported by QtCreator version %2. "
|
"only supported by Qt Creator version %2. "
|
||||||
"SDK version %3 or greater required."
|
"This version of Qt Creator requires Qt for MCUs %3 or greater."
|
||||||
).arg(sdkDetectedVersion,
|
).arg(sdkDetectedVersion,
|
||||||
oldSdkQtcRequiredVersion.value(sdkDetectedVersion),
|
oldSdkQtcRequiredVersion.value(sdkDetectedVersion),
|
||||||
McuSupportOptions::minimalQulVersion().toString());
|
McuSupportOptions::minimalQulVersion().toString());
|
||||||
|
@@ -31,7 +31,8 @@
|
|||||||
namespace McuSupport {
|
namespace McuSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class McuPackageVersionDetector : public QObject {
|
class McuPackageVersionDetector : public QObject
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
McuPackageVersionDetector();
|
McuPackageVersionDetector();
|
||||||
@@ -40,7 +41,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get version from the output of an executable
|
// Get version from the output of an executable
|
||||||
class McuPackageExecutableVersionDetector : public McuPackageVersionDetector {
|
class McuPackageExecutableVersionDetector : public McuPackageVersionDetector
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
McuPackageExecutableVersionDetector(const QString &detectionPath,
|
McuPackageExecutableVersionDetector(const QString &detectionPath,
|
||||||
const QStringList &detectionArgs,
|
const QStringList &detectionArgs,
|
||||||
@@ -53,7 +55,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get version through parsing an XML file
|
// Get version through parsing an XML file
|
||||||
class McuPackageXmlVersionDetector : public McuPackageVersionDetector {
|
class McuPackageXmlVersionDetector : public McuPackageVersionDetector
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
McuPackageXmlVersionDetector(const QString &filePattern,
|
McuPackageXmlVersionDetector(const QString &filePattern,
|
||||||
const QString &elementName,
|
const QString &elementName,
|
||||||
@@ -68,7 +71,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get version from the filename of a given file/dir in the package directory
|
// Get version from the filename of a given file/dir in the package directory
|
||||||
class McuPackageDirectoryVersionDetector : public McuPackageVersionDetector {
|
class McuPackageDirectoryVersionDetector : public McuPackageVersionDetector
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
McuPackageDirectoryVersionDetector(const QString &filePattern, const QString &versionRegExp, const bool isFile);
|
McuPackageDirectoryVersionDetector(const QString &filePattern, const QString &versionRegExp, const bool isFile);
|
||||||
QString parseVersion(const QString &packagePath) const;
|
QString parseVersion(const QString &packagePath) const;
|
||||||
@@ -79,7 +83,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get version from the path of the package itself
|
// Get version from the path of the package itself
|
||||||
class McuPackagePathVersionDetector : public McuPackageVersionDetector {
|
class McuPackagePathVersionDetector : public McuPackageVersionDetector
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
McuPackagePathVersionDetector(const QString &versionRegExp);
|
McuPackagePathVersionDetector(const QString &versionRegExp);
|
||||||
QString parseVersion(const QString &packagePath) const;
|
QString parseVersion(const QString &packagePath) const;
|
||||||
|
Reference in New Issue
Block a user