Several SettingsPages: Code cosmetics

De-Q_OBJECT-ify, remove unnecessary #includes, final-ize, etc.

Change-Id: I461d3e73400dacac90c22e7c84a40e3ea1718b6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-01-27 08:58:38 +01:00
parent 8b117bcd86
commit c3f7ef5340
33 changed files with 39 additions and 70 deletions

View File

@@ -449,7 +449,7 @@ QModelIndex DebugServerProvidersSettingsWidget::currentIndex() const
DebugServerProvidersSettingsPage::DebugServerProvidersSettingsPage() DebugServerProvidersSettingsPage::DebugServerProvidersSettingsPage()
{ {
setId(Constants::DEBUG_SERVER_PROVIDERS_SETTINGS_ID); setId(Constants::DEBUG_SERVER_PROVIDERS_SETTINGS_ID);
setDisplayName(tr("Bare Metal")); setDisplayName(DebugServerProvidersSettingsWidget::tr("Bare Metal"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setWidgetCreator([] { return new DebugServerProvidersSettingsWidget; }); setWidgetCreator([] { return new DebugServerProvidersSettingsWidget; });
} }

View File

@@ -84,8 +84,6 @@ private:
class DebugServerProvidersSettingsPage final : public Core::IOptionsPage class DebugServerProvidersSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
DebugServerProvidersSettingsPage(); DebugServerProvidersSettingsPage();
}; };

View File

@@ -30,7 +30,7 @@
namespace CMakeProjectManager { namespace CMakeProjectManager {
namespace Internal { namespace Internal {
class CMakeSettingsPage : public Core::IOptionsPage class CMakeSettingsPage final : public Core::IOptionsPage
{ {
public: public:
CMakeSettingsPage(); CMakeSettingsPage();

View File

@@ -29,8 +29,6 @@
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <QPointer>
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {

View File

@@ -131,6 +131,8 @@ using namespace Help::Internal;
class DocSettingsPageWidget : public Core::IOptionsPageWidget class DocSettingsPageWidget : public Core::IOptionsPageWidget
{ {
Q_DECLARE_TR_FUNCTIONS(Help::DocSettingsPage)
public: public:
DocSettingsPageWidget() DocSettingsPageWidget()
{ {
@@ -324,7 +326,7 @@ QList<QModelIndex> DocSettingsPageWidget::currentSelection() const
DocSettingsPage::DocSettingsPage() DocSettingsPage::DocSettingsPage()
{ {
setId("B.Documentation"); setId("B.Documentation");
setDisplayName(tr("Documentation")); setDisplayName(DocSettingsPageWidget::tr("Documentation"));
setCategory(Help::Constants::HELP_CATEGORY); setCategory(Help::Constants::HELP_CATEGORY);
setWidgetCreator([] { return new DocSettingsPageWidget; }); setWidgetCreator([] { return new DocSettingsPageWidget; });
} }

View File

@@ -30,10 +30,8 @@
namespace Help { namespace Help {
namespace Internal { namespace Internal {
class DocSettingsPage : public Core::IOptionsPage class DocSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
DocSettingsPage(); DocSettingsPage();
}; };

View File

@@ -30,7 +30,7 @@
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
class IosSettingsPage : public Core::IOptionsPage class IosSettingsPage final : public Core::IOptionsPage
{ {
public: public:
IosSettingsPage(); IosSettingsPage();

View File

@@ -30,7 +30,7 @@
namespace McuSupport { namespace McuSupport {
namespace Internal { namespace Internal {
class McuSupportOptionsPage : public Core::IOptionsPage class McuSupportOptionsPage final : public Core::IOptionsPage
{ {
public: public:
McuSupportOptionsPage(); McuSupportOptionsPage();

View File

@@ -42,6 +42,8 @@ namespace Nim {
class NimCodeStyleSettingsWidget : public Core::IOptionsPageWidget class NimCodeStyleSettingsWidget : public Core::IOptionsPageWidget
{ {
Q_DECLARE_TR_FUNCTIONS(Nim::CodeStyleSettings)
public: public:
NimCodeStyleSettingsWidget() NimCodeStyleSettingsWidget()
{ {
@@ -72,7 +74,7 @@ NimCodeStyleSettingsPage::NimCodeStyleSettingsPage()
setId(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_ID); setId(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_ID);
setDisplayName(tr(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_DISPLAY)); setDisplayName(tr(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_DISPLAY));
setCategory(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_CATEGORY); setCategory(Nim::Constants::C_NIMCODESTYLESETTINGSPAGE_CATEGORY);
setDisplayCategory(tr("Nim")); setDisplayCategory(NimCodeStyleSettingsWidget::tr("Nim"));
setCategoryIconPath(":/nim/images/settingscategory_nim.png"); setCategoryIconPath(":/nim/images/settingscategory_nim.png");
setWidgetCreator([] { return new NimCodeStyleSettingsWidget; }); setWidgetCreator([] { return new NimCodeStyleSettingsWidget; });
} }

View File

@@ -29,12 +29,10 @@
namespace Nim { namespace Nim {
class NimCodeStyleSettingsPage : public Core::IOptionsPage class NimCodeStyleSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
NimCodeStyleSettingsPage(); NimCodeStyleSettingsPage();
}; };
} } // Nim

View File

@@ -59,7 +59,7 @@ NimToolsSettingsPage::NimToolsSettingsPage(NimSettings *settings)
: m_settings(settings) : m_settings(settings)
{ {
setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID); setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID);
setDisplayName(tr(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_DISPLAY)); setDisplayName(NimToolsSettingsWidget::tr(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_DISPLAY));
setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY); setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY);
setDisplayCategory(tr("Nim")); setDisplayCategory(tr("Nim"));
setCategoryIconPath(":/nim/images/settingscategory_nim.png"); setCategoryIconPath(":/nim/images/settingscategory_nim.png");

View File

@@ -40,7 +40,7 @@ namespace Ui { class NimToolsSettingsWidget; }
class NimToolsSettingsWidget : public QWidget class NimToolsSettingsWidget : public QWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Nim::ToolSettingsPage)
public: public:
explicit NimToolsSettingsWidget(NimSettings *settings); explicit NimToolsSettingsWidget(NimSettings *settings);
@@ -55,12 +55,10 @@ private:
NimSettings *m_settings = nullptr; NimSettings *m_settings = nullptr;
}; };
class NimToolsSettingsPage : public Core::IOptionsPage class NimToolsSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
NimToolsSettingsPage(NimSettings *settings); explicit NimToolsSettingsPage(NimSettings *settings);
~NimToolsSettingsPage(); ~NimToolsSettingsPage();

View File

@@ -121,7 +121,7 @@ SettingsPage::SettingsPage(QObject *parent)
: Core::IOptionsPage(parent) : Core::IOptionsPage(parent)
{ {
setId(VcsBase::Constants::VCS_ID_PERFORCE); setId(VcsBase::Constants::VCS_ID_PERFORCE);
setDisplayName(tr("Perforce")); setDisplayName(SettingsPageWidget::tr("Perforce"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
} }

View File

@@ -38,7 +38,7 @@ struct Settings;
class SettingsPageWidget : public QWidget class SettingsPageWidget : public QWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Perforce::Internal::SettingsPage)
public: public:
explicit SettingsPageWidget(QWidget *parent = nullptr); explicit SettingsPageWidget(QWidget *parent = nullptr);
@@ -57,10 +57,8 @@ private:
PerforceChecker *m_checker = nullptr; PerforceChecker *m_checker = nullptr;
}; };
class SettingsPage : public Core::IOptionsPage class SettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
explicit SettingsPage(QObject *parent); explicit SettingsPage(QObject *parent);
~SettingsPage() override; ~SettingsPage() override;

View File

@@ -33,9 +33,8 @@ class PerfSettings;
namespace Internal { namespace Internal {
class PerfOptionsPage : public Core::IOptionsPage class PerfOptionsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
explicit PerfOptionsPage(PerfSettings *settings); explicit PerfOptionsPage(PerfSettings *settings);
}; };

View File

@@ -889,7 +889,7 @@ private:
AppOutputSettingsPage::AppOutputSettingsPage() AppOutputSettingsPage::AppOutputSettingsPage()
{ {
setId(OPTIONS_PAGE_ID); setId(OPTIONS_PAGE_ID);
setDisplayName(tr("Application Output")); setDisplayName(AppOutputSettingsWidget::tr("Application Output"));
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setWidgetCreator([] { return new AppOutputSettingsWidget; }); setWidgetCreator([] { return new AppOutputSettingsWidget; });
} }

View File

@@ -159,10 +159,8 @@ private:
AppOutputSettings m_settings; AppOutputSettings m_settings;
}; };
class AppOutputSettingsPage : public Core::IOptionsPage class AppOutputSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
AppOutputSettingsPage(); AppOutputSettingsPage();
}; };

View File

@@ -411,7 +411,7 @@ private:
CompileOutputSettingsPage::CompileOutputSettingsPage() CompileOutputSettingsPage::CompileOutputSettingsPage()
{ {
setId(OPTIONS_PAGE_ID); setId(OPTIONS_PAGE_ID);
setDisplayName(tr("Compile Output")); setDisplayName(CompileOutputSettingsWidget::tr("Compile Output"));
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CompileOutputSettingsWidget; }); setWidgetCreator([] { return new CompileOutputSettingsWidget; });
} }

View File

@@ -102,10 +102,8 @@ private:
CompileOutputSettings m_settings; CompileOutputSettings m_settings;
}; };
class CompileOutputSettingsPage : public Core::IOptionsPage class CompileOutputSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
CompileOutputSettingsPage(); CompileOutputSettingsPage();
}; };

View File

@@ -37,7 +37,7 @@ namespace Internal {
DeviceSettingsPage::DeviceSettingsPage() DeviceSettingsPage::DeviceSettingsPage()
{ {
setId(Constants::DEVICE_SETTINGS_PAGE_ID); setId(Constants::DEVICE_SETTINGS_PAGE_ID);
setDisplayName(tr("Devices")); setDisplayName(DeviceSettingsWidget::tr("Devices"));
setCategory(Constants::DEVICE_SETTINGS_CATEGORY); setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Devices")); setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Devices"));
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png"); setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");

View File

@@ -30,10 +30,8 @@
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal { namespace Internal {
class DeviceSettingsPage : public Core::IOptionsPage class DeviceSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
DeviceSettingsPage(); DeviceSettingsPage();
}; };

View File

@@ -51,6 +51,8 @@ namespace Internal {
class KitOptionsPageWidget : public QWidget class KitOptionsPageWidget : public QWidget
{ {
Q_DECLARE_TR_FUNCTIONS(ProjextExplorer::Internal::KitOptionsPage)
public: public:
KitOptionsPageWidget(); KitOptionsPageWidget();
@@ -269,7 +271,7 @@ KitOptionsPage::KitOptionsPage()
{ {
theKitOptionsPage = this; theKitOptionsPage = this;
setId(Constants::KITS_SETTINGS_PAGE_ID); setId(Constants::KITS_SETTINGS_PAGE_ID);
setDisplayName(tr("Kits")); setDisplayName(Internal::KitOptionsPageWidget::tr("Kits"));
setCategory(Constants::KITS_SETTINGS_CATEGORY); setCategory(Constants::KITS_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Kits")); setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Kits"));
setCategoryIconPath(":/projectexplorer/images/settingscategory_kits.png"); setCategoryIconPath(":/projectexplorer/images/settingscategory_kits.png");

View File

@@ -37,14 +37,8 @@ namespace Internal { class KitOptionsPageWidget; }
class Kit; class Kit;
// --------------------------------------------------------------------------
// KitOptionsPage:
// --------------------------------------------------------------------------
class PROJECTEXPLORER_EXPORT KitOptionsPage : public Core::IOptionsPage class PROJECTEXPLORER_EXPORT KitOptionsPage : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
KitOptionsPage(); KitOptionsPage();

View File

@@ -33,7 +33,6 @@
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QWidget>
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal { namespace Internal {
@@ -42,7 +41,7 @@ namespace Internal {
class ProjectExplorerSettingsWidget : public QWidget class ProjectExplorerSettingsWidget : public QWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(ProjextExplorer::Internal::ProjectExplorerSettings)
public: public:
explicit ProjectExplorerSettingsWidget(QWidget *parent = nullptr); explicit ProjectExplorerSettingsWidget(QWidget *parent = nullptr);
@@ -169,7 +168,7 @@ void ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged()
ProjectExplorerSettingsPage::ProjectExplorerSettingsPage() ProjectExplorerSettingsPage::ProjectExplorerSettingsPage()
{ {
setId(Constants::BUILD_AND_RUN_SETTINGS_PAGE_ID); setId(Constants::BUILD_AND_RUN_SETTINGS_PAGE_ID);
setDisplayName(tr("General")); setDisplayName(ProjectExplorerSettingsWidget::tr("General"));
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Build & Run")); setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Build & Run"));
setCategoryIconPath(":/projectexplorer/images/settingscategory_buildrun.png"); setCategoryIconPath(":/projectexplorer/images/settingscategory_buildrun.png");
@@ -203,5 +202,3 @@ void ProjectExplorerSettingsPage::finish()
} // namespace Internal } // namespace Internal
} // namespace ProjectExplorer } // namespace ProjectExplorer
#include "projectexplorersettingspage.moc"

View File

@@ -30,7 +30,6 @@
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <QPointer> #include <QPointer>
#include <QUuid>
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal { namespace Internal {
@@ -40,8 +39,6 @@ class ProjectExplorerSettingsWidget;
class ProjectExplorerSettingsPage : public Core::IOptionsPage class ProjectExplorerSettingsPage : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
ProjectExplorerSettingsPage(); ProjectExplorerSettingsPage();

View File

@@ -132,7 +132,7 @@ private:
QmakeSettingsPage::QmakeSettingsPage() QmakeSettingsPage::QmakeSettingsPage()
{ {
setId("K.QmakeProjectManager.QmakeSettings"); setId("K.QmakeProjectManager.QmakeSettings");
setDisplayName(tr("Qmake")); setDisplayName(SettingsWidget::tr("Qmake"));
setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
} }

View File

@@ -59,9 +59,8 @@ private:
QmakeSettingsData m_settings; QmakeSettingsData m_settings;
}; };
class QmakeSettingsPage : public Core::IOptionsPage class QmakeSettingsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
QmakeSettingsPage(); QmakeSettingsPage();

View File

@@ -244,7 +244,7 @@ SettingsPage::SettingsPage() :
m_widget(nullptr) m_widget(nullptr)
{ {
setId("B.QmlDesigner"); setId("B.QmlDesigner");
setDisplayName(tr("Qt Quick Designer")); setDisplayName(SettingsPageWidget::tr("Qt Quick Designer"));
setCategory(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML); setCategory(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML);
} }

View File

@@ -44,7 +44,7 @@ namespace Internal {
class SettingsPageWidget : public QWidget class SettingsPageWidget : public QWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(QmlDesigner::Internal::SettingsPage)
public: public:
explicit SettingsPageWidget(QWidget *parent = nullptr); explicit SettingsPageWidget(QWidget *parent = nullptr);
@@ -59,8 +59,6 @@ private:
class SettingsPage : public Core::IOptionsPage class SettingsPage : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
SettingsPage(); SettingsPage();

View File

@@ -68,8 +68,6 @@ private:
class QmlJSCodeStyleSettingsPage : public Core::IOptionsPage class QmlJSCodeStyleSettingsPage : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
QmlJSCodeStyleSettingsPage(); QmlJSCodeStyleSettingsPage();

View File

@@ -36,7 +36,7 @@ namespace Internal {
QmlProfilerOptionsPage::QmlProfilerOptionsPage() QmlProfilerOptionsPage::QmlProfilerOptionsPage()
{ {
setId(Constants::SETTINGS); setId(Constants::SETTINGS);
setDisplayName(tr("QML Profiler")); setDisplayName(QmlProfilerConfigWidget::tr("QML Profiler"));
setCategory("T.Analyzer"); setCategory("T.Analyzer");
setDisplayCategory(tr("Analyzer")); setDisplayCategory(tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);

View File

@@ -31,9 +31,8 @@
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
class QmlProfilerOptionsPage : public Core::IOptionsPage class QmlProfilerOptionsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
QmlProfilerOptionsPage(); QmlProfilerOptionsPage();

View File

@@ -30,7 +30,7 @@
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
class QnxSettingsPage : public Core::IOptionsPage class QnxSettingsPage final : public Core::IOptionsPage
{ {
public: public:
QnxSettingsPage(); QnxSettingsPage();