summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-01 12:02:41 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-01 12:02:41 (GMT)
commit23d750f8ca5eb9b99ea4cf82680ea724bb8184b7 (patch)
tree5e39e1a6c3eaae23573a901ea6f16cb63c07a7f0
parentf0e19f4b6b4752c27ac2c9b5fd850b5349b63755 (diff)
Add parent directly
-rw-r--r--src/filter/filterconverter/filterconverttosieveresultdialog.cpp7
-rw-r--r--src/filter/filterselectiondialog.cpp4
-rw-r--r--src/filter/invalidfilters/invalidfilterdialog.cpp6
-rw-r--r--src/snippets/snippetdialog.cpp3
4 files changed, 9 insertions, 11 deletions
diff --git a/src/filter/filterconverter/filterconverttosieveresultdialog.cpp b/src/filter/filterconverter/filterconverttosieveresultdialog.cpp
index c3f66fb..308cabc 100644
--- a/src/filter/filterconverter/filterconverttosieveresultdialog.cpp
+++ b/src/filter/filterconverter/filterconverttosieveresultdialog.cpp
@@ -38,11 +38,10 @@ FilterConvertToSieveResultDialog::FilterConvertToSieveResultDialog(QWidget *pare
: QDialog(parent)
{
setWindowTitle(i18n("Convert to sieve script"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ QVBoxLayout *topLayout = new QVBoxLayout(this);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
- QVBoxLayout *topLayout = new QVBoxLayout;
- setLayout(topLayout);
- QPushButton *saveButton = new QPushButton;
+ QPushButton *saveButton = new QPushButton(this);
buttonBox->addButton(saveButton, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FilterConvertToSieveResultDialog::reject);
saveButton->setText(i18n("Save..."));
diff --git a/src/filter/filterselectiondialog.cpp b/src/filter/filterselectiondialog.cpp
index 57dc482..0a1efa5 100644
--- a/src/filter/filterselectiondialog.cpp
+++ b/src/filter/filterselectiondialog.cpp
@@ -35,9 +35,9 @@ FilterSelectionDialog::FilterSelectionDialog(QWidget *parent)
setObjectName(QStringLiteral("filterselection"));
setModal(true);
setWindowTitle(i18n("Select Filters"));
+ QVBoxLayout *top = new QVBoxLayout(this);
+
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
- QVBoxLayout *top = new QVBoxLayout;
- setLayout(top);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
mOkButton->setDefault(true);
diff --git a/src/filter/invalidfilters/invalidfilterdialog.cpp b/src/filter/invalidfilters/invalidfilterdialog.cpp
index a999da3..4acfd3c 100644
--- a/src/filter/invalidfilters/invalidfilterdialog.cpp
+++ b/src/filter/invalidfilters/invalidfilterdialog.cpp
@@ -32,9 +32,9 @@ InvalidFilterDialog::InvalidFilterDialog(QWidget *parent)
{
setWindowTitle(i18n("Invalid Filters"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
diff --git a/src/snippets/snippetdialog.cpp b/src/snippets/snippetdialog.cpp
index 31dcd78..d7e100e 100644
--- a/src/snippets/snippetdialog.cpp
+++ b/src/snippets/snippetdialog.cpp
@@ -37,8 +37,7 @@ SnippetDialog::SnippetDialog(KActionCollection *actionCollection, bool inGroupMo
connect(buttonBox, &QDialogButtonBox::rejected, this, &SnippetDialog::reject);
QWidget *mainWidget = new QWidget(this);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
mainLayout->addWidget(buttonBox);
mUi->setupUi(mainWidget);