yuzu/applets/software_keyboard: Override accept() and reject() instead of providing own differently named member functions
Uses Qt's built-in interface instead of rolling our own separate one on top of it. This also fixes a bug in reject() where we were calling accept() instead of reject().
This commit is contained in:
parent
3fa2b218ac
commit
4dcdd3a837
|
@ -82,8 +82,8 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
|
||||||
: QString::fromStdU16String(parameters.submit_text),
|
: QString::fromStdU16String(parameters.submit_text),
|
||||||
QDialogButtonBox::AcceptRole);
|
QDialogButtonBox::AcceptRole);
|
||||||
|
|
||||||
connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::Submit);
|
connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::accept);
|
||||||
connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::Reject);
|
connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::reject);
|
||||||
layout->addWidget(header_label);
|
layout->addWidget(header_label);
|
||||||
layout->addWidget(sub_label);
|
layout->addWidget(sub_label);
|
||||||
layout->addWidget(guide_label);
|
layout->addWidget(guide_label);
|
||||||
|
@ -96,16 +96,16 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
|
||||||
|
|
||||||
QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default;
|
QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default;
|
||||||
|
|
||||||
void QtSoftwareKeyboardDialog::Submit() {
|
void QtSoftwareKeyboardDialog::accept() {
|
||||||
ok = true;
|
ok = true;
|
||||||
text = line_edit->text().toStdU16String();
|
text = line_edit->text().toStdU16String();
|
||||||
accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtSoftwareKeyboardDialog::Reject() {
|
void QtSoftwareKeyboardDialog::reject() {
|
||||||
ok = false;
|
ok = false;
|
||||||
text.clear();
|
text.clear();
|
||||||
accept();
|
QDialog::reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::u16string QtSoftwareKeyboardDialog::GetText() const {
|
std::u16string QtSoftwareKeyboardDialog::GetText() const {
|
||||||
|
|
|
@ -33,8 +33,8 @@ public:
|
||||||
Core::Frontend::SoftwareKeyboardParameters parameters);
|
Core::Frontend::SoftwareKeyboardParameters parameters);
|
||||||
~QtSoftwareKeyboardDialog() override;
|
~QtSoftwareKeyboardDialog() override;
|
||||||
|
|
||||||
void Submit();
|
void accept() override;
|
||||||
void Reject();
|
void reject() override;
|
||||||
|
|
||||||
std::u16string GetText() const;
|
std::u16string GetText() const;
|
||||||
bool GetStatus() const;
|
bool GetStatus() const;
|
||||||
|
|
Loading…
Reference in a new issue