Commit f67ddbad authored by Laurent Montel's avatar Laurent Montel 😁

Add parent directly

parent 1481031e
......@@ -35,8 +35,7 @@ AlarmDialog::AlarmDialog(KCalCore::Incidence::IncidenceType incidenceType, QWidg
mAllowBeginReminders(true), mAllowEndReminders(true)
{
setWindowTitle(i18n("Create a new reminder"));
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -53,8 +53,7 @@ AttachmentEditDialog::AttachmentEditDialog(AttachmentIconItem *item,
QMimeDatabase db;
mMimeType = db.mimeTypeForName(item->mimeType());
QWidget *page = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
......
......@@ -45,9 +45,8 @@ CategoryEditDialog::CategoryEditDialog(CategoryConfig *categoryConfig,
: QDialog(parent), mCategoryConfig(categoryConfig)
{
setWindowTitle(i18n("Edit Categories"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -122,8 +122,7 @@ ResourceManagement::ResourceManagement(QWidget *parent)
QWidget *w = new QWidget(this);
mUi->setupUi(w);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(w);
mainLayout->addWidget(buttonBox);
......
......@@ -59,8 +59,7 @@ TemplateManagementDialog::TemplateManagementDialog(
QString m_type_translated = i18n(qPrintable(m_type));
setWindowTitle(i18n("Manage %1 Templates", m_type_translated));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
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