summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-09-07 07:02:59 +0200
committerMontel Laurent <[email protected]>2017-09-07 07:02:59 +0200
commit597d74a35cacee0c883b0ed75f5552e3c9873256 (patch)
tree7ae7352e2a674599e511ea7e777ca964423fe43f
parent6b4c17255be8cb05e09c0bb6cdced5b52a3caf2a (diff)
Assign parent directly
-rw-r--r--src/ksieveui/editor/sieveeditorwidget.cpp3
-rw-r--r--src/ksieveui/widgets/managesievewidget.cpp5
2 files changed, 3 insertions, 5 deletions
diff --git a/src/ksieveui/editor/sieveeditorwidget.cpp b/src/ksieveui/editor/sieveeditorwidget.cpp
index bb2ad66..e094c1d 100644
--- a/src/ksieveui/editor/sieveeditorwidget.cpp
+++ b/src/ksieveui/editor/sieveeditorwidget.cpp
@@ -53,7 +53,7 @@ using namespace KSieveUi;
SieveEditorWidget::SieveEditorWidget(bool useMenuBar, QWidget *parent)
: QWidget(parent)
{
- QVBoxLayout *lay = new QVBoxLayout;
+ QVBoxLayout *lay = new QVBoxLayout(this);
#if !defined(NDEBUG)
mGenerateXml = nullptr;
#endif
@@ -136,7 +136,6 @@ SieveEditorWidget::SieveEditorWidget(bool useMenuBar, QWidget *parent)
lay->addLayout(nameLayout);
lay->setMargin(0);
- setLayout(lay);
mStackedWidget = new QStackedWidget;
mTextModeWidget = new SieveEditorTextModeWidget;
diff --git a/src/ksieveui/widgets/managesievewidget.cpp b/src/ksieveui/widgets/managesievewidget.cpp
index 96aa8f4..29b8433 100644
--- a/src/ksieveui/widgets/managesievewidget.cpp
+++ b/src/ksieveui/widgets/managesievewidget.cpp
@@ -69,10 +69,10 @@ ManageSieveWidget::ManageSieveWidget(QWidget *parent)
: QWidget(parent)
, d(new KSieveUi::ManageSieveWidgetPrivate)
{
- QHBoxLayout *lay = new QHBoxLayout;
+ QHBoxLayout *lay = new QHBoxLayout(this);
lay->setMargin(0);
- d->mTreeView = new ManageSieveTreeView;
+ d->mTreeView = new ManageSieveTreeView(this);
#ifndef QT_NO_CONTEXTMENU
connect(d->mTreeView, &ManageSieveTreeView::customContextMenuRequested, this, &ManageSieveWidget::slotContextMenuRequested);
#endif
@@ -83,7 +83,6 @@ ManageSieveWidget::ManageSieveWidget(QWidget *parent)
connect(PimCommon::NetworkManager::self()->networkConfigureManager(), &QNetworkConfigurationManager::onlineStateChanged, this, &ManageSieveWidget::slotSystemNetworkOnlineStateChanged);
lay->addWidget(d->mTreeView);
- setLayout(lay);
QTimer::singleShot(0, this, &ManageSieveWidget::slotCheckNetworkStatus);
}