Boot2Qt: Use standard pattern for Qt version factory setup

Change-Id: I9fa8f0b38368e10ae73d068418f4bd95fc6e838a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-01-18 10:22:27 +01:00
parent 5f359a1dff
commit a938a82ca8
3 changed files with 24 additions and 27 deletions

View File

@@ -100,20 +100,6 @@ void registerFlashAction(QObject *parentForAction)
toolsContainer->addAction(flashCommand, flashActionId); toolsContainer->addAction(flashCommand, flashActionId);
} }
class QdbQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
QdbQtVersionFactory()
{
setQtVersionCreator([] { return new QdbQtVersion; });
setSupportedType("Qdb.EmbeddedLinuxQt");
setPriority(99);
setRestrictionChecker([](const SetupData &setup) {
return setup.platforms.contains("boot2qt");
});
}
};
template <class Step> template <class Step>
class QdbDeployStepFactory : public ProjectExplorer::BuildStepFactory class QdbDeployStepFactory : public ProjectExplorer::BuildStepFactory
{ {

View File

@@ -6,17 +6,32 @@
#include "qdbconstants.h" #include "qdbconstants.h"
#include "qdbtr.h" #include "qdbtr.h"
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtsupporttr.h>
namespace Qdb::Internal { namespace Qdb::Internal {
QString QdbQtVersion::description() const class QdbQtVersion : public QtSupport::QtVersion
{
return Tr::tr("Boot2Qt", "Qt version is used for Boot2Qt development");
}
QSet<Utils::Id> QdbQtVersion::targetDeviceTypes() const
{ {
public:
QString description() const final
{
return QtSupport::Tr::tr("Boot2Qt", "Qt version is used for Boot2Qt development");
}
QSet<Utils::Id> targetDeviceTypes() const final
{
return {Utils::Id(Constants::QdbLinuxOsType)}; return {Utils::Id(Constants::QdbLinuxOsType)};
}
};
QdbQtVersionFactory::QdbQtVersionFactory()
{
setQtVersionCreator([] { return new QdbQtVersion; });
setSupportedType("Qdb.EmbeddedLinuxQt");
setPriority(99);
setRestrictionChecker([](const SetupData &setup) {
return setup.platforms.contains("boot2qt");
});
} }
} // Qdb::Internal } // Qdb::Internal

View File

@@ -3,18 +3,14 @@
#pragma once #pragma once
#include <qtsupport/baseqtversion.h> #include <qtsupport/qtversionfactory.h>
namespace Qdb::Internal { namespace Qdb::Internal {
class QdbQtVersion : public QtSupport::QtVersion class QdbQtVersionFactory : public QtSupport::QtVersionFactory
{ {
public: public:
QdbQtVersion() = default; QdbQtVersionFactory();
~QdbQtVersion() = default;
QString description() const final;
QSet<Utils::Id> targetDeviceTypes() const final;
}; };
} // Qdb::Internal } // Qdb::Internal