qt: Leverage the default "Create new receiving address" button

When Enter or Return is pressed the default button will be always
clicked. All buttons can always be clicked from the keyboard by pressing
spacebar when the button has focus.
This commit is contained in:
Hennadii Stepanov 2020-07-21 21:29:09 +03:00
parent 4227a8e1f3
commit 4ec49f8d1e
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
2 changed files with 0 additions and 19 deletions

View File

@ -242,22 +242,6 @@ void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)
columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);
}
void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Return)
{
// press return -> submit form
if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus())
{
event->ignore();
on_receiveButton_clicked();
return;
}
}
this->QDialog::keyPressEvent(event);
}
QModelIndex ReceiveCoinsDialog::selectedRow()
{
if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())

View File

@ -49,9 +49,6 @@ public Q_SLOTS:
void reject() override;
void accept() override;
protected:
virtual void keyPressEvent(QKeyEvent *event) override;
private:
Ui::ReceiveCoinsDialog *ui;
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;