Fixing a segfault by -1 in plasma-netbook (special thanks to notmart).

svn path=/trunk/KDE/kdelibs/; revision=1075973
This commit is contained in:
Adenilson Cavalcanti Da Silva 2010-01-17 06:05:54 +00:00
parent 7c1ce3f4ec
commit 71dc3dea64

View File

@ -46,7 +46,11 @@ QSizeF StackedLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) con
qreal left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
QSizeF currentWidgetSize = itemAt(m_currentWidgetIndex)->effectiveSizeHint(which, constraint);
if (m_currentWidgetIndex <= 0 || !itemAt(m_currentWidgetIndex)) {
return QSizeF();
}
QSizeF currentWidgetSize = itemAt(m_currentWidgetIndex)->effectiveSizeHint(which, constraint);
return QSizeF( left + right + currentWidgetSize.width(), right + bottom + currentWidgetSize.height());
}