From 222fe58e2520bf9fc2c487ff4c8ada64a1e8d5a8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 13 May 2018 16:16:20 -0400 Subject: [PATCH] DolphinQt2: Add missing Q_OBJECT macro to all QObject-related classes missing it Without this macro, if any signals or slots were attempted to be used, they wouldn't work; neither would various other features of the Qt meta-object system. This can also lead to weird behavior in other circumstances. Qt's documentation specifically states: "Therefore, we strongly recommend that all subclasses of QObject use the Q_OBJECT macro regardless of whether or not they actually use signals, slots, and properties." on its page for "The Meta-Object System", which can be seen here: https://doc.qt.io/qt-5/metaobjects.html Let's opt for "always do the right thing", and keep the code extensible for the future and not have random things blow up on us. --- .../Config/Graphics/GraphicsChoice.h | 1 + .../Config/Graphics/GraphicsSlider.h | 1 + .../DolphinQt2/Config/Mapping/GCKeyboardEmu.h | 1 + .../DolphinQt2/Config/Mapping/GCMicrophone.h | 1 + .../Core/DolphinQt2/Config/Mapping/GCPadEmu.h | 1 + .../Config/Mapping/GCPadWiiUConfigDialog.h | 1 + .../Core/DolphinQt2/Config/Mapping/Hotkey3D.h | 1 + .../Config/Mapping/HotkeyDebugging.h | 1 + .../DolphinQt2/Config/Mapping/HotkeyGeneral.h | 1 + .../Config/Mapping/HotkeyGraphics.h | 1 + .../DolphinQt2/Config/Mapping/HotkeyStates.h | 1 + .../DolphinQt2/Config/Mapping/HotkeyTAS.h | 1 + .../DolphinQt2/Config/Mapping/HotkeyWii.h | 1 + .../Config/Mapping/WiimoteEmuExtension.h | 1 + .../Config/Mapping/WiimoteEmuGeneral.h | 2 + .../Config/Mapping/WiimoteEmuMotionControl.h | 1 + Source/Core/DolphinQt2/DolphinQt2.vcxproj | 115 +++++++++++------- Source/Core/DolphinQt2/GCMemcardManager.h | 1 + .../DolphinQt2/QtUtils/AspectRatioWidget.h | 1 + .../DolphinQt2/QtUtils/BlockUserInputFilter.h | 1 + Source/Core/DolphinQt2/QtUtils/ElidedButton.h | 1 + .../Core/DolphinQt2/Settings/GameCubePane.h | 1 + Source/Core/DolphinQt2/Settings/PathPane.h | 1 + 23 files changed, 94 insertions(+), 44 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.h b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.h index a689d21960..81c44c5ad2 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.h +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsChoice.h @@ -10,6 +10,7 @@ class GraphicsChoice : public QComboBox { + Q_OBJECT public: GraphicsChoice(const QStringList& options, const Config::ConfigInfo& setting); diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.h b/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.h index 9bd63d73bb..8047eb90c9 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.h +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsSlider.h @@ -14,6 +14,7 @@ struct ConfigInfo; class GraphicsSlider : public QSlider { + Q_OBJECT public: GraphicsSlider(int minimum, int maximum, const Config::ConfigInfo& setting, int tick = 0); void Update(int value); diff --git a/Source/Core/DolphinQt2/Config/Mapping/GCKeyboardEmu.h b/Source/Core/DolphinQt2/Config/Mapping/GCKeyboardEmu.h index 6614babf71..1c21da41df 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/GCKeyboardEmu.h +++ b/Source/Core/DolphinQt2/Config/Mapping/GCKeyboardEmu.h @@ -15,6 +15,7 @@ class QVBoxLayout; class GCKeyboardEmu final : public MappingWidget { + Q_OBJECT public: explicit GCKeyboardEmu(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h b/Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h index 577a5320f7..cb7000630a 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h +++ b/Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h @@ -15,6 +15,7 @@ class QVBoxLayout; class GCMicrophone final : public MappingWidget { + Q_OBJECT public: explicit GCMicrophone(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/GCPadEmu.h b/Source/Core/DolphinQt2/Config/Mapping/GCPadEmu.h index 7e1f1d0587..8b3fefe6d2 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/GCPadEmu.h +++ b/Source/Core/DolphinQt2/Config/Mapping/GCPadEmu.h @@ -15,6 +15,7 @@ class QVBoxLayout; class GCPadEmu final : public MappingWidget { + Q_OBJECT public: explicit GCPadEmu(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/GCPadWiiUConfigDialog.h b/Source/Core/DolphinQt2/Config/Mapping/GCPadWiiUConfigDialog.h index 851b50a6fa..77cdb93355 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/GCPadWiiUConfigDialog.h +++ b/Source/Core/DolphinQt2/Config/Mapping/GCPadWiiUConfigDialog.h @@ -13,6 +13,7 @@ class QVBoxLayout; class GCPadWiiUConfigDialog final : public QDialog { + Q_OBJECT public: explicit GCPadWiiUConfigDialog(int port, QWidget* parent = nullptr); diff --git a/Source/Core/DolphinQt2/Config/Mapping/Hotkey3D.h b/Source/Core/DolphinQt2/Config/Mapping/Hotkey3D.h index b7e78822f2..bab3bee618 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/Hotkey3D.h +++ b/Source/Core/DolphinQt2/Config/Mapping/Hotkey3D.h @@ -10,6 +10,7 @@ class QHBoxLayout; class Hotkey3D final : public MappingWidget { + Q_OBJECT public: explicit Hotkey3D(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyDebugging.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyDebugging.h index aecc5e546e..dc9887bb69 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyDebugging.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyDebugging.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyDebugging final : public MappingWidget { + Q_OBJECT public: explicit HotkeyDebugging(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyGeneral.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyGeneral.h index 15c6dd04b3..77f269a82a 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyGeneral.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyGeneral.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyGeneral final : public MappingWidget { + Q_OBJECT public: explicit HotkeyGeneral(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyGraphics.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyGraphics.h index 63837202b3..126abd1967 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyGraphics.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyGraphics.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyGraphics final : public MappingWidget { + Q_OBJECT public: explicit HotkeyGraphics(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyStates.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStates.h index bf36ec96f3..c73206c8ec 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyStates.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStates.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyStates final : public MappingWidget { + Q_OBJECT public: explicit HotkeyStates(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyTAS.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyTAS.h index d6fabc1294..bb10d433d7 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyTAS.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyTAS.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyTAS final : public MappingWidget { + Q_OBJECT public: explicit HotkeyTAS(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyWii.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyWii.h index 56906e8770..71343dc465 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/HotkeyWii.h +++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyWii.h @@ -10,6 +10,7 @@ class QHBoxLayout; class HotkeyWii final : public MappingWidget { + Q_OBJECT public: explicit HotkeyWii(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuExtension.h b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuExtension.h index f98610af24..fd7a5c1d39 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuExtension.h +++ b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuExtension.h @@ -11,6 +11,7 @@ class QHBoxLayout; class WiimoteEmuExtension final : public MappingWidget { + Q_OBJECT public: enum class Type { diff --git a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuGeneral.h b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuGeneral.h index cc91cc21dc..83ff1e0307 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuGeneral.h +++ b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuGeneral.h @@ -7,10 +7,12 @@ #include "DolphinQt2/Config/Mapping/MappingWidget.h" class QComboBox; +class QHBoxLayout; class WiimoteEmuExtension; class WiimoteEmuGeneral final : public MappingWidget { + Q_OBJECT public: explicit WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension* extension); diff --git a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuMotionControl.h b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuMotionControl.h index e85b9208cf..9c8fac4f72 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuMotionControl.h +++ b/Source/Core/DolphinQt2/Config/Mapping/WiimoteEmuMotionControl.h @@ -15,6 +15,7 @@ class QVBoxLayout; class WiimoteEmuMotionControl final : public MappingWidget { + Q_OBJECT public: explicit WiimoteEmuMotionControl(MappingWindow* window); diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj index d634d66162..9e5cc99d14 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj @@ -65,10 +65,27 @@ + + + + + + + + + + + + + + + + + @@ -101,6 +118,7 @@ + @@ -108,10 +126,12 @@ - - + + + + @@ -119,10 +139,12 @@ + + + - @@ -133,34 +155,39 @@ - - + + + - + + + + - - - - - + + + + + + + - @@ -168,24 +195,35 @@ + + + + + + + + + + - - + + + + - - + @@ -193,18 +231,25 @@ + - + - + + + + + + + @@ -282,18 +327,18 @@ - + + - @@ -313,33 +358,15 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + diff --git a/Source/Core/DolphinQt2/GCMemcardManager.h b/Source/Core/DolphinQt2/GCMemcardManager.h index b6b71ea12f..a863a94856 100644 --- a/Source/Core/DolphinQt2/GCMemcardManager.h +++ b/Source/Core/DolphinQt2/GCMemcardManager.h @@ -23,6 +23,7 @@ class QTimer; class GCMemcardManager : public QDialog { + Q_OBJECT public: explicit GCMemcardManager(QWidget* parent = nullptr); ~GCMemcardManager(); diff --git a/Source/Core/DolphinQt2/QtUtils/AspectRatioWidget.h b/Source/Core/DolphinQt2/QtUtils/AspectRatioWidget.h index 907ba8cad7..516c1a6b62 100644 --- a/Source/Core/DolphinQt2/QtUtils/AspectRatioWidget.h +++ b/Source/Core/DolphinQt2/QtUtils/AspectRatioWidget.h @@ -10,6 +10,7 @@ class QBoxLayout; class AspectRatioWidget : public QWidget { + Q_OBJECT public: AspectRatioWidget(QWidget* widget, float width, float height, QWidget* parent = nullptr); void resizeEvent(QResizeEvent* event); diff --git a/Source/Core/DolphinQt2/QtUtils/BlockUserInputFilter.h b/Source/Core/DolphinQt2/QtUtils/BlockUserInputFilter.h index 112c3eea8f..3c62dfd07d 100644 --- a/Source/Core/DolphinQt2/QtUtils/BlockUserInputFilter.h +++ b/Source/Core/DolphinQt2/QtUtils/BlockUserInputFilter.h @@ -10,6 +10,7 @@ class QEvent; class BlockUserInputFilter : public QObject { + Q_OBJECT public: static BlockUserInputFilter* Instance(); diff --git a/Source/Core/DolphinQt2/QtUtils/ElidedButton.h b/Source/Core/DolphinQt2/QtUtils/ElidedButton.h index 4783513d0d..84f0d89da8 100644 --- a/Source/Core/DolphinQt2/QtUtils/ElidedButton.h +++ b/Source/Core/DolphinQt2/QtUtils/ElidedButton.h @@ -8,6 +8,7 @@ class ElidedButton : public QPushButton { + Q_OBJECT public: explicit ElidedButton(const QString& text = QStringLiteral(""), Qt::TextElideMode elide_mode = Qt::ElideRight); diff --git a/Source/Core/DolphinQt2/Settings/GameCubePane.h b/Source/Core/DolphinQt2/Settings/GameCubePane.h index a96f769baa..93e71808c9 100644 --- a/Source/Core/DolphinQt2/Settings/GameCubePane.h +++ b/Source/Core/DolphinQt2/Settings/GameCubePane.h @@ -12,6 +12,7 @@ class QPushButton; class GameCubePane : public QWidget { + Q_OBJECT public: explicit GameCubePane(); diff --git a/Source/Core/DolphinQt2/Settings/PathPane.h b/Source/Core/DolphinQt2/Settings/PathPane.h index 74b2a3fb99..47bec7f31e 100644 --- a/Source/Core/DolphinQt2/Settings/PathPane.h +++ b/Source/Core/DolphinQt2/Settings/PathPane.h @@ -13,6 +13,7 @@ class QListWidget; class PathPane final : public QWidget { + Q_OBJECT public: explicit PathPane(QWidget* parent = nullptr);