From 826c171d53115e6850c06ba47d67b92d47a87f4b Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 31 Dec 2017 12:27:54 +0000 Subject: [PATCH] Do not add layouts twice This fixes the warning "Attempting to add QLayout "" to LayoutEdit "", which already has a layout" when the main window is created. --- src/layout_edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layout_edit.cpp b/src/layout_edit.cpp index aae34fe..7fe10dd 100644 --- a/src/layout_edit.cpp +++ b/src/layout_edit.cpp @@ -32,7 +32,7 @@ LayoutEdit::LayoutEdit( LayoutManager* l ) cmbLayouts = new QComboBox(frame); connect(cmbLayouts, SIGNAL(activated(int)), this, SLOT(load(int))); - QHBoxLayout *layoutLayout = new QHBoxLayout(this); + QHBoxLayout *layoutLayout = new QHBoxLayout(); //most of these buttons can link directly into slots in the LayoutManager btnAdd = new QPushButton(frame); @@ -118,7 +118,7 @@ LayoutEdit::LayoutEdit( LayoutManager* l ) updateLayoutList(); //add the buttons at the bottom. - QHBoxLayout* h = new QHBoxLayout(this); + QHBoxLayout* h = new QHBoxLayout(); h->setMargin(0); h->setSpacing(5); QPushButton* close = new QPushButton(QIcon::fromTheme("window-close"), tr("&Close Dialog"), this );