From 8e955297ef5a6add2d8e67385da016b9ea6ede0c Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 5 Sep 2017 22:40:35 +0200 Subject: [PATCH] [Qt] style adjustments 2 some more of the same --- rpcs3/rpcs3qt/msg_dialog_frame.cpp | 3 ++- rpcs3/rpcs3qt/rsx_debugger.cpp | 14 +++++++++++--- rpcs3/rpcs3qt/rsx_debugger.h | 5 +---- rpcs3/rpcs3qt/save_data_info_dialog.cpp | 7 ++++--- rpcs3/rpcs3qt/save_data_list_dialog.cpp | 9 ++++++--- rpcs3/rpcs3qt/save_manager_dialog.cpp | 4 ++-- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/rpcs3/rpcs3qt/msg_dialog_frame.cpp b/rpcs3/rpcs3qt/msg_dialog_frame.cpp index 4af4704ecd..a431eb1ef0 100644 --- a/rpcs3/rpcs3qt/msg_dialog_frame.cpp +++ b/rpcs3/rpcs3qt/msg_dialog_frame.cpp @@ -257,7 +257,8 @@ void msg_dialog_frame::CreateOsk(const std::string& msg, char16_t* osk_text, u32 msg_dialog_frame::msg_dialog_frame(QWindow* taskbarTarget) : m_taskbarTarget(taskbarTarget) {} -msg_dialog_frame::~msg_dialog_frame() { +msg_dialog_frame::~msg_dialog_frame() +{ #ifdef _WIN32 if (m_tb_progress) { diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index 8677593313..7f56641e22 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -294,7 +294,8 @@ rsx_debugger::rsx_debugger(QWidget* parent) connect(b_goto_put, &QAbstractButton::clicked, [=](){ if (const auto render = fxm::get()){ u32 realAddr; - if (RSXIOMem.getRealAddr(render->ctrl->put.load(), realAddr)){ + if (RSXIOMem.getRealAddr(render->ctrl->put.load(), realAddr)) + { m_addr = realAddr; UpdateInformation(); } @@ -306,7 +307,8 @@ rsx_debugger::rsx_debugger(QWidget* parent) UpdateInformation(); }); connect(m_list_flags, &QTableWidget::itemClicked, this, &rsx_debugger::SetFlags); - connect(m_list_texture, &QTableWidget::itemClicked, [=](){ + connect(m_list_texture, &QTableWidget::itemClicked, [=] + { int index = m_list_texture->currentRow(); if (index >= 0) m_cur_texture = index; UpdateInformation(); @@ -319,6 +321,11 @@ rsx_debugger::rsx_debugger(QWidget* parent) setFocusProxy(t_addr); }; +rsx_debugger::~rsx_debugger() +{ + exit = true; +} + void rsx_debugger::keyPressEvent(QKeyEvent* event) { if(isActiveWindow()) @@ -720,7 +727,8 @@ void rsx_debugger::GetBuffers() unsigned char* buffer = (unsigned char*)malloc(width * height * 4); // ABGR to ARGB and flip vertically - for (u32 y=0; yhorizontalHeader()->resizeSections(QHeaderView::ResizeToContents); m_list->verticalHeader()->resizeSections(QHeaderView::ResizeToContents); - QSize tableSize = QSize( + QSize tableSize = QSize + ( m_list->verticalHeader()->width() + m_list->horizontalHeader()->length() + m_list->frameWidth() * 2, - m_list->horizontalHeader()->height() + m_list->verticalHeader()->length() + m_list->frameWidth() * 2); + m_list->horizontalHeader()->height() + m_list->verticalHeader()->length() + m_list->frameWidth() * 2 + ); // no minimum size needed because we always have same table size and row count resize(sizeHint() - m_list->sizeHint() + tableSize); - } //This is intended to write the information of save data to QTableView. diff --git a/rpcs3/rpcs3qt/save_data_list_dialog.cpp b/rpcs3/rpcs3qt/save_data_list_dialog.cpp index bcac7e4d4e..76b6f775f1 100644 --- a/rpcs3/rpcs3qt/save_data_list_dialog.cpp +++ b/rpcs3/rpcs3qt/save_data_list_dialog.cpp @@ -86,7 +86,8 @@ save_data_list_dialog::save_data_list_dialog(const std::vector& e UpdateList(); - connect(m_list, &QTableWidget::cellChanged, [&](int row, int col) { + connect(m_list, &QTableWidget::cellChanged, [&](int row, int col) + { int originalIndex = m_list->item(row, 0)->data(Qt::UserRole).toInt(); SaveDataEntry originalEntry = m_save_entries[originalIndex]; QString originalDirName = qstr(originalEntry.dirName); @@ -206,9 +207,11 @@ void save_data_list_dialog::UpdateList() m_list->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); m_list->verticalHeader()->resizeSections(QHeaderView::ResizeToContents); - QSize tableSize = QSize( + QSize tableSize = QSize + ( m_list->verticalHeader()->width() + m_list->horizontalHeader()->length() + m_list->frameWidth() * 2, - m_list->horizontalHeader()->height() + m_list->verticalHeader()->length() + m_list->frameWidth() * 2); + m_list->horizontalHeader()->height() + m_list->verticalHeader()->length() + m_list->frameWidth() * 2 + ); resize(minimumSize().expandedTo(sizeHint() - m_list->sizeHint() + tableSize)); diff --git a/rpcs3/rpcs3qt/save_manager_dialog.cpp b/rpcs3/rpcs3qt/save_manager_dialog.cpp index a8f16a3218..626b95f991 100644 --- a/rpcs3/rpcs3qt/save_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/save_manager_dialog.cpp @@ -119,7 +119,6 @@ void save_manager_dialog::Init(std::string dir) UpdateList(); - // Connects and events connect(push_close, &QAbstractButton::clicked, this, &save_manager_dialog::close); connect(m_list, &QTableWidget::itemDoubleClicked, this, &save_manager_dialog::OnEntryInfo); @@ -129,7 +128,8 @@ void save_manager_dialog::Init(std::string dir) OnSort(col); }); - connect(m_list, &QTableWidget::cellChanged, [&](int row, int col) { + connect(m_list, &QTableWidget::cellChanged, [&](int row, int col) + { int originalIndex = m_list->item(row, 0)->data(Qt::UserRole).toInt(); SaveDataEntry originalEntry = m_save_entries[originalIndex]; QString originalDirName = qstr(originalEntry.dirName);