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()
{
setId(Constants::DEBUG_SERVER_PROVIDERS_SETTINGS_ID);
setDisplayName(tr("Bare Metal"));
setDisplayName(DebugServerProvidersSettingsWidget::tr("Bare Metal"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setWidgetCreator([] { return new DebugServerProvidersSettingsWidget; });
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -59,7 +59,7 @@ NimToolsSettingsPage::NimToolsSettingsPage(NimSettings *settings)
: m_settings(settings)
{
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);
setDisplayCategory(tr("Nim"));
setCategoryIconPath(":/nim/images/settingscategory_nim.png");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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