ProjectExplorer: Move GCC config widgets out of header file

They are only used in one source file.

Change-Id: I9a267be83156fb50c98da63fab165ef6123e7e59
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Christian Kandeler
2022-01-21 10:44:53 +01:00
parent 35e908d835
commit 8a70f66c9c
4 changed files with 61 additions and 67 deletions

View File

@@ -24,11 +24,14 @@
****************************************************************************/ ****************************************************************************/
#include "gcctoolchain.h" #include "gcctoolchain.h"
#include "abiwidget.h"
#include "clangparser.h" #include "clangparser.h"
#include "gcctoolchainfactories.h" #include "gcctoolchainfactories.h"
#include "gccparser.h" #include "gccparser.h"
#include "linuxiccparser.h" #include "linuxiccparser.h"
#include "projectmacro.h" #include "projectmacro.h"
#include "toolchainconfigwidget.h"
#include "toolchainmanager.h" #include "toolchainmanager.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -63,6 +66,59 @@ static Q_LOGGING_CATEGORY(gccLog, "qtc.projectexplorer.toolchain.gcc", QtWarning
using namespace Utils; using namespace Utils;
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal {
class TargetTripleWidget;
class GccToolChainConfigWidget : public ToolChainConfigWidget
{
Q_OBJECT
public:
explicit GccToolChainConfigWidget(GccToolChain *tc);
protected:
void handleCompilerCommandChange();
void handlePlatformCodeGenFlagsChange();
void handlePlatformLinkerFlagsChange();
void applyImpl() override;
void discardImpl() override { setFromToolchain(); }
bool isDirtyImpl() const override;
void makeReadOnlyImpl() override;
void setFromToolchain();
AbiWidget *m_abiWidget;
private:
Utils::PathChooser *m_compilerCommand;
QLineEdit *m_platformCodeGenFlagsLineEdit;
QLineEdit *m_platformLinkerFlagsLineEdit;
TargetTripleWidget * const m_targetTripleWidget;
bool m_isReadOnly = false;
ProjectExplorer::Macros m_macros;
};
class ClangToolChainConfigWidget : public GccToolChainConfigWidget
{
Q_OBJECT
public:
explicit ClangToolChainConfigWidget(ClangToolChain *tc);
private:
void applyImpl() override;
void discardImpl() override { setFromClangToolchain(); }
bool isDirtyImpl() const override;
void makeReadOnlyImpl() override;
void setFromClangToolchain();
void updateParentToolChainComboBox();
QList<QMetaObject::Connection> m_parentToolChainConnections;
QComboBox *m_parentToolchainCombo = nullptr;
};
} // namespace Internal
using namespace Internal; using namespace Internal;

View File

@@ -26,21 +26,13 @@
#pragma once #pragma once
#include "toolchain.h" #include "toolchain.h"
#include "toolchainconfigwidget.h"
#include "abi.h" #include "abi.h"
#include "abiwidget.h"
#include <QList> #include <QList>
#include <QSet> #include <QSet>
#include <functional> #include <functional>
QT_BEGIN_NAMESPACE
class QComboBox;
QT_END_NAMESPACE
namespace Utils { class PathChooser; }
namespace ProjectExplorer { namespace ProjectExplorer {
class ClangToolChain; class ClangToolChain;
class GccToolChain; class GccToolChain;
@@ -67,65 +59,6 @@ protected:
const ToolchainChecker &checker = {}) const; const ToolchainChecker &checker = {}) const;
}; };
// --------------------------------------------------------------------------
// GccToolChainConfigWidget
// --------------------------------------------------------------------------
class TargetTripleWidget;
class GccToolChainConfigWidget : public ToolChainConfigWidget
{
Q_OBJECT
public:
explicit GccToolChainConfigWidget(GccToolChain *tc);
protected:
void handleCompilerCommandChange();
void handlePlatformCodeGenFlagsChange();
void handlePlatformLinkerFlagsChange();
void applyImpl() override;
void discardImpl() override { setFromToolchain(); }
bool isDirtyImpl() const override;
void makeReadOnlyImpl() override;
void setFromToolchain();
AbiWidget *m_abiWidget;
private:
Utils::PathChooser *m_compilerCommand;
QLineEdit *m_platformCodeGenFlagsLineEdit;
QLineEdit *m_platformLinkerFlagsLineEdit;
TargetTripleWidget * const m_targetTripleWidget;
bool m_isReadOnly = false;
ProjectExplorer::Macros m_macros;
};
// --------------------------------------------------------------------------
// ClangToolChainConfigWidget
// --------------------------------------------------------------------------
class ClangToolChainConfigWidget : public GccToolChainConfigWidget
{
Q_OBJECT
public:
explicit ClangToolChainConfigWidget(ClangToolChain *tc);
private:
void applyImpl() override;
void discardImpl() override { setFromClangToolchain(); }
bool isDirtyImpl() const override;
void makeReadOnlyImpl() override;
void setFromClangToolchain();
void updateParentToolChainComboBox();
QList<QMetaObject::Connection> m_parentToolChainConnections;
QComboBox *m_parentToolchainCombo = nullptr;
};
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// ClangToolChainFactory // ClangToolChainFactory
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@@ -29,6 +29,7 @@
#include "qnxconstants.h" #include "qnxconstants.h"
#include "qnxutils.h" #include "qnxutils.h"
#include <projectexplorer/abiwidget.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>

View File

@@ -27,6 +27,10 @@
#include <projectexplorer/gcctoolchain.h> #include <projectexplorer/gcctoolchain.h>
#include <projectexplorer/gcctoolchainfactories.h> #include <projectexplorer/gcctoolchainfactories.h>
#include <projectexplorer/toolchainconfigwidget.h>
namespace ProjectExplorer { class AbiWidget; }
namespace Utils { class PathChooser; }
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {