summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-25 06:44:06 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-25 06:44:06 (GMT)
commit1317b9f77f8a1680fb334914e3a79cadce65c6f3 (patch)
tree3f2d146e5dfc92e0f8263aa55a1f1193025ecc62
parente0b65c70fd461d2fd5b7c9f5f9547cead8c51d45 (diff)
Add parent to widget, remove duplicate line
-rw-r--r--src/ksieveui/templates/sievetemplateeditdialog.cpp8
-rw-r--r--src/ksieveui/vacation/multiimapvacationdialog.cpp8
-rw-r--r--src/ksieveui/vacation/vacationdialog.cpp6
3 files changed, 8 insertions, 14 deletions
diff --git a/src/ksieveui/templates/sievetemplateeditdialog.cpp b/src/ksieveui/templates/sievetemplateeditdialog.cpp
index eca5169..0b818b6 100644
--- a/src/ksieveui/templates/sievetemplateeditdialog.cpp
+++ b/src/ksieveui/templates/sievetemplateeditdialog.cpp
@@ -45,16 +45,14 @@ SieveTemplateEditDialog::SieveTemplateEditDialog(QWidget *parent, bool defaultTe
: QDialog(parent), mOkButton(Q_NULLPTR)
{
setWindowTitle(defaultTemplate ? i18n("Default template") : i18n("Template"));
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = Q_NULLPTR;
if (defaultTemplate) {
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveTemplateEditDialog::reject);
} else {
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
- mOkButton->setDefault(true);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SieveTemplateEditDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SieveTemplateEditDialog::reject);
diff --git a/src/ksieveui/vacation/multiimapvacationdialog.cpp b/src/ksieveui/vacation/multiimapvacationdialog.cpp
index 96f36f1..beca4aa 100644
--- a/src/ksieveui/vacation/multiimapvacationdialog.cpp
+++ b/src/ksieveui/vacation/multiimapvacationdialog.cpp
@@ -98,8 +98,7 @@ QList<VacationCreateScriptJob *> MultiImapVacationDialog::listCreateJob() const
void MultiImapVacationDialog::init()
{
d->mStackedWidget = new QStackedWidget;
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(d->mStackedWidget);
d->mTabWidget = new QTabWidget;
d->mStackedWidget->addWidget(d->mTabWidget);
@@ -128,17 +127,16 @@ void MultiImapVacationDialog::init()
foundOneImap = true;
}
if (foundOneImap) {
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &MultiImapVacationDialog::slotOkClicked);
connect(buttonBox, &QDialogButtonBox::rejected, this, &MultiImapVacationDialog::slotCanceled);
connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &MultiImapVacationDialog::slotDefaultClicked);
- okButton->setDefault(true);
} else {
d->mStackedWidget->setCurrentIndex(1);
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
connect(buttonBox, &QDialogButtonBox::accepted, this, &MultiImapVacationDialog::slotOkClicked);
connect(buttonBox, &QDialogButtonBox::rejected, this, &MultiImapVacationDialog::slotCanceled);
}
diff --git a/src/ksieveui/vacation/vacationdialog.cpp b/src/ksieveui/vacation/vacationdialog.cpp
index 8b166b8..f2c3ec7 100644
--- a/src/ksieveui/vacation/vacationdialog.cpp
+++ b/src/ksieveui/vacation/vacationdialog.cpp
@@ -35,13 +35,11 @@ VacationDialog::VacationDialog(const QString &caption, QWidget *parent)
: QDialog(parent)
{
setWindowTitle(caption);
- QVBoxLayout *mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
- okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &VacationDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &VacationDialog::slotRejected);
@@ -50,7 +48,7 @@ VacationDialog::VacationDialog(const QString &caption, QWidget *parent)
mVacationEditWidget = new VacationEditWidget(this);
mVacationEditWidget->setObjectName(QStringLiteral("vacationeditwidget"));
mainLayout->addWidget(mVacationEditWidget);
- KSeparator *separator = new KSeparator;
+ KSeparator *separator = new KSeparator(this);
separator->setObjectName(QStringLiteral("separator"));
mainLayout->addWidget(separator);
mainLayout->addWidget(buttonBox);