From 339f4252ec935ab49a5b5eb72e46905b2eba027f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 14 Sep 2025 17:12:40 +1000 Subject: [PATCH] Qt: Remove named slot declarations Knocks 70KB or so off the release binary, ~0.8%. --- src/duckstation-qt/achievementlogindialog.h | 9 +- .../achievementsettingswidget.h | 11 +- src/duckstation-qt/advancedsettingswidget.h | 15 +- src/duckstation-qt/audiosettingswidget.h | 9 +- src/duckstation-qt/autoupdaterwindow.h | 14 +- src/duckstation-qt/biossettingswidget.h | 3 +- src/duckstation-qt/colorpickerbutton.h | 10 +- src/duckstation-qt/consolesettingswidget.h | 7 +- src/duckstation-qt/controllerbindingwidgets.h | 31 ++-- src/duckstation-qt/controllersettingswindow.h | 28 ++- src/duckstation-qt/coverdownloadwindow.h | 15 +- src/duckstation-qt/debuggermodels.h | 3 +- src/duckstation-qt/debuggerwindow.h | 39 ++-- src/duckstation-qt/emulationsettingswidget.h | 7 +- src/duckstation-qt/gamecheatsettingswidget.h | 9 +- src/duckstation-qt/gamelistsettingswidget.h | 14 +- src/duckstation-qt/gamelistwidget.h | 42 ++--- src/duckstation-qt/gamepatchsettingswidget.h | 9 +- src/duckstation-qt/gamesummarywidget.h | 15 +- src/duckstation-qt/graphicssettingswidget.h | 20 +-- src/duckstation-qt/hotkeysettingswidget.h | 2 - src/duckstation-qt/inputbindingdialog.h | 13 +- src/duckstation-qt/inputbindingwidgets.h | 16 +- src/duckstation-qt/interfacesettingswidget.h | 7 +- src/duckstation-qt/isobrowserwindow.h | 13 +- src/duckstation-qt/logwindow.h | 26 ++- src/duckstation-qt/mainwindow.h | 166 +++++++++--------- src/duckstation-qt/memorycardeditorwindow.h | 24 ++- src/duckstation-qt/memoryscannerwindow.h | 15 +- src/duckstation-qt/memoryviewwidget.h | 11 +- .../postprocessingsettingswidget.h | 27 ++- src/duckstation-qt/qthost.h | 18 +- src/duckstation-qt/qtprogresscallback.h | 12 +- src/duckstation-qt/selectdiscdialog.h | 7 +- src/duckstation-qt/settingswindow.h | 16 +- src/duckstation-qt/setupwizarddialog.h | 38 ++-- 36 files changed, 328 insertions(+), 393 deletions(-) diff --git a/src/duckstation-qt/achievementlogindialog.h b/src/duckstation-qt/achievementlogindialog.h index 83b1b93c3..e769598a4 100644 --- a/src/duckstation-qt/achievementlogindialog.h +++ b/src/duckstation-qt/achievementlogindialog.h @@ -18,16 +18,15 @@ public: AchievementLoginDialog(QWidget* parent, Achievements::LoginRequestReason reason); ~AchievementLoginDialog(); -private Q_SLOTS: - void loginClicked(); - void cancelClicked(); - void processLoginResult(bool result, const QString& message); - private: void connectUi(); void enableUI(bool enabled); bool canEnableLoginButton() const; + void loginClicked(); + void cancelClicked(); + void processLoginResult(bool result, const QString& message); + Ui::AchievementLoginDialog m_ui; QPushButton* m_login; Achievements::LoginRequestReason m_reason; diff --git a/src/duckstation-qt/achievementsettingswidget.h b/src/duckstation-qt/achievementsettingswidget.h index 9e6affe2b..8d1678658 100644 --- a/src/duckstation-qt/achievementsettingswidget.h +++ b/src/duckstation-qt/achievementsettingswidget.h @@ -2,9 +2,11 @@ // SPDX-License-Identifier: CC-BY-NC-ND-4.0 #pragma once -#include + #include "ui_achievementsettingswidget.h" +#include + class SettingsWindow; class AchievementSettingsWidget : public QWidget @@ -15,7 +17,9 @@ public: explicit AchievementSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~AchievementSettingsWidget(); -private Q_SLOTS: +private: + void updateLoginState(); + void updateEnableState(); void onHardcoreModeStateChanged(); void onAchievementsNotificationDurationSliderChanged(); @@ -24,9 +28,6 @@ private Q_SLOTS: void onViewProfilePressed(); void onAchievementsRefreshed(quint32 id, const QString& game_info_string); -private: - void updateLoginState(); - Ui::AchievementSettingsWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/advancedsettingswidget.h b/src/duckstation-qt/advancedsettingswidget.h index 86dd52b1c..f99ad580c 100644 --- a/src/duckstation-qt/advancedsettingswidget.h +++ b/src/duckstation-qt/advancedsettingswidget.h @@ -20,11 +20,6 @@ public: Q_SIGNALS: void onShowDebugOptionsChanged(bool enabled); -private Q_SLOTS: - void onLogChannelsButtonClicked(); - void onAnyLogSinksChanged(); - void onShowDebugOptionsStateChanged(); - private: struct TweakOption { @@ -55,12 +50,16 @@ private: }; }; + void addTweakOptions(); + void onResetToDefaultClicked(); + + void onLogChannelsButtonClicked(); + void onAnyLogSinksChanged(); + void onShowDebugOptionsStateChanged(); + SettingsWindow* m_dialog; Ui::AdvancedSettingsWidget m_ui; QVector m_tweak_options; - - void addTweakOptions(); - void onResetToDefaultClicked(); }; diff --git a/src/duckstation-qt/audiosettingswidget.h b/src/duckstation-qt/audiosettingswidget.h index a3b804b01..e5405eac0 100644 --- a/src/duckstation-qt/audiosettingswidget.h +++ b/src/duckstation-qt/audiosettingswidget.h @@ -21,7 +21,10 @@ public: AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~AudioSettingsWidget(); -private Q_SLOTS: +private: + AudioBackend getEffectiveBackend() const; + void resetVolume(bool fast_forward); + void onStretchModeChanged(); void updateDriverNames(); @@ -35,10 +38,6 @@ private Q_SLOTS: void onStretchSettingsClicked(); -private: - AudioBackend getEffectiveBackend() const; - void resetVolume(bool fast_forward); - Ui::AudioSettingsWidget m_ui; SettingsWindow* m_dialog; u32 m_output_device_latency = 0; diff --git a/src/duckstation-qt/autoupdaterwindow.h b/src/duckstation-qt/autoupdaterwindow.h index d10c0b6ec..4def46a46 100644 --- a/src/duckstation-qt/autoupdaterwindow.h +++ b/src/duckstation-qt/autoupdaterwindow.h @@ -29,6 +29,9 @@ public: explicit AutoUpdaterWindow(QWidget* parent = nullptr); ~AutoUpdaterWindow(); + void queueUpdateCheck(bool display_errors); + void queueGetLatestRelease(); + static bool isSupported(); static bool canInstallUpdate(); static QStringList getTagList(); @@ -40,21 +43,16 @@ public: Q_SIGNALS: void updateCheckCompleted(); -public Q_SLOTS: - void queueUpdateCheck(bool display_errors); - void queueGetLatestRelease(); +protected: + void closeEvent(QCloseEvent* event) override; -private Q_SLOTS: +private: void httpPollTimerPoll(); void downloadUpdateClicked(); void skipThisUpdateClicked(); void remindMeLaterClicked(); -protected: - void closeEvent(QCloseEvent* event) override; - -private: void reportError(const std::string_view msg); bool ensureHttpReady(); diff --git a/src/duckstation-qt/biossettingswidget.h b/src/duckstation-qt/biossettingswidget.h index 53249f419..2a65744a0 100644 --- a/src/duckstation-qt/biossettingswidget.h +++ b/src/duckstation-qt/biossettingswidget.h @@ -27,12 +27,11 @@ public: bool per_game); static void setDropDownValue(QComboBox* cb, const std::optional& name, bool per_game); -private Q_SLOTS: +private: void refreshList(); void onPIODeviceTypeChanged(); void onPIOImagePathBrowseClicked(); -private: Ui::BIOSSettingsWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/colorpickerbutton.h b/src/duckstation-qt/colorpickerbutton.h index a9829e659..6a627880a 100644 --- a/src/duckstation-qt/colorpickerbutton.h +++ b/src/duckstation-qt/colorpickerbutton.h @@ -12,18 +12,16 @@ class ColorPickerButton : public QPushButton public: ColorPickerButton(QWidget* parent); -Q_SIGNALS: - void colorChanged(quint32 new_color); - -public Q_SLOTS: quint32 color(); void setColor(quint32 rgb); -private Q_SLOTS: - void onClicked(); +Q_SIGNALS: + void colorChanged(quint32 new_color); private: void updateBackgroundColor(); + void onClicked(); + u32 m_color = 0; }; diff --git a/src/duckstation-qt/consolesettingswidget.h b/src/duckstation-qt/consolesettingswidget.h index 29d59ad28..4078b3a75 100644 --- a/src/duckstation-qt/consolesettingswidget.h +++ b/src/duckstation-qt/consolesettingswidget.h @@ -17,16 +17,15 @@ public: explicit ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~ConsoleSettingsWidget(); -private Q_SLOTS: +private: + void calculateCPUClockValue(); + void onFastBootChanged(); void updateRecompilerICacheEnabled(); void onEnableCPUClockSpeedControlChecked(int state); void onCPUClockSpeedValueChanged(int value); void updateCPUClockSpeedLabel(); -private: - void calculateCPUClockValue(); - Ui::ConsoleSettingsWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/controllerbindingwidgets.h b/src/duckstation-qt/controllerbindingwidgets.h index 80f356f42..cce69ee0c 100644 --- a/src/duckstation-qt/controllerbindingwidgets.h +++ b/src/duckstation-qt/controllerbindingwidgets.h @@ -40,15 +40,6 @@ public: static bool doMultipleDeviceAutomaticBinding(QWidget* parent, ControllerSettingsWindow* parent_dialog, u32 port); -private Q_SLOTS: - void onTypeChanged(); - void onAutomaticBindingClicked(); - void onClearBindingsClicked(); - void onBindingsClicked(); - void onSettingsClicked(); - void onMacrosClicked(); - void onMultipleDeviceAutomaticBindingTriggered(); - private: void populateControllerTypes(); void populateWidgets(); @@ -58,6 +49,14 @@ private: void doDeviceAutomaticBinding(const QString& device); void saveAndRefresh(); + void onTypeChanged(); + void onAutomaticBindingClicked(); + void onClearBindingsClicked(); + void onBindingsClicked(); + void onSettingsClicked(); + void onMacrosClicked(); + void onMultipleDeviceAutomaticBindingTriggered(); + Ui::ControllerBindingWidget m_ui; ControllerSettingsWindow* m_dialog; @@ -106,17 +105,16 @@ public: QString getSummary() const; -private Q_SLOTS: - void onPressureChanged(); - void onDeadzoneChanged(); - void onSetFrequencyClicked(); - void updateBinds(); - private: void modFrequency(s32 delta); void updateFrequency(); void updateFrequencyText(); + void onPressureChanged(); + void onDeadzoneChanged(); + void onSetFrequencyClicked(); + void updateBinds(); + Ui::ControllerMacroEditWidget m_ui; ControllerMacroWidget* m_parent; @@ -137,10 +135,9 @@ public: explicit ControllerCustomSettingsWidget(ControllerBindingWidget* parent); ~ControllerCustomSettingsWidget(); -private Q_SLOTS: +private: void restoreDefaults(); -private: ControllerBindingWidget* m_parent; }; diff --git a/src/duckstation-qt/controllersettingswindow.h b/src/duckstation-qt/controllersettingswindow.h index f4dcd8326..617c94cf1 100644 --- a/src/duckstation-qt/controllersettingswindow.h +++ b/src/duckstation-qt/controllersettingswindow.h @@ -9,12 +9,12 @@ #include "core/types.h" +#include #include #include #include #include #include -#include #include #include @@ -67,6 +67,8 @@ public: void switchProfile(const std::string_view name); + void setCategory(Category category); + // Helper functions for updating setting values globally or in the profile. bool getBoolValue(const char* section, const char* key, bool default_value) const; s32 getIntValue(const char* section, const char* key, s32 default_value) const; @@ -81,20 +83,6 @@ Q_SIGNALS: void windowClosed(); void inputProfileSwitched(); -public Q_SLOTS: - void setCategory(Category category); - -private Q_SLOTS: - void onCategoryCurrentRowChanged(int row); - void onCurrentProfileChanged(int index); - void onNewProfileClicked(); - void onApplyProfileClicked(); - void onDeleteProfileClicked(); - void onRestoreDefaultsClicked(); - void onCopyGlobalSettingsClicked(); - - void createWidgets(); - protected: void closeEvent(QCloseEvent* event) override; @@ -104,6 +92,16 @@ private: std::array getEnabledMultitaps() const; + void createWidgets(); + + void onCategoryCurrentRowChanged(int row); + void onCurrentProfileChanged(int index); + void onNewProfileClicked(); + void onApplyProfileClicked(); + void onDeleteProfileClicked(); + void onRestoreDefaultsClicked(); + void onCopyGlobalSettingsClicked(); + Ui::ControllerSettingsWindow m_ui; INISettingsInterface* m_editing_settings_interface = nullptr; diff --git a/src/duckstation-qt/coverdownloadwindow.h b/src/duckstation-qt/coverdownloadwindow.h index 8a95a5d56..5f61ec652 100644 --- a/src/duckstation-qt/coverdownloadwindow.h +++ b/src/duckstation-qt/coverdownloadwindow.h @@ -30,14 +30,6 @@ Q_SIGNALS: protected: void closeEvent(QCloseEvent* ev); -private Q_SLOTS: - void onDownloadStatus(const QString& text); - void onDownloadProgress(int value, int range); - void onDownloadComplete(); - void onStartClicked(); - void onCloseClicked(); - void updateEnabled(); - private: class CoverDownloadThread : public QtAsyncProgressThread { @@ -56,6 +48,13 @@ private: void startThread(); void cancelThread(); + void onDownloadStatus(const QString& text); + void onDownloadProgress(int value, int range); + void onDownloadComplete(); + void onStartClicked(); + void onCloseClicked(); + void updateEnabled(); + Ui::CoverDownloadWindow m_ui; std::unique_ptr m_thread; Timer m_last_refresh_time; diff --git a/src/duckstation-qt/debuggermodels.h b/src/duckstation-qt/debuggermodels.h index 5fed80d6c..39ce57d31 100644 --- a/src/duckstation-qt/debuggermodels.h +++ b/src/duckstation-qt/debuggermodels.h @@ -63,10 +63,9 @@ public: u32 getAddress() const { return m_address; } CPU::BreakpointType getType() const { return m_type; } -private Q_SLOTS: +private: void okClicked(); -private: Ui::DebuggerAddBreakpointDialog m_ui; u32 m_address = 0; CPU::BreakpointType m_type = CPU::BreakpointType::Execute; diff --git a/src/duckstation-qt/debuggerwindow.h b/src/duckstation-qt/debuggerwindow.h index c44dcf309..928dc76ff 100644 --- a/src/duckstation-qt/debuggerwindow.h +++ b/src/duckstation-qt/debuggerwindow.h @@ -33,7 +33,25 @@ Q_SIGNALS: protected: void closeEvent(QCloseEvent* event); -private Q_SLOTS: +private: + void setupAdditionalUi(); + void connectSignals(); + void disconnectSignals(); + void createModels(); + void setUIEnabled(bool enabled, bool allow_pause); + void saveCurrentState(); + void setMemoryViewRegion(Bus::MemoryRegion region); + void toggleBreakpoint(VirtualMemoryAddress address); + void clearBreakpoints(); + bool tryFollowLoadStore(VirtualMemoryAddress address); + void scrollToPC(bool center); + void scrollToCodeAddress(VirtualMemoryAddress address, bool center); + bool scrollToMemoryAddress(VirtualMemoryAddress address); + void refreshBreakpointList(); + void refreshBreakpointList(const CPU::BreakpointList& bps); + void addBreakpoint(CPU::BreakpointType type, u32 address); + void removeBreakpoint(CPU::BreakpointType type, u32 address); + void onSystemStarted(); void onSystemDestroyed(); void onSystemPaused(); @@ -64,25 +82,6 @@ private Q_SLOTS: void onMemorySearchTriggered(); void onMemorySearchStringChanged(const QString&); -private: - void setupAdditionalUi(); - void connectSignals(); - void disconnectSignals(); - void createModels(); - void setUIEnabled(bool enabled, bool allow_pause); - void saveCurrentState(); - void setMemoryViewRegion(Bus::MemoryRegion region); - void toggleBreakpoint(VirtualMemoryAddress address); - void clearBreakpoints(); - bool tryFollowLoadStore(VirtualMemoryAddress address); - void scrollToPC(bool center); - void scrollToCodeAddress(VirtualMemoryAddress address, bool center); - bool scrollToMemoryAddress(VirtualMemoryAddress address); - void refreshBreakpointList(); - void refreshBreakpointList(const CPU::BreakpointList& bps); - void addBreakpoint(CPU::BreakpointType type, u32 address); - void removeBreakpoint(CPU::BreakpointType type, u32 address); - Ui::DebuggerWindow m_ui; DebuggerRegistersModel* m_registers_model; diff --git a/src/duckstation-qt/emulationsettingswidget.h b/src/duckstation-qt/emulationsettingswidget.h index f6ecca436..9b99b492d 100644 --- a/src/duckstation-qt/emulationsettingswidget.h +++ b/src/duckstation-qt/emulationsettingswidget.h @@ -17,7 +17,9 @@ public: explicit EmulationSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~EmulationSettingsWidget(); -private Q_SLOTS: +private: + void fillComboBoxWithEmulationSpeeds(QComboBox* cb, float global_value); + void onEmulationSpeedIndexChanged(int index); void onFastForwardSpeedIndexChanged(int index); void onTurboSpeedIndexChanged(int index); @@ -26,9 +28,6 @@ private Q_SLOTS: void updateSkipDuplicateFramesEnabled(); void updateRewind(); -private: - void fillComboBoxWithEmulationSpeeds(QComboBox* cb, float global_value); - Ui::EmulationSettingsWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/gamecheatsettingswidget.h b/src/duckstation-qt/gamecheatsettingswidget.h index 67203977d..35d692737 100644 --- a/src/duckstation-qt/gamecheatsettingswidget.h +++ b/src/duckstation-qt/gamecheatsettingswidget.h @@ -43,7 +43,7 @@ public: bool hasCodeWithName(const std::string_view name) const; void disableAllCheats(); -private Q_SLOTS: +private: void onEnableCheatsChanged(Qt::CheckState state); void onSortCheatsToggled(bool checked); void onSearchFilterChanged(const QString& text); @@ -60,7 +60,6 @@ private Q_SLOTS: void onClearClicked(); void reloadList(); -private: bool shouldLoadFromDatabase() const; void checkForMasterDisable(); @@ -97,7 +96,7 @@ public: CheatCodeEditorDialog(GameCheatSettingsWidget* parent, Cheats::CodeInfo* code, const QStringList& group_names); ~CheatCodeEditorDialog() override; -private Q_SLOTS: +private: void onGroupSelectedIndexChanged(int index); void saveClicked(); @@ -106,7 +105,6 @@ private Q_SLOTS: void onRangeMaxChanged(int value); void onEditChoiceClicked(); -private: void setupAdditionalUi(const QStringList& group_names); void fillUi(); @@ -127,11 +125,10 @@ public: Cheats::CodeOptionList getNewOptions() const; -private Q_SLOTS: +private: void onAddClicked(); void onRemoveClicked(); void onSaveClicked(); -private: Ui::GameCheatCodeChoiceEditorDialog m_ui; }; diff --git a/src/duckstation-qt/gamelistsettingswidget.h b/src/duckstation-qt/gamelistsettingswidget.h index 2d59cfa03..c658345dc 100644 --- a/src/duckstation-qt/gamelistsettingswidget.h +++ b/src/duckstation-qt/gamelistsettingswidget.h @@ -20,10 +20,14 @@ public: bool addExcludedPath(const QString& path); void refreshExclusionList(); -public Q_SLOTS: void addSearchDirectory(QWidget* parent_widget); -private Q_SLOTS: +private: + void addPathToTable(const std::string& path, bool recursive); + void refreshDirectoryList(); + void addSearchDirectory(const QString& path, bool recursive); + void removeSearchDirectory(const QString& path); + void onDirectoryListContextMenuRequested(const QPoint& point); void onAddSearchDirectoryButtonClicked(); void onRemoveSearchDirectoryButtonClicked(); @@ -35,11 +39,5 @@ private Q_SLOTS: void onScanForNewGamesClicked(); void onRescanAllGamesClicked(); -private: - void addPathToTable(const std::string& path, bool recursive); - void refreshDirectoryList(); - void addSearchDirectory(const QString& path, bool recursive); - void removeSearchDirectory(const QString& path); - Ui::GameListSettingsWidget m_ui; }; diff --git a/src/duckstation-qt/gamelistwidget.h b/src/duckstation-qt/gamelistwidget.h index 1e2aac004..15039c1ef 100644 --- a/src/duckstation-qt/gamelistwidget.h +++ b/src/duckstation-qt/gamelistwidget.h @@ -182,10 +182,6 @@ public: protected: void wheelEvent(QWheelEvent* e) override; -private Q_SLOTS: - void onHeaderContextMenuRequested(const QPoint& point); - void saveColumnSortSettings(); - private: void setFixedColumnWidth(int column, int width); void setFixedColumnWidths(); @@ -193,6 +189,9 @@ private: void loadColumnVisibilitySettings(); void loadColumnSortSettings(); + void onHeaderContextMenuRequested(const QPoint& point); + void saveColumnSortSettings(); + GameListModel* m_model = nullptr; GameListSortModel* m_sort_model = nullptr; }; @@ -210,7 +209,6 @@ public: void adjustZoom(float delta); -public Q_SLOTS: void updateLayout(); protected: @@ -252,6 +250,15 @@ public: const GameList::Entry* getSelectedEntry() const; + void showGameList(); + void showGameGrid(); + void setMergeDiscSets(bool enabled); + void setShowLocalizedTitles(bool enabled); + void setShowGameIcons(bool enabled); + void setShowCoverTitles(bool enabled); + void refreshGridCovers(); + void focusSearchWidget(); + Q_SIGNALS: void refreshProgress(const QString& status, int current, int total); void refreshComplete(); @@ -262,7 +269,13 @@ Q_SIGNALS: void addGameDirectoryRequested(); -private Q_SLOTS: +protected: + bool event(QEvent* e) override; + +private: + void setViewMode(int stack_index); + void updateBackground(bool reload_image); + void onRefreshProgress(const QString& status, int current, int total, int entry_count, float time); void onRefreshComplete(); @@ -278,23 +291,6 @@ private Q_SLOTS: void onGridViewContextMenuRequested(const QPoint& point); void onSearchReturnPressed(); -public Q_SLOTS: - void showGameList(); - void showGameGrid(); - void setMergeDiscSets(bool enabled); - void setShowLocalizedTitles(bool enabled); - void setShowGameIcons(bool enabled); - void setShowCoverTitles(bool enabled); - void refreshGridCovers(); - void focusSearchWidget(); - -protected: - bool event(QEvent* e) override; - -private: - void setViewMode(int stack_index); - void updateBackground(bool reload_image); - Ui::GameListWidget m_ui; GameListModel* m_model = nullptr; diff --git a/src/duckstation-qt/gamepatchsettingswidget.h b/src/duckstation-qt/gamepatchsettingswidget.h index a74471c1b..a7da120e3 100644 --- a/src/duckstation-qt/gamepatchsettingswidget.h +++ b/src/duckstation-qt/gamepatchsettingswidget.h @@ -23,10 +23,9 @@ public: bool disallowed_for_achievements, bool enabled, SettingsWindow* dialog, QWidget* parent); ~GamePatchDetailsWidget(); -private Q_SLOTS: +private: void onEnabledStateChanged(Qt::CheckState state); -private: Ui::GamePatchDetailsWidget m_ui; SettingsWindow* m_dialog; std::string m_name; @@ -40,15 +39,13 @@ public: GamePatchSettingsWidget(SettingsWindow* dialog, QWidget* parent); ~GamePatchSettingsWidget(); -public Q_SLOTS: void disableAllPatches(); -private Q_SLOTS: - void onReloadClicked(); - private: void reloadList(); + void onReloadClicked(); + Ui::GamePatchSettingsWidget m_ui; SettingsWindow* m_dialog; }; diff --git a/src/duckstation-qt/gamesummarywidget.h b/src/duckstation-qt/gamesummarywidget.h index cd90e2ea1..061d25701 100644 --- a/src/duckstation-qt/gamesummarywidget.h +++ b/src/duckstation-qt/gamesummarywidget.h @@ -25,14 +25,6 @@ public: void reloadGameSettings(); -private Q_SLOTS: - void onSeparateDiscSettingsChanged(Qt::CheckState state); - void onCustomLanguageChanged(int language); - void onCompatibilityCommentsClicked(); - void onInputProfileChanged(int index); - void onEditInputProfileClicked(); - void onComputeHashClicked(); - private: void populateUi(const GameList::Entry* entry); void setCustomTitle(const std::string& text); @@ -41,6 +33,13 @@ private: void populateTracksInfo(); + void onSeparateDiscSettingsChanged(Qt::CheckState state); + void onCustomLanguageChanged(int language); + void onCompatibilityCommentsClicked(); + void onInputProfileChanged(int index); + void onEditInputProfileClicked(); + void onComputeHashClicked(); + Ui::GameSummaryWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/graphicssettingswidget.h b/src/duckstation-qt/graphicssettingswidget.h index a42bfa16d..3abcf559c 100644 --- a/src/duckstation-qt/graphicssettingswidget.h +++ b/src/duckstation-qt/graphicssettingswidget.h @@ -23,10 +23,17 @@ public: static void populateUpscalingModes(QComboBox* cb, int max_scale); -public Q_SLOTS: void onShowDebugSettingsChanged(bool enabled); -private Q_SLOTS: +private: + static constexpr int TAB_INDEX_RENDERING = 0; + static constexpr int TAB_INDEX_ADVANCED = 1; + static constexpr int TAB_INDEX_PGXP = 2; + static constexpr int TAB_INDEX_OSD = 3; + static constexpr int TAB_INDEX_CAPTURE = 4; + static constexpr int TAB_INDEX_TEXTURE_REPLACEMENTS = 5; + static constexpr int TAB_INDEX_DEBUGGING = 6; + void updateRendererDependentOptions(); void updatePGXPSettingsEnabled(); @@ -47,15 +54,6 @@ private Q_SLOTS: void onGPUThreadChanged(); -private: - static constexpr int TAB_INDEX_RENDERING = 0; - static constexpr int TAB_INDEX_ADVANCED = 1; - static constexpr int TAB_INDEX_PGXP = 2; - static constexpr int TAB_INDEX_OSD = 3; - static constexpr int TAB_INDEX_CAPTURE = 4; - static constexpr int TAB_INDEX_TEXTURE_REPLACEMENTS = 5; - static constexpr int TAB_INDEX_DEBUGGING = 6; - void setupAdditionalUi(); void removePlatformSpecificUi(); diff --git a/src/duckstation-qt/hotkeysettingswidget.h b/src/duckstation-qt/hotkeysettingswidget.h index 2aa874de6..308b2ec14 100644 --- a/src/duckstation-qt/hotkeysettingswidget.h +++ b/src/duckstation-qt/hotkeysettingswidget.h @@ -52,10 +52,8 @@ private: void createUi(); void createButtons(); -private Q_SLOTS: void setFilter(const QString& filter); -private: ControllerSettingsWindow* m_dialog; QScrollArea* m_scroll_area = nullptr; Container* m_container = nullptr; diff --git a/src/duckstation-qt/inputbindingdialog.h b/src/duckstation-qt/inputbindingdialog.h index 940dccf73..d3bce5cb8 100644 --- a/src/duckstation-qt/inputbindingdialog.h +++ b/src/duckstation-qt/inputbindingdialog.h @@ -21,13 +21,6 @@ public: std::string key_name, std::vector bindings, QWidget* parent); ~InputBindingDialog(); -protected Q_SLOTS: - void onAddBindingButtonClicked(); - void onRemoveBindingButtonClicked(); - void onClearBindingsButtonClicked(); - void onInputListenTimerTimeout(); - void inputManagerHookCallback(InputBindingKey key, float value); - protected: enum : u32 { @@ -53,6 +46,12 @@ protected: void onDeadzoneChanged(int value); void onResetSensitivityClicked(); + void onAddBindingButtonClicked(); + void onRemoveBindingButtonClicked(); + void onClearBindingsButtonClicked(); + void onInputListenTimerTimeout(); + void inputManagerHookCallback(InputBindingKey key, float value); + Ui::InputBindingDialog m_ui; SettingsInterface* m_sif; diff --git a/src/duckstation-qt/inputbindingwidgets.h b/src/duckstation-qt/inputbindingwidgets.h index 32193505b..198a63dc4 100644 --- a/src/duckstation-qt/inputbindingwidgets.h +++ b/src/duckstation-qt/inputbindingwidgets.h @@ -27,15 +27,9 @@ public: void initialize(SettingsInterface* sif, InputBindingInfo::Type bind_type, std::string section_name, std::string key_name); -public Q_SLOTS: void clearBinding(); void reloadBinding(); -protected Q_SLOTS: - void onClicked(); - void onInputListenTimerTimeout(); - void inputManagerHookCallback(InputBindingKey key, float value); - protected: enum : u32 { @@ -58,6 +52,10 @@ protected: void hookInputManager(); void unhookInputManager(); + void onClicked(); + void onInputListenTimerTimeout(); + void inputManagerHookCallback(InputBindingKey key, float value); + SettingsInterface* m_sif = nullptr; InputBindingInfo::Type m_bind_type = InputBindingInfo::Type::Unknown; std::string m_section_name; @@ -83,15 +81,13 @@ public: void setKey(ControllerSettingsWindow* dialog, std::string section_name, std::string key_name); -public Q_SLOTS: void clearBinding(); -protected Q_SLOTS: - void onClicked(); - protected: virtual void mouseReleaseEvent(QMouseEvent* e) override; + void onClicked(); + private: std::string m_section_name; std::string m_key_name; diff --git a/src/duckstation-qt/interfacesettingswidget.h b/src/duckstation-qt/interfacesettingswidget.h index 1f085495c..25f397e0b 100644 --- a/src/duckstation-qt/interfacesettingswidget.h +++ b/src/duckstation-qt/interfacesettingswidget.h @@ -22,13 +22,12 @@ public: Q_SIGNALS: void themeChanged(); -private Q_SLOTS: - void onRenderToSeparateWindowChanged(); - void onLanguageChanged(); - private: void setupAdditionalUi(); + void onRenderToSeparateWindowChanged(); + void onLanguageChanged(); + Ui::InterfaceSettingsWidget m_ui; SettingsWindow* m_dialog; diff --git a/src/duckstation-qt/isobrowserwindow.h b/src/duckstation-qt/isobrowserwindow.h index 312087048..c417a174f 100644 --- a/src/duckstation-qt/isobrowserwindow.h +++ b/src/duckstation-qt/isobrowserwindow.h @@ -19,13 +19,6 @@ public: bool tryOpenFile(const QString& path, Error* error = nullptr); -private Q_SLOTS: - void onOpenFileClicked(); - void onDirectoryItemClicked(QTreeWidgetItem* item, int column); - void onFileItemActivated(QTreeWidgetItem* item, int column); - void onFileItemSelectionChanged(); - void onFileContextMenuRequested(const QPoint& pos); - private: void enableUi(bool enabled); void enableExtractButtons(bool enabled); @@ -35,6 +28,12 @@ private: void onExtractClicked(IsoReader::ReadMode mode); void extractFile(const QString& path, IsoReader::ReadMode mode); + void onOpenFileClicked(); + void onDirectoryItemClicked(QTreeWidgetItem* item, int column); + void onFileItemActivated(QTreeWidgetItem* item, int column); + void onFileItemSelectionChanged(); + void onFileContextMenuRequested(const QPoint& pos); + QTreeWidgetItem* findDirectoryItemForPath(const QString& path, QTreeWidgetItem* parent = nullptr) const; Ui::ISOBrowserWindow m_ui; diff --git a/src/duckstation-qt/logwindow.h b/src/duckstation-qt/logwindow.h index 1a05adfd7..d3b467e9d 100644 --- a/src/duckstation-qt/logwindow.h +++ b/src/duckstation-qt/logwindow.h @@ -29,33 +29,31 @@ public: static void populateFilterMenu(QMenu* menu); -private: - void createUi(); - void updateLogLevelUi(); - void setLogLevel(Log::Level level); - - static void logCallback(void* pUserParam, Log::MessageCategory cat, const char* functionName, - std::string_view message); - protected: void closeEvent(QCloseEvent* event); void changeEvent(QEvent* event); -private Q_SLOTS: - void onClearTriggered(); - void onSaveTriggered(); - void appendMessage(const QLatin1StringView& channel, quint32 cat, const QString& message); - void realAppendMessage(const QLatin1StringView& channel, quint32 cat, const QString& message); - private: static constexpr int DEFAULT_WIDTH = 750; static constexpr int DEFAULT_HEIGHT = 400; static constexpr int MAX_LINES = 1000; static constexpr int BLOCK_UPDATES_THRESHOLD = 100; + void createUi(); + void updateLogLevelUi(); + void setLogLevel(Log::Level level); + + void onClearTriggered(); + void onSaveTriggered(); + void appendMessage(const QLatin1StringView& channel, quint32 cat, const QString& message); + void realAppendMessage(const QLatin1StringView& channel, quint32 cat, const QString& message); + void saveSize(); void restoreSize(); + static void logCallback(void* pUserParam, Log::MessageCategory cat, const char* functionName, + std::string_view message); + QPlainTextEdit* m_text; QMenu* m_level_menu; diff --git a/src/duckstation-qt/mainwindow.h b/src/duckstation-qt/mainwindow.h index 4deb669ab..71e6db4f0 100644 --- a/src/duckstation-qt/mainwindow.h +++ b/src/duckstation-qt/mainwindow.h @@ -114,7 +114,6 @@ public: SettingsWindow* getSettingsWindow(); ControllerSettingsWindow* getControllerSettingsWindow(); -public Q_SLOTS: /// Updates debug menu visibility (hides if disabled). void updateDebugMenuVisibility(); @@ -140,7 +139,88 @@ public Q_SLOTS: void onRAIntegrationMenuChanged(); -private Q_SLOTS: +protected: + void closeEvent(QCloseEvent* event) override; + void changeEvent(QEvent* event) override; + void dragEnterEvent(QDragEnterEvent* event) override; + void dropEvent(QDropEvent* event) override; + void moveEvent(QMoveEvent* event) override; + void resizeEvent(QResizeEvent* event) override; + +#ifdef _WIN32 + bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result) override; +#endif + +private: + /// Initializes the window. Call once at startup. + void initialize(); + + void setupAdditionalUi(); + void connectSignals(); + + void updateToolbarActions(); + void updateToolbarIconStyle(); + void updateToolbarArea(); + void updateEmulationActions(bool starting, bool running, bool cheevos_challenge_mode); + void updateShortcutActions(bool starting); + void updateStatusBarWidgetVisibility(); + void updateWindowTitle(); + void updateWindowState(); + + void setProgressBar(int current, int total); + void clearProgressBar(); + + QWidget* getDisplayContainer() const; + bool isShowingGameList() const; + bool isRenderingFullscreen() const; + bool isRenderingToMain() const; + bool shouldHideMouseCursor() const; + bool shouldHideMainWindow() const; + + void switchToGameListView(); + void switchToEmulationView(); + void saveDisplayWindowGeometryToConfig(); + void restoreDisplayWindowGeometryFromConfig(); + bool wantsDisplayWidget() const; + void createDisplayWidget(bool fullscreen, bool render_to_main); + void destroyDisplayWidget(bool show_game_list); + void updateDisplayWidgetCursor(); + void updateDisplayRelatedActions(bool has_surface, bool fullscreen); + void updateGameListRelatedActions(); + void exitFullscreen(bool wait_for_completion); + + void doSettings(const char* category = nullptr); + void openGamePropertiesForCurrentGame(const char* category = nullptr); + void doControllerSettings(ControllerSettingsWindow::Category category = ControllerSettingsWindow::Category::Count); + void onViewChangeGameListBackgroundTriggered(); + void onViewClearGameListBackgroundTriggered(); + + std::string getDeviceDiscPath(const QString& title); + void setGameListEntryCoverImage(const GameList::Entry* entry); + void clearGameListEntryPlayTime(const GameList::Entry* entry); + void updateTheme(); + void reloadThemeSpecificImages(); + void onSettingsThemeChanged(); + void destroySubWindows(); + + void registerForDeviceNotifications(); + void unregisterForDeviceNotifications(); + void notifyRAIntegrationOfWindowChange(); + + /// Fills menu with save state info and handlers. + void populateGameListContextMenu(const GameList::Entry* entry, QWidget* parent_window, QMenu* menu); + + void populateLoadStateMenu(std::string_view game_serial, QMenu* menu); + void populateSaveStateMenu(std::string_view game_serial, QMenu* menu); + + const GameList::Entry* resolveDiscSetEntry(const GameList::Entry* entry, + std::unique_lock& lock); + std::shared_ptr getSystemBootParameters(std::string file); + std::optional promptForResumeState(const std::string& save_state_path); + void startFile(std::string path, std::optional save_path, std::optional fast_boot); + void startFileOrChangeDisc(const QString& path); + void promptForDiscChange(const QString& path); + std::optional acquireRenderWindow(RenderAPI render_api, bool fullscreen, bool exclusive_fullscreen, bool surfaceless, Error* error); void displayResizeRequested(qint32 width, qint32 height); @@ -231,88 +311,6 @@ private Q_SLOTS: void onDebugLogChannelsMenuAboutToShow(); void openCPUDebugger(); -protected: - void closeEvent(QCloseEvent* event) override; - void changeEvent(QEvent* event) override; - void dragEnterEvent(QDragEnterEvent* event) override; - void dropEvent(QDropEvent* event) override; - void moveEvent(QMoveEvent* event) override; - void resizeEvent(QResizeEvent* event) override; - -#ifdef _WIN32 - bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result) override; -#endif - -private: - /// Initializes the window. Call once at startup. - void initialize(); - - void setupAdditionalUi(); - void connectSignals(); - - void updateToolbarActions(); - void updateToolbarIconStyle(); - void updateToolbarArea(); - void updateEmulationActions(bool starting, bool running, bool cheevos_challenge_mode); - void updateShortcutActions(bool starting); - void updateStatusBarWidgetVisibility(); - void updateWindowTitle(); - void updateWindowState(); - - void setProgressBar(int current, int total); - void clearProgressBar(); - - QWidget* getDisplayContainer() const; - bool isShowingGameList() const; - bool isRenderingFullscreen() const; - bool isRenderingToMain() const; - bool shouldHideMouseCursor() const; - bool shouldHideMainWindow() const; - - void switchToGameListView(); - void switchToEmulationView(); - void saveDisplayWindowGeometryToConfig(); - void restoreDisplayWindowGeometryFromConfig(); - bool wantsDisplayWidget() const; - void createDisplayWidget(bool fullscreen, bool render_to_main); - void destroyDisplayWidget(bool show_game_list); - void updateDisplayWidgetCursor(); - void updateDisplayRelatedActions(bool has_surface, bool fullscreen); - void updateGameListRelatedActions(); - void exitFullscreen(bool wait_for_completion); - - void doSettings(const char* category = nullptr); - void openGamePropertiesForCurrentGame(const char* category = nullptr); - void doControllerSettings(ControllerSettingsWindow::Category category = ControllerSettingsWindow::Category::Count); - void onViewChangeGameListBackgroundTriggered(); - void onViewClearGameListBackgroundTriggered(); - - std::string getDeviceDiscPath(const QString& title); - void setGameListEntryCoverImage(const GameList::Entry* entry); - void clearGameListEntryPlayTime(const GameList::Entry* entry); - void updateTheme(); - void reloadThemeSpecificImages(); - void onSettingsThemeChanged(); - void destroySubWindows(); - - void registerForDeviceNotifications(); - void unregisterForDeviceNotifications(); - void notifyRAIntegrationOfWindowChange(); - - /// Fills menu with save state info and handlers. - void populateGameListContextMenu(const GameList::Entry* entry, QWidget* parent_window, QMenu* menu); - - void populateLoadStateMenu(std::string_view game_serial, QMenu* menu); - void populateSaveStateMenu(std::string_view game_serial, QMenu* menu); - - const GameList::Entry* resolveDiscSetEntry(const GameList::Entry* entry, - std::unique_lock& lock); - std::shared_ptr getSystemBootParameters(std::string file); - std::optional promptForResumeState(const std::string& save_state_path); - void startFile(std::string path, std::optional save_path, std::optional fast_boot); - void startFileOrChangeDisc(const QString& path); - void promptForDiscChange(const QString& path); - Ui::MainWindow m_ui; GameListWidget* m_game_list_widget = nullptr; diff --git a/src/duckstation-qt/memorycardeditorwindow.h b/src/duckstation-qt/memorycardeditorwindow.h index b948037c0..8a19d5b01 100644 --- a/src/duckstation-qt/memorycardeditorwindow.h +++ b/src/duckstation-qt/memorycardeditorwindow.h @@ -34,15 +34,6 @@ public: protected: bool event(QEvent* event) override; -private Q_SLOTS: - void onCardASelectionChanged(); - void onCardBSelectionChanged(); - void onCardContextMenuRequested(const QPoint& pos); - void doCopyFile(); - void doDeleteFile(); - void doUndeleteFile(); - void incrementAnimationFrame(); - private: struct Card { @@ -88,6 +79,14 @@ private: void updateAnimationTimerActive(); + void onCardASelectionChanged(); + void onCardBSelectionChanged(); + void onCardContextMenuRequested(const QPoint& pos); + void doCopyFile(); + void doDeleteFile(); + void doUndeleteFile(); + void incrementAnimationFrame(); + Ui::MemoryCardEditorDialog m_ui; QPushButton* m_deleteFile; QPushButton* m_undeleteFile; @@ -114,12 +113,11 @@ public: static std::string promptForNewName(QWidget* parent, std::string_view old_name); -private Q_SLOTS: - void updateSimplifiedFieldsFromFullName(); - void updateFullNameFromSimplifiedFields(); - private: void setupAdditionalUi(); + void updateSimplifiedFieldsFromFullName(); + void updateFullNameFromSimplifiedFields(); + Ui::MemoryCardRenameFileDialog m_ui; }; diff --git a/src/duckstation-qt/memoryscannerwindow.h b/src/duckstation-qt/memoryscannerwindow.h index 5ece96655..72acaac11 100644 --- a/src/duckstation-qt/memoryscannerwindow.h +++ b/src/duckstation-qt/memoryscannerwindow.h @@ -29,7 +29,13 @@ Q_SIGNALS: protected: void closeEvent(QCloseEvent* event); -private Q_SLOTS: +private: + enum : int + { + MAX_DISPLAYED_SCAN_RESULTS = 5000, + SCAN_INTERVAL = 100, + }; + void onSystemStarted(); void onSystemDestroyed(); @@ -48,13 +54,6 @@ private Q_SLOTS: void updateScanValue(); void updateScanUi(); -private: - enum : int - { - MAX_DISPLAYED_SCAN_RESULTS = 5000, - SCAN_INTERVAL = 100, - }; - void setupAdditionalUi(); void connectUi(); void enableUi(bool enabled); diff --git a/src/duckstation-qt/memoryviewwidget.h b/src/duckstation-qt/memoryviewwidget.h index f24366d8f..23f874e4e 100644 --- a/src/duckstation-qt/memoryviewwidget.h +++ b/src/duckstation-qt/memoryviewwidget.h @@ -27,6 +27,9 @@ public: void scrollToAddress(size_t address); void setFont(const QFont& font); + void saveCurrentData(); + void forceRefresh(); + protected: void paintEvent(QPaintEvent* event); void resizeEvent(QResizeEvent* event); @@ -34,13 +37,6 @@ protected: void mouseMoveEvent(QMouseEvent* event); void keyPressEvent(QKeyEvent* event); -public Q_SLOTS: - void saveCurrentData(); - void forceRefresh(); - -private Q_SLOTS: - void adjustContent(); - private: static constexpr size_t INVALID_SELECTED_ADDRESS = ~static_cast(0); @@ -52,6 +48,7 @@ private: void setSelection(size_t new_selection, bool new_ascii); void expandCurrentDataToInclude(size_t offset); void adjustScrollToInclude(size_t offset); + void adjustContent(); void* m_data; size_t m_data_size; diff --git a/src/duckstation-qt/postprocessingsettingswidget.h b/src/duckstation-qt/postprocessingsettingswidget.h index 6c2108b28..1d388eae8 100644 --- a/src/duckstation-qt/postprocessingsettingswidget.h +++ b/src/duckstation-qt/postprocessingsettingswidget.h @@ -33,16 +33,6 @@ public: PostProcessingChainConfigWidget(SettingsWindow* dialog, QWidget* parent, const char* section); ~PostProcessingChainConfigWidget(); -private Q_SLOTS: - void onAddButtonClicked(); - void onRemoveButtonClicked(); - void onClearButtonClicked(); - void onMoveUpButtonClicked(); - void onMoveDownButtonClicked(); - void onReloadButtonClicked(); - void onSelectedShaderChanged(); - void triggerSettingsReload(); - private: SettingsInterface& getSettingsInterfaceToUpdate(); void commitSettingsUpdate(); @@ -54,6 +44,15 @@ private: void updateList(const SettingsInterface& si); void updateList(); + void onAddButtonClicked(); + void onRemoveButtonClicked(); + void onClearButtonClicked(); + void onMoveUpButtonClicked(); + void onMoveDownButtonClicked(); + void onReloadButtonClicked(); + void onSelectedShaderChanged(); + void triggerSettingsReload(); + SettingsWindow* m_dialog; Ui::PostProcessingChainConfigWidget m_ui; @@ -72,13 +71,12 @@ public: u32 stage_index, std::vector options); ~PostProcessingShaderConfigWidget(); -private Q_SLOTS: - void onResetDefaultsClicked(); - private: void createUi(); void updateConfigForOption(const PostProcessing::ShaderOption& option); + void onResetDefaultsClicked(); + QGridLayout* m_layout; PostProcessingChainConfigWidget* m_widget; @@ -97,13 +95,12 @@ public: PostProcessingOverlayConfigWidget(SettingsWindow* dialog, QWidget* parent); ~PostProcessingOverlayConfigWidget(); -private Q_SLOTS: +private: void triggerSettingsReload(); void onOverlayNameCurrentIndexChanged(int index); void onImagePathBrowseClicked(); void onExportCustomConfigClicked(); -private: Ui::PostProcessingOverlayConfigWidget m_ui; SettingsWindow* m_dialog; }; diff --git a/src/duckstation-qt/qthost.h b/src/duckstation-qt/qthost.h index 8a002484c..3ffac06c4 100644 --- a/src/duckstation-qt/qthost.h +++ b/src/duckstation-qt/qthost.h @@ -167,7 +167,7 @@ Q_SIGNALS: /// Big Picture UI requests. void onCoverDownloaderOpenRequested(); -public Q_SLOTS: +public: void setDefaultSettings(bool system = true, bool controller = true); void applySettings(bool display_osd_messages = false); void reloadGameSettings(bool display_osd_messages = false); @@ -217,8 +217,12 @@ public Q_SLOTS: void startControllerTest(); void setGPUThreadRunIdle(bool active); void updateFullscreenUITheme(); + void runOnEmuThread(const std::function& callback); -private Q_SLOTS: +protected: + void run() override; + +private: void stopInThread(); void onDisplayWindowMouseButtonEvent(int button, bool pressed); void onDisplayWindowMouseWheelEvent(float dx, float dy); @@ -228,13 +232,7 @@ private Q_SLOTS: void doBackgroundControllerPoll(); void processAuxiliaryRenderWindowInputEvent(void* userdata, quint32 event, quint32 param1, quint32 param2, quint32 param3); -public Q_SLOTS: - void runOnEmuThread(const std::function& callback); -protected: - void run() override; - -private: void createBackgroundControllerPollTimer(); void destroyBackgroundControllerPollTimer(); void confirmActionIfMemoryCardBusy(const QString& action, bool cancel_resume_on_accept, @@ -295,15 +293,13 @@ public: // NOTE: Should only be called on EmuThread. void enumerateDevices(); -public Q_SLOTS: void onDeviceConnected(const InputBindingKey& key, const QString& identifier, const QString& device_name, const QStringList& vibration_motors); void onDeviceDisconnected(const InputBindingKey& key, const QString& identifier); -private Q_SLOTS: +private: void resetLists(const DeviceList& devices, const QStringList& motors); -private: DeviceList m_devices; QStringList m_vibration_motors; }; diff --git a/src/duckstation-qt/qtprogresscallback.h b/src/duckstation-qt/qtprogresscallback.h index cd417bcd0..872f82039 100644 --- a/src/duckstation-qt/qtprogresscallback.h +++ b/src/duckstation-qt/qtprogresscallback.h @@ -33,9 +33,6 @@ public: void MakeVisible(); -private Q_SLOTS: - void dialogCancelled(); - private: static constexpr int MINIMUM_WIDTH = 500; static constexpr int MINIMUM_HEIGHT_WITHOUT_CANCEL = 70; @@ -43,6 +40,8 @@ private: void checkForDelayedShow(); + void dialogCancelled(); + QProgressDialog m_dialog; Timer m_show_timer; float m_show_delay; @@ -68,6 +67,9 @@ public: bool ModalConfirmation(const std::string_view message) override; void ModalInformation(const std::string_view message) override; + void start(); + void join(); + Q_SIGNALS: void titleUpdated(const QString& title); void statusUpdated(const QString& status); @@ -75,10 +77,6 @@ Q_SIGNALS: void threadStarting(); void threadFinished(); -public Q_SLOTS: - void start(); - void join(); - protected: virtual void runAsync() = 0; void run() final; diff --git a/src/duckstation-qt/selectdiscdialog.h b/src/duckstation-qt/selectdiscdialog.h index 8555b0151..62f6cf7a3 100644 --- a/src/duckstation-qt/selectdiscdialog.h +++ b/src/duckstation-qt/selectdiscdialog.h @@ -24,15 +24,14 @@ public: ALWAYS_INLINE const std::string& getSelectedDiscPath() { return m_selected_path; } -private Q_SLOTS: +private: + void populateList(const GameDatabase::DiscSetEntry* dsentry, bool localized_titles); + void onListItemActivated(const QTreeWidgetItem* item); void updateStartEnabled(); void onSelectClicked(); void onCancelClicked(); -private: - void populateList(const GameDatabase::DiscSetEntry* dsentry, bool localized_titles); - Ui::SelectDiscDialog m_ui; std::string m_selected_path; }; diff --git a/src/duckstation-qt/settingswindow.h b/src/duckstation-qt/settingswindow.h index 12c05c2ef..2c462f4e3 100644 --- a/src/duckstation-qt/settingswindow.h +++ b/src/duckstation-qt/settingswindow.h @@ -108,18 +108,11 @@ public: void setGameTitle(std::string_view title); bool hasGameTrait(GameDatabase::Trait trait); -Q_SIGNALS: - void settingsResetToDefaults(); - -public Q_SLOTS: void setCategory(const char* category); void setCategoryRow(int index); -private Q_SLOTS: - void onCategoryCurrentRowChanged(int row); - void onRestoreDefaultsClicked(); - void onCopyGlobalSettingsClicked(); - void onClearSettingsClicked(); +Q_SIGNALS: + void settingsResetToDefaults(); protected: void closeEvent(QCloseEvent* event) override; @@ -138,6 +131,11 @@ private: void addWidget(QWidget* widget, QString title, QString icon, QString help_text); bool handleWheelEvent(QWheelEvent* event); + void onCategoryCurrentRowChanged(int row); + void onRestoreDefaultsClicked(); + void onCopyGlobalSettingsClicked(); + void onClearSettingsClicked(); + Ui::SettingsWindow m_ui; std::unique_ptr m_sif; diff --git a/src/duckstation-qt/setupwizarddialog.h b/src/duckstation-qt/setupwizarddialog.h index 93ae0f030..e486c1718 100644 --- a/src/duckstation-qt/setupwizarddialog.h +++ b/src/duckstation-qt/setupwizarddialog.h @@ -25,25 +25,6 @@ public: SetupWizardDialog(); ~SetupWizardDialog(); -private Q_SLOTS: - bool canShowNextPage(); - void previousPage(); - void nextPage(); - void confirmCancel(); - - void themeChanged(); - void languageChanged(); - - void refreshBiosList(); - - void onDirectoryListContextMenuRequested(const QPoint& point); - void onAddSearchDirectoryButtonClicked(); - void onRemoveSearchDirectoryButtonClicked(); - void onSearchDirectoryListSelectionChanged(); - void refreshDirectoryList(); - - void doMultipleDeviceAutomaticBinding(u32 port, QLabel* update_label); - private: enum Page : u32 { @@ -69,13 +50,30 @@ private: void updatePageLabels(int prev_page); void updatePageButtons(); + bool canShowNextPage(); + void previousPage(); + void nextPage(); + void confirmCancel(); + + void themeChanged(); + void languageChanged(); + + void refreshBiosList(); + + void onDirectoryListContextMenuRequested(const QPoint& point); + void onAddSearchDirectoryButtonClicked(); + void onRemoveSearchDirectoryButtonClicked(); + void onSearchDirectoryListSelectionChanged(); + void refreshDirectoryList(); + + void doMultipleDeviceAutomaticBinding(u32 port, QLabel* update_label); + void addPathToTable(const std::string& path, bool recursive); QString findCurrentDeviceForPort(u32 port) const; void openAutomaticMappingMenu(u32 port, QLabel* update_label); void doDeviceAutomaticBinding(u32 port, QLabel* update_label, const QString& device); -private Q_SLOTS: void onGraphicsAspectRatioChanged(); void onAchievementsLoginLogoutClicked(); void onAchievementsViewProfileClicked();