Merge pull request #10423 from Pokechu22/improperly-exclusive-radio-buttons

Fix improperly exclusive radio buttons
This commit is contained in:
JosJuice 2022-02-18 21:20:14 +01:00 committed by GitHub
commit 9ebfdff6b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 7 deletions

View File

@ -55,7 +55,7 @@ void CheatSearchFactoryWidget::CreateWidgets()
auto* custom_address_space_layout = new QVBoxLayout(); auto* custom_address_space_layout = new QVBoxLayout();
custom_address_space_layout->setMargin(6); custom_address_space_layout->setMargin(6);
auto* custom_address_space_button_group = new QButtonGroup(); auto* custom_address_space_button_group = new QButtonGroup(this);
m_custom_virtual_address_space = new QRadioButton(tr("Use virtual addresses when possible")); m_custom_virtual_address_space = new QRadioButton(tr("Use virtual addresses when possible"));
m_custom_virtual_address_space->setChecked(true); m_custom_virtual_address_space->setChecked(true);
m_custom_physical_address_space = new QRadioButton(tr("Use physical addresses")); m_custom_physical_address_space = new QRadioButton(tr("Use physical addresses"));

View File

@ -5,7 +5,6 @@
#include <utility> #include <utility>
#include <QButtonGroup>
#include <QCursor> #include <QCursor>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QListWidget> #include <QListWidget>

View File

@ -5,7 +5,6 @@
#include <fmt/format.h> #include <fmt/format.h>
#include <QButtonGroup>
#include <QDialog> #include <QDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QGridLayout> #include <QGridLayout>

View File

@ -6,6 +6,7 @@
#include <optional> #include <optional>
#include <string> #include <string>
#include <QButtonGroup>
#include <QCheckBox> #include <QCheckBox>
#include <QGroupBox> #include <QGroupBox>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -103,6 +104,12 @@ void MemoryWidget::CreateWidgets()
m_address_splitter->setCollapsible(0, false); m_address_splitter->setCollapsible(0, false);
m_address_splitter->setStretchFactor(1, 2); m_address_splitter->setStretchFactor(1, 2);
auto* search_type_group = new QButtonGroup(this);
m_find_ascii = new QRadioButton(tr("ASCII"));
m_find_hex = new QRadioButton(tr("Hex string"));
search_type_group->addButton(m_find_ascii);
search_type_group->addButton(m_find_hex);
// Dump // Dump
m_dump_mram = new QPushButton(tr("Dump &MRAM")); m_dump_mram = new QPushButton(tr("Dump &MRAM"));
m_dump_exram = new QPushButton(tr("Dump &ExRAM")); m_dump_exram = new QPushButton(tr("Dump &ExRAM"));
@ -116,8 +123,6 @@ void MemoryWidget::CreateWidgets()
m_find_next = new QPushButton(tr("Find &Next")); m_find_next = new QPushButton(tr("Find &Next"));
m_find_previous = new QPushButton(tr("Find &Previous")); m_find_previous = new QPushButton(tr("Find &Previous"));
m_find_ascii = new QRadioButton(tr("ASCII"));
m_find_hex = new QRadioButton(tr("Hex string"));
m_result_label = new QLabel; m_result_label = new QLabel;
search_layout->addWidget(m_find_next); search_layout->addWidget(m_find_next);

View File

@ -3,6 +3,7 @@
#include "DolphinQt/Debugger/NewBreakpointDialog.h" #include "DolphinQt/Debugger/NewBreakpointDialog.h"
#include <QButtonGroup>
#include <QCheckBox> #include <QCheckBox>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QGridLayout> #include <QGridLayout>
@ -31,10 +32,12 @@ NewBreakpointDialog::NewBreakpointDialog(BreakpointWidget* parent)
void NewBreakpointDialog::CreateWidgets() void NewBreakpointDialog::CreateWidgets()
{ {
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto* type_group = new QButtonGroup(this);
// Instruction BP // Instruction BP
m_instruction_bp = new QRadioButton(tr("Instruction Breakpoint")); m_instruction_bp = new QRadioButton(tr("Instruction Breakpoint"));
m_instruction_bp->setChecked(true); m_instruction_bp->setChecked(true);
type_group->addButton(m_instruction_bp);
m_instruction_box = new QGroupBox; m_instruction_box = new QGroupBox;
m_instruction_address = new QLineEdit; m_instruction_address = new QLineEdit;
@ -45,11 +48,15 @@ void NewBreakpointDialog::CreateWidgets()
// Memory BP // Memory BP
m_memory_bp = new QRadioButton(tr("Memory Breakpoint")); m_memory_bp = new QRadioButton(tr("Memory Breakpoint"));
type_group->addButton(m_memory_bp);
m_memory_box = new QGroupBox; m_memory_box = new QGroupBox;
auto* memory_type_group = new QButtonGroup(this);
m_memory_use_address = new QRadioButton(tr("Address")); m_memory_use_address = new QRadioButton(tr("Address"));
m_memory_use_address->setChecked(true); m_memory_use_address->setChecked(true);
memory_type_group->addButton(m_memory_use_address);
// i18n: A range of memory addresses // i18n: A range of memory addresses
m_memory_use_range = new QRadioButton(tr("Range")); m_memory_use_range = new QRadioButton(tr("Range"));
memory_type_group->addButton(m_memory_use_range);
m_memory_address_from = new QLineEdit; m_memory_address_from = new QLineEdit;
m_memory_address_to = new QLineEdit; m_memory_address_to = new QLineEdit;
m_memory_address_from_label = new QLabel; // Set by OnAddressTypeChanged m_memory_address_from_label = new QLabel; // Set by OnAddressTypeChanged

View File

@ -3,7 +3,6 @@
#include "DolphinQt/Settings/USBDeviceAddToWhitelistDialog.h" #include "DolphinQt/Settings/USBDeviceAddToWhitelistDialog.h"
#include <QButtonGroup>
#include <QDialog> #include <QDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QErrorMessage> #include <QErrorMessage>

View File

@ -7,7 +7,6 @@
class QTimer; class QTimer;
class QDialog; class QDialog;
class QButtonGroup;
class QHeaderView; class QHeaderView;
class QLabel; class QLabel;
class QLineEdit; class QLineEdit;