summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-05-31 18:11:36 +0200
committerGitHub <noreply@github.com>2024-05-31 18:11:36 +0200
commit072b6cdb1da5495688dffbfde27f81e4ae3e98a8 (patch)
tree9f04638ccbe73474360030567844cfe61781ac93 /Source
parentcd9521f2938404ad4bde96dd6aaae3b17e44ba09 (diff)
parent3b214a4978129a96b136aa23ce9ca5843fb3e3f4 (diff)
Merge pull request #12797 from mitaclaw/branch-watch-tool-fixes-1
Branch Watch Tool: Fixes
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp23
-rw-r--r--Source/Core/DolphinQt/Debugger/BranchWatchDialog.h8
-rw-r--r--Source/Core/DolphinQt/Debugger/BranchWatchTableModel.h7
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp1
4 files changed, 26 insertions, 13 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
index f68b6d5bbf..c20b2e3c2d 100644
--- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
+++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
@@ -57,6 +57,12 @@ public:
: QSortFilterProxyModel(parent), m_branch_watch(branch_watch)
{
}
+ ~BranchWatchProxyModel() override = default;
+
+ BranchWatchProxyModel(const BranchWatchProxyModel&) = delete;
+ BranchWatchProxyModel(BranchWatchProxyModel&&) = delete;
+ BranchWatchProxyModel& operator=(const BranchWatchProxyModel&) = delete;
+ BranchWatchProxyModel& operator=(BranchWatchProxyModel&&) = delete;
BranchWatchTableModel* sourceModel() const
{
@@ -201,7 +207,6 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br
{
setWindowTitle(tr("Branch Watch Tool"));
setWindowFlags((windowFlags() | Qt::WindowMinMaxButtonsHint) & ~Qt::WindowContextHelpButtonHint);
- SetQWidgetWindowDecorations(this);
setLayout([this, &ppc_symbol_db]() {
auto* main_layout = new QVBoxLayout;
@@ -216,6 +221,7 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br
m_table_proxy->setSourceModel(
m_table_model = new BranchWatchTableModel(m_system, m_branch_watch, ppc_symbol_db));
m_table_proxy->setSortRole(UserRole::SortRole);
+ m_table_proxy->setSortCaseSensitivity(Qt::CaseInsensitive);
m_table_model->setFont(ui_settings.GetDebugFont());
connect(&ui_settings, &Settings::DebugFontChanged, m_table_model,
@@ -234,6 +240,11 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br
table_view->setEditTriggers(QAbstractItemView::NoEditTriggers);
table_view->setCornerButtonEnabled(false);
table_view->verticalHeader()->hide();
+ table_view->setColumnWidth(Column::Instruction, 50);
+ table_view->setColumnWidth(Column::Condition, 50);
+ table_view->setColumnWidth(Column::OriginSymbol, 250);
+ table_view->setColumnWidth(Column::DestinSymbol, 250);
+ // The default column width (100 units) is fine for the rest.
QHeaderView* const horizontal_header = table_view->horizontalHeader();
horizontal_header->restoreState( // Restore column visibility state.
@@ -495,16 +506,6 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br
return main_layout;
}());
- // FIXME: On Linux, Qt6 has recently been resetting column widths to their defaults in many
- // unexpected ways. This affects all kinds of QTables in Dolphin's GUI, so to avoid it in
- // this QTableView, I have deferred this operation. Any earlier, and this would be undone.
- // SetQWidgetWindowDecorations was moved to before these operations for the same reason.
- m_table_view->setColumnWidth(Column::Instruction, 50);
- m_table_view->setColumnWidth(Column::Condition, 50);
- m_table_view->setColumnWidth(Column::OriginSymbol, 250);
- m_table_view->setColumnWidth(Column::DestinSymbol, 250);
- // The default column width (100 units) is fine for the rest.
-
const auto& settings = Settings::GetQSettings();
restoreGeometry(settings.value(QStringLiteral("branchwatchdialog/geometry")).toByteArray());
}
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
index dfeff8f4b3..b45f4c8563 100644
--- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
+++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
@@ -9,12 +9,11 @@
#include <QDialog>
#include <QModelIndexList>
-#include "Core/Core.h"
-
namespace Core
{
class BranchWatch;
class CPUThreadGuard;
+enum class State;
class System;
} // namespace Core
class PPCSymbolDB;
@@ -54,6 +53,11 @@ public:
QWidget* parent = nullptr);
~BranchWatchDialog() override;
+ BranchWatchDialog(const BranchWatchDialog&) = delete;
+ BranchWatchDialog(BranchWatchDialog&&) = delete;
+ BranchWatchDialog& operator=(const BranchWatchDialog&) = delete;
+ BranchWatchDialog& operator=(BranchWatchDialog&&) = delete;
+
protected:
void hideEvent(QHideEvent* event) override;
void showEvent(QShowEvent* event) override;
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchTableModel.h b/Source/Core/DolphinQt/Debugger/BranchWatchTableModel.h
index b91dba37d2..aad2fd783a 100644
--- a/Source/Core/DolphinQt/Debugger/BranchWatchTableModel.h
+++ b/Source/Core/DolphinQt/Debugger/BranchWatchTableModel.h
@@ -75,6 +75,13 @@ public:
m_ppc_symbol_db(ppc_symbol_db)
{
}
+ ~BranchWatchTableModel() override = default;
+
+ BranchWatchTableModel(const BranchWatchTableModel&) = delete;
+ BranchWatchTableModel(BranchWatchTableModel&&) = delete;
+ BranchWatchTableModel& operator=(const BranchWatchTableModel&) = delete;
+ BranchWatchTableModel& operator=(BranchWatchTableModel&&) = delete;
+
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index 15683c973d..e5dd96014b 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -206,6 +206,7 @@ void CodeWidget::OnBranchWatchDialog()
m_branch_watch_dialog = new BranchWatchDialog(m_system, m_system.GetPowerPC().GetBranchWatch(),
m_ppc_symbol_db, this, this);
}
+ SetQWidgetWindowDecorations(m_branch_watch_dialog);
m_branch_watch_dialog->show();
m_branch_watch_dialog->raise();
m_branch_watch_dialog->activateWindow();