Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9591

Incorrect QScrollArea behavour then calculating sizeHint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.6.2
    • None

      By now scroll area know nothing about content's sizeHint.

      According to sources:

      qscrollarea.cpp
      /*!
          \reimp
       */
      QSize QScrollArea::sizeHint() const
      {
          Q_D(const QScrollArea);
          // .......
          if (d->widget) {
              if (!d->widgetSize.isValid())
                  d->widgetSize = d->resizable ? d->widget->sizeHint() : d->widget->size();
              sz += d->widgetSize;
          } else {
              sz += QSize(12 * h, 8 * h);
          }
          // .......
      }
      

      taking d->widgetSize.isValid() is not well correct... the only use of widgetSize previously set it to (0, 0) so IsValid always returns true and no content sizeHint.

      Moreover, content widget 's sizeHint is not constant in some cases and it souldn't be stored.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            monsen Marius Bugge Monsen
            brun Ivan Kukhta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes