MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ModuleView

Method ModuleView

pcsx2-qt/Debugger/ModuleView.cpp:11–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <QtWidgets/QMenu>
10
11ModuleView::ModuleView(const DebuggerViewParameters& parameters)
12 : DebuggerView(parameters, MONOSPACE_FONT)
13 , m_model(new ModuleModel(cpu()))
14{
15 m_ui.setupUi(this);
16 m_ui.moduleList->setModel(m_model);
17 m_ui.moduleList->horizontalHeader()->setSectionsMovable(true);
18
19 m_ui.moduleList->setContextMenuPolicy(Qt::CustomContextMenu);
20 connect(m_ui.moduleList, &QTableView::customContextMenuRequested, this, &ModuleView::openContextMenu);
21 connect(m_ui.moduleList, &QTableView::doubleClicked, this, &ModuleView::onDoubleClick);
22
23 m_ui.moduleList->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeMode::ResizeToContents);
24 for (std::size_t i = 0; auto mode : ModuleModel::HeaderResizeModes)
25 {
26 m_ui.moduleList->horizontalHeader()->setSectionResizeMode(i, mode);
27 i++;
28 }
29
30 receiveEvent<DebuggerEvents::Refresh>([this](const DebuggerEvents::Refresh& event) -> bool {
31 if (!QtHost::IsVMPaused())
32 m_model->refreshData();
33 return true;
34 });
35
36 receiveEvent<DebuggerEvents::VMUpdate>([this](const DebuggerEvents::VMUpdate& event) -> bool {
37 m_model->refreshData();
38 return true;
39 });
40}
41
42void ModuleView::openContextMenu(QPoint pos)
43{

Callers

nothing calls this directly

Calls 2

setupUiMethod · 0.45
refreshDataMethod · 0.45

Tested by

no test coverage detected