From 8c7ed93278f92650fb925ebda897dd2fee803985 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 3 Nov 2008 04:15:34 +0000 Subject: [PATCH] if we're given a layout, don't create another layout for it to live in svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=879360 --- widgets/tabbar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/widgets/tabbar.cpp b/widgets/tabbar.cpp index d97c022fd..d199c1040 100644 --- a/widgets/tabbar.cpp +++ b/widgets/tabbar.cpp @@ -215,10 +215,14 @@ int TabBar::insertTab(int index, const QIcon &icon, const QString &label, QGraphicsWidget *page = new QGraphicsWidget(this); page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); if (content) { - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, page); - layout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - page->setLayout(layout); - layout->addItem(content); + if (content->isLayout()) { + page->setLayout(static_cast(content)); + } else { + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, page); + layout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + layout->addItem(content); + page->setLayout(layout); + } } else { page->setPreferredSize(0, 0); }