size hint is the inner widget size

svn path=/trunk/KDE/kdelibs/; revision=1036073
This commit is contained in:
Marco Martin 2009-10-16 14:10:55 +00:00
parent 1d611eac34
commit 31cb2730ea
2 changed files with 12 additions and 0 deletions

View File

@ -474,6 +474,17 @@ bool ScrollWidget::eventFilter(QObject *watched, QEvent *event)
return false;
}
QSizeF ScrollWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
{
QSizeF hint = QGraphicsWidget::sizeHint(which, constraint);
if (which == Qt::PreferredSize && d->widget) {
return d->widget->size();
}
return hint;
}
} // namespace Plasma
#include <scrollwidget.moc>

View File

@ -167,6 +167,7 @@ protected:
void wheelEvent(QGraphicsSceneWheelEvent *event);
bool eventFilter(QObject *watched, QEvent *event);
void focusInEvent(QFocusEvent *event);
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;
private:
ScrollWidgetPrivate * const d;