Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 555964e5 authored by Laurent Montel's avatar Laurent Montel 😁

Add parent to qdialogbuttonbox

parent 4549baf1
......@@ -48,13 +48,14 @@ public:
, mAddressBookBox(nullptr)
, mMode(mode)
{
QWidget *mainWidget = new QWidget(q);
q->setWindowTitle(mode == ContactEditorDialog::CreateMode ? i18n("New Contact") : i18n("Edit Contact"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout(q);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, q);
q->connect(buttonBox, &QDialogButtonBox::accepted, q, [this]() { slotOkClicked(); });
q->connect(buttonBox, &QDialogButtonBox::rejected, q, [this]() { slotCancelClicked(); });
QWidget *mainWidget = new QWidget(q);
mainLayout->addWidget(mainWidget);
mainLayout->addWidget(buttonBox);
......
......@@ -45,7 +45,7 @@ public:
}
mainLayout->addWidget(mView);
q->connect(mView, &EmailAddressSelectionWidget::doubleClicked, q, &QDialog::accept);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, q);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment