check if the layout has also the tabwidget widget or not, crash--

svn path=/trunk/KDE/kdelibs/; revision=930400
This commit is contained in:
Marco Martin 2009-02-23 11:26:45 +00:00
parent 8fe01d477c
commit 9fd15b5e2f

View File

@ -160,7 +160,9 @@ void TabBarPrivate::shapeChanged(const QTabBar::Shape shape)
tabBarLayout->setOrientation(Qt::Vertical);
tabWidgetLayout->setOrientation(Qt::Horizontal);
tabWidgetLayout->itemAt(0)->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
tabWidgetLayout->itemAt(1)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
if (tabWidgetLayout->count() > 1) {
tabWidgetLayout->itemAt(1)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
tabProxy->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
break;
@ -173,7 +175,9 @@ void TabBarPrivate::shapeChanged(const QTabBar::Shape shape)
tabBarLayout->setOrientation(Qt::Horizontal);
tabWidgetLayout->setOrientation(Qt::Vertical);
tabWidgetLayout->itemAt(0)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
tabWidgetLayout->itemAt(1)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
if (tabWidgetLayout->count() > 1) {
tabWidgetLayout->itemAt(1)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
tabProxy->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
}
tabProxy->setPreferredSize(tabProxy->native->sizeHint());