diff options
Diffstat (limited to 'src/widgets/widgets/qabstractscrollarea.cpp')
-rw-r--r-- | src/widgets/widgets/qabstractscrollarea.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 05d9c18f07..a146d4c4f9 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -1100,7 +1100,7 @@ void QAbstractScrollArea::resizeEvent(QResizeEvent *) This event handler can be reimplemented in a subclass to receive paint events (passed in \a event), for the viewport() widget. - \note If you open a painter, make sure to open it on the viewport(). + \note If you create a QPainter, it must operate on the viewport(). \sa QWidget::paintEvent() */ @@ -1431,9 +1431,9 @@ QSize QAbstractScrollArea::sizeHint() const if (!d->sizeHint.isValid() || d->sizeAdjustPolicy == QAbstractScrollArea::AdjustToContents) { const int f = 2 * d->frameWidth; - const QSize frame( f, f ); - const bool vbarHidden = d->vbar->isHidden() || d->vbarpolicy == Qt::ScrollBarAlwaysOff; - const bool hbarHidden = d->hbar->isHidden() || d->hbarpolicy == Qt::ScrollBarAlwaysOff; + const QSize frame(f, f); + const bool vbarHidden = !d->vbar->isVisibleTo(this) || d->vbarpolicy == Qt::ScrollBarAlwaysOff; + const bool hbarHidden = !d->hbar->isVisibleTo(this) || d->hbarpolicy == Qt::ScrollBarAlwaysOff; const QSize scrollbars(vbarHidden ? 0 : d->vbar->sizeHint().width(), hbarHidden ? 0 : d->hbar->sizeHint().height()); d->sizeHint = frame + scrollbars + viewportSizeHint(); |