QtSupport: De-qobjectify QtVersionFactory hierarchy

Change-Id: I6ceccf96f5f6a5dc4e33d667d4fc234e15b88926
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-14 08:56:19 +01:00
parent 1588205544
commit f0dabc7442
15 changed files with 24 additions and 33 deletions

View File

@@ -33,8 +33,7 @@
namespace Android {
namespace Internal {
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
AndroidQtVersionFactory::AndroidQtVersionFactory()
{
setQtVersionCreator([] { return new AndroidQtVersion; });
setSupportedType(Constants::ANDROIDQT);

View File

@@ -33,7 +33,7 @@ namespace Internal {
class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
explicit AndroidQtVersionFactory(QObject *parent = nullptr);
AndroidQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false, const QString &autoDetectionSource = QString()) override;

View File

@@ -32,8 +32,7 @@
namespace Ios {
namespace Internal {
IosQtVersionFactory::IosQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
IosQtVersionFactory::IosQtVersionFactory()
{
setQtVersionCreator([] { return new IosQtVersion; });
setSupportedType(Constants::IOSQT);

View File

@@ -33,7 +33,7 @@ namespace Internal {
class IosQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
explicit IosQtVersionFactory(QObject *parent = nullptr);
IosQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false,

View File

@@ -33,8 +33,7 @@
using namespace Qnx;
using namespace Qnx::Internal;
QnxQtVersionFactory::QnxQtVersionFactory(QObject *parent) :
QtSupport::QtVersionFactory(parent)
QnxQtVersionFactory::QnxQtVersionFactory()
{
setQtVersionCreator([] { return new QnxQtVersion; });
setSupportedType(Constants::QNX_QNX_QT);

View File

@@ -32,9 +32,8 @@ namespace Internal {
class QnxQtVersionFactory : public QtSupport::QtVersionFactory
{
Q_OBJECT
public:
explicit QnxQtVersionFactory(QObject *parent = nullptr);
QnxQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath,
ProFileEvaluator *evaluator,

View File

@@ -30,8 +30,7 @@
using namespace QtSupport;
using namespace QtSupport::Internal;
DesktopQtVersionFactory::DesktopQtVersionFactory(QObject *parent)
: QtVersionFactory(parent)
DesktopQtVersionFactory::DesktopQtVersionFactory()
{
setQtVersionCreator([] { return new DesktopQtVersion; });
setSupportedType(Constants::DESKTOPQT);

View File

@@ -33,7 +33,7 @@ namespace Internal {
class DesktopQtVersionFactory : public QtVersionFactory
{
public:
explicit DesktopQtVersionFactory(QObject *parent = nullptr);
DesktopQtVersionFactory();
BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false, const QString &autoDetectionSource = QString()) override;

View File

@@ -25,6 +25,8 @@
#pragma once
#include <QtGlobal>
namespace QtSupport {
namespace Constants {

View File

@@ -42,8 +42,7 @@ using namespace QtSupport::Internal;
static QList<QtVersionFactory *> g_qtVersionFactories;
QtVersionFactory::QtVersionFactory(QObject *parent) :
QObject(parent)
QtVersionFactory::QtVersionFactory()
{
g_qtVersionFactories.append(this);
}
@@ -106,8 +105,10 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN
}
}
ProFileCacheManager::instance()->decRefCount();
if (error)
*error = tr("No factory found for qmake: \"%1\"").arg(qmakePath.toUserOutput());
if (error) {
*error = QCoreApplication::translate("QtSupport::QtVersionFactory",
"No factory found for qmake: \"%1\"").arg(qmakePath.toUserOutput());
}
return 0;
}

View File

@@ -27,11 +27,9 @@
#include "qtsupport_global.h"
#include <QObject>
#include <QVariantMap>
QT_BEGIN_NAMESPACE
class QSettings;
class ProFileEvaluator;
QT_END_NAMESPACE
@@ -41,13 +39,11 @@ namespace QtSupport {
class BaseQtVersion;
class QTSUPPORT_EXPORT QtVersionFactory : public QObject
class QTSUPPORT_EXPORT QtVersionFactory
{
Q_OBJECT
public:
explicit QtVersionFactory(QObject *parent = nullptr);
~QtVersionFactory() override;
QtVersionFactory();
virtual ~QtVersionFactory();
static const QList<QtVersionFactory *> allQtVersionFactories();

View File

@@ -33,8 +33,7 @@
namespace RemoteLinux {
namespace Internal {
EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory()
{
setQtVersionCreator([] { return new EmbeddedLinuxQtVersion; });
setSupportedType(RemoteLinux::Constants::EMBEDDED_LINUX_QT);

View File

@@ -33,7 +33,7 @@ namespace Internal {
class EmbeddedLinuxQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
explicit EmbeddedLinuxQtVersionFactory(QObject *parent = nullptr);
EmbeddedLinuxQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false,

View File

@@ -33,8 +33,7 @@
namespace WinRt {
namespace Internal {
WinRtQtVersionFactory::WinRtQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
WinRtQtVersionFactory::WinRtQtVersionFactory()
{
setQtVersionCreator([] { return new WinRtQtVersion; });
setSupportedType(Constants::WINRT_WINRTQT);
@@ -54,8 +53,7 @@ QtSupport::BaseQtVersion *WinRtQtVersionFactory::create(const Utils::FileName &q
WinRtPhoneQtVersionFactory::WinRtPhoneQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
WinRtPhoneQtVersionFactory::WinRtPhoneQtVersionFactory()
{
setQtVersionCreator([] { return new WinRtPhoneQtVersion; });
setSupportedType(Constants::WINRT_WINPHONEQT);

View File

@@ -33,7 +33,7 @@ namespace Internal {
class WinRtQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
explicit WinRtQtVersionFactory(QObject *parent = nullptr);
WinRtQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false, const QString &autoDetectionSource = QString());
@@ -42,7 +42,7 @@ public:
class WinRtPhoneQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
explicit WinRtPhoneQtVersionFactory(QObject *parent = nullptr);
WinRtPhoneQtVersionFactory();
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
bool isAutoDetected = false, const QString &autoDetectionSource = QString());