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
This commit is contained in:
parent
fdbd52d617
commit
8c7ed93278
@ -215,10 +215,14 @@ int TabBar::insertTab(int index, const QIcon &icon, const QString &label,
|
|||||||
QGraphicsWidget *page = new QGraphicsWidget(this);
|
QGraphicsWidget *page = new QGraphicsWidget(this);
|
||||||
page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
if (content) {
|
if (content) {
|
||||||
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, page);
|
if (content->isLayout()) {
|
||||||
layout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
page->setLayout(static_cast<QGraphicsLayout *>(content));
|
||||||
page->setLayout(layout);
|
} else {
|
||||||
layout->addItem(content);
|
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, page);
|
||||||
|
layout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
layout->addItem(content);
|
||||||
|
page->setLayout(layout);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
page->setPreferredSize(0, 0);
|
page->setPreferredSize(0, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user