diff options
| author | 2018-11-20 11:36:47 -0500 | |
|---|---|---|
| committer | 2018-11-20 11:36:50 -0500 | |
| commit | 4dcdd3a837808fbdc1da4d041295fe678fcfdf81 (patch) | |
| tree | 375e18e916893142b876e687619ec970174b4531 /src | |
| parent | yuzu/applets/software_keyboard: std::move std::function instances where appli... (diff) | |
| download | yuzu-4dcdd3a837808fbdc1da4d041295fe678fcfdf81.tar.gz yuzu-4dcdd3a837808fbdc1da4d041295fe678fcfdf81.tar.xz yuzu-4dcdd3a837808fbdc1da4d041295fe678fcfdf81.zip | |
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().
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/applets/software_keyboard.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/applets/software_keyboard.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index 338d91426..8a26fdff1 100644 --- a/src/yuzu/applets/software_keyboard.cpp +++ b/src/yuzu/applets/software_keyboard.cpp | |||
| @@ -82,8 +82,8 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog( | |||
| 82 | : QString::fromStdU16String(parameters.submit_text), | 82 | : QString::fromStdU16String(parameters.submit_text), |
| 83 | QDialogButtonBox::AcceptRole); | 83 | QDialogButtonBox::AcceptRole); |
| 84 | 84 | ||
| 85 | connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::Submit); | 85 | connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::accept); |
| 86 | connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::Reject); | 86 | connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::reject); |
| 87 | layout->addWidget(header_label); | 87 | layout->addWidget(header_label); |
| 88 | layout->addWidget(sub_label); | 88 | layout->addWidget(sub_label); |
| 89 | layout->addWidget(guide_label); | 89 | layout->addWidget(guide_label); |
| @@ -96,16 +96,16 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog( | |||
| 96 | 96 | ||
| 97 | QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default; | 97 | QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default; |
| 98 | 98 | ||
| 99 | void QtSoftwareKeyboardDialog::Submit() { | 99 | void QtSoftwareKeyboardDialog::accept() { |
| 100 | ok = true; | 100 | ok = true; |
| 101 | text = line_edit->text().toStdU16String(); | 101 | text = line_edit->text().toStdU16String(); |
| 102 | accept(); | 102 | QDialog::accept(); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | void QtSoftwareKeyboardDialog::Reject() { | 105 | void QtSoftwareKeyboardDialog::reject() { |
| 106 | ok = false; | 106 | ok = false; |
| 107 | text.clear(); | 107 | text.clear(); |
| 108 | accept(); | 108 | QDialog::reject(); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | std::u16string QtSoftwareKeyboardDialog::GetText() const { | 111 | std::u16string QtSoftwareKeyboardDialog::GetText() const { |
diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h index db3fbae1d..c63720ba4 100644 --- a/src/yuzu/applets/software_keyboard.h +++ b/src/yuzu/applets/software_keyboard.h | |||
| @@ -33,8 +33,8 @@ public: | |||
| 33 | Core::Frontend::SoftwareKeyboardParameters parameters); | 33 | Core::Frontend::SoftwareKeyboardParameters parameters); |
| 34 | ~QtSoftwareKeyboardDialog() override; | 34 | ~QtSoftwareKeyboardDialog() override; |
| 35 | 35 | ||
| 36 | void Submit(); | 36 | void accept() override; |
| 37 | void Reject(); | 37 | void reject() override; |
| 38 | 38 | ||
| 39 | std::u16string GetText() const; | 39 | std::u16string GetText() const; |
| 40 | bool GetStatus() const; | 40 | bool GetStatus() const; |