Commit 16f65e81 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add parent directly

parent fe68c68f
......@@ -47,8 +47,7 @@ FilterEditDialog::FilterEditDialog(QList<KCalCore::CalFilter *> *filters, QWidge
{
setWindowTitle(i18nc("@title::window", "Edit Calendar Filters"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mApplyButton = buttonBox->button(QDialogButtonBox::Apply);
mOkButton->setDefault(true);
......
......@@ -48,11 +48,10 @@ KOEventViewerDialog::KOEventViewerDialog(Akonadi::ETMCalendar *calendar, QWidget
{
setWindowTitle(i18n("Event Viewer"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mUser1Button = new QPushButton;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
QPushButton *user2Button = new QPushButton;
QPushButton *user2Button = new QPushButton(this);
buttonBox->addButton(user2Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &KOEventViewerDialog::reject);
setModal(false);
......
......@@ -52,8 +52,7 @@ NoteEditDialog::NoteEditDialog(QWidget *parent)
setWindowTitle(i18nc("@title:window", "Create Note"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::accepted, this, &NoteEditDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
......
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