summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qscrollarea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qscrollarea.cpp')
-rw-r--r--src/widgets/widgets/qscrollarea.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widgets/widgets/qscrollarea.cpp b/src/widgets/widgets/qscrollarea.cpp
index 93c335c56b..71c0b987a4 100644
--- a/src/widgets/widgets/qscrollarea.cpp
+++ b/src/widgets/widgets/qscrollarea.cpp
@@ -407,6 +407,18 @@ QSize QScrollArea::sizeHint() const
return sz.boundedTo(QSize(36 * h, 24 * h));
}
+/*!
+ \reimp
+ */
+QSize QScrollArea::viewportSizeHint() const
+{
+ Q_D(const QScrollArea);
+ if (d->widget) {
+ return d->resizable ? d->widget->sizeHint() : d->widget->size();
+ }
+ const int h = fontMetrics().height();
+ return QSize(6 * h, 4 * h);
+}
/*!
@@ -499,6 +511,15 @@ void QScrollArea::ensureWidgetVisible(QWidget *childWidget, int xmargin, int yma
\brief the alignment of the scroll area's widget
\since 4.2
+ A valid alignment is a combination of the following flags:
+ \list
+ \li \c Qt::AlignLeft
+ \li \c Qt::AlignHCenter
+ \li \c Qt::AlignRight
+ \li \c Qt::AlignTop
+ \li \c Qt::AlignVCenter
+ \li \c Qt::AlignBottom
+ \endlist
By default, the widget stays rooted to the top-left corner of the
scroll area.
*/