Utils: Add shortcut for buttons in environment dialog

Task-number: QTCREATORBUG-27887
Change-Id: Ifb52d24354b1042cdb1ccb4ca898a251cbac1039
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2022-08-01 15:08:25 +02:00
parent 0a7f76ca8d
commit a82406eb27

View File

@@ -31,6 +31,7 @@
#include <QDialogButtonBox>
#include <QLabel>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QSet>
#include <QVBoxLayout>
@@ -95,6 +96,8 @@ NameValuesDialog::NameValuesDialog(const QString &windowTitle, const QString &he
auto box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal,
this);
box->button(QDialogButtonBox::Ok)->setText(tr("&Ok"));
box->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel"));
connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);