Debugger: De-Q_OBJECT-ify settings pages

Change-Id: I17fe42e8b4ea2801414cca10893f82c12885c788
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-01-10 13:46:51 +01:00
parent 8b4915ce41
commit 8b1ee3be9a
5 changed files with 18 additions and 35 deletions

View File

@@ -84,7 +84,7 @@ static inline int indexOfEvent(const QString &abbrev)
// events with parameters (like 'out:Needle'). // events with parameters (like 'out:Needle').
class CdbBreakEventWidget : public QWidget class CdbBreakEventWidget : public QWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbBreakEventWidget)
public: public:
explicit CdbBreakEventWidget(QWidget *parent = nullptr); explicit CdbBreakEventWidget(QWidget *parent = nullptr);
@@ -183,7 +183,7 @@ QStringList CdbBreakEventWidget::breakEvents() const
class CdbOptionsPageWidget : public Core::IOptionsPageWidget class CdbOptionsPageWidget : public Core::IOptionsPageWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbOptionsPageWidget)
public: public:
CdbOptionsPageWidget(); CdbOptionsPageWidget();
@@ -248,7 +248,7 @@ void CdbOptionsPageWidget::finish()
CdbOptionsPage::CdbOptionsPage() CdbOptionsPage::CdbOptionsPage()
{ {
setId("F.Debugger.Cda"); setId("F.Debugger.Cda");
setDisplayName(tr("CDB")); setDisplayName(CdbOptionsPageWidget::tr("CDB"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbOptionsPageWidget; }); setWidgetCreator([] { return new CdbOptionsPageWidget; });
} }
@@ -258,7 +258,7 @@ CdbOptionsPage::CdbOptionsPage()
class CdbPathsPageWidget : public Core::IOptionsPageWidget class CdbPathsPageWidget : public Core::IOptionsPageWidget
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbPathsPageWidget)
public: public:
CdbPathsPageWidget(); CdbPathsPageWidget();
@@ -295,12 +295,10 @@ CdbPathsPageWidget::CdbPathsPageWidget()
CdbPathsPage::CdbPathsPage() CdbPathsPage::CdbPathsPage()
{ {
setId("F.Debugger.Cdb"); setId("F.Debugger.Cdb");
setDisplayName(tr("CDB Paths")); setDisplayName(CdbPathsPageWidget::tr("CDB Paths"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbPathsPageWidget; }); setWidgetCreator([] { return new CdbPathsPageWidget; });
} }
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
#include "cdboptionspage.moc"

View File

@@ -27,31 +27,19 @@
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
QT_BEGIN_NAMESPACE
class QCheckBox;
QT_END_NAMESPACE
namespace Utils { class PathListEditor; }
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class CdbSymbolPathListEditor; class CdbOptionsPage final : public Core::IOptionsPage
class CdbPathsPageWidget;
class CdbOptionsPage : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
CdbOptionsPage(); CdbOptionsPage();
static const char *crtDbgReport; static const char *crtDbgReport;
}; };
class CdbPathsPage : public Core::IOptionsPage class CdbPathsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
CdbPathsPage(); CdbPathsPage();
}; };

View File

@@ -28,6 +28,7 @@
#include "debuggeractions.h" #include "debuggeractions.h"
#include "debuggerinternalconstants.h" #include "debuggerinternalconstants.h"
#include "debuggercore.h" #include "debuggercore.h"
#include "debuggersourcepathmappingwidget.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/variablechooser.h> #include <coreplugin/variablechooser.h>
@@ -64,6 +65,8 @@ namespace Internal {
class CommonOptionsPageWidget : public Core::IOptionsPageWidget class CommonOptionsPageWidget : public Core::IOptionsPageWidget
{ {
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CommonOptionsPageWidget)
public: public:
explicit CommonOptionsPageWidget() explicit CommonOptionsPageWidget()
{ {
@@ -253,14 +256,15 @@ CommonOptionsPage::CommonOptionsPage()
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function) QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
{ {
return tr("Stop when %1() is called").arg(QLatin1String(function)); return CommonOptionsPageWidget::tr("Stop when %1() is called").arg(QLatin1String(function));
} }
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function, QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
const QString &hint) const QString &hint)
{ {
QString result = "<html><head/><body>"; QString result = "<html><head/><body>";
result += tr("Always adds a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function)); result += CommonOptionsPageWidget::tr("Always adds a breakpoint on the <i>%1()</i> function.")
.arg(QLatin1String(function));
if (!hint.isEmpty()) { if (!hint.isEmpty()) {
result += "<br>"; result += "<br>";
result += hint; result += hint;

View File

@@ -25,17 +25,13 @@
#pragma once #pragma once
#include "debuggersourcepathmappingwidget.h"
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class CommonOptionsPage : public Core::IOptionsPage class CommonOptionsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
CommonOptionsPage(); CommonOptionsPage();
@@ -44,10 +40,8 @@ public:
const QString &hint = {}); const QString &hint = {});
}; };
class LocalsAndExpressionsOptionsPage : public Core::IOptionsPage class LocalsAndExpressionsOptionsPage final : public Core::IOptionsPage
{ {
Q_OBJECT
public: public:
LocalsAndExpressionsOptionsPage(); LocalsAndExpressionsOptionsPage();
}; };

View File

@@ -41,6 +41,7 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
#include <QFormLayout> #include <QFormLayout>
#include <QGroupBox>
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QPointer> #include <QPointer>
@@ -61,7 +62,8 @@ namespace Internal {
class GdbOptionsPage : public Core::IOptionsPage class GdbOptionsPage : public Core::IOptionsPage
{ {
Q_OBJECT Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::GdbOptionsPage)
public: public:
GdbOptionsPage(); GdbOptionsPage();
}; };
@@ -279,7 +281,6 @@ GdbOptionsPage::GdbOptionsPage()
class GdbOptionsPageWidget2 : public IOptionsPageWidget class GdbOptionsPageWidget2 : public IOptionsPageWidget
{ {
Q_OBJECT
public: public:
GdbOptionsPageWidget2(); GdbOptionsPageWidget2();
@@ -391,5 +392,3 @@ void addGdbOptionPages(QList<IOptionsPage *> *opts)
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
#include "gdboptionspage.moc"