Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp
QSize AZAutoSizingScrollArea::sizeHint() const
    {
        int initialSize = 2 * frameWidth();
        QSize sizeHint(initialSize, initialSize);
        
        if (widget())
        {
            sizeHint += this->widgetResizable() ? widget()->sizeHint() : widget()->size();
        }
        else
        {
            // If we don't have a widget, we want to reserve some space visually for ourselves.            
            int fontHeight = fontMetrics().height();
            sizeHint += QSize(2 * fontHeight, 2 * fontHeight);
        }

        if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
        {
            sizeHint.setWidth(sizeHint.width() + verticalScrollBar()->sizeHint().width());
        }

        if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
        {
            sizeHint.setHeight(sizeHint.height() + horizontalScrollBar()->sizeHint().height());
        }

        return sizeHint;
    }
// this code was copied from the regular implementation of the same function in QScrollArea, but converted
// the private calls to public calls and removed the cache.
this code was copied from the regular implementation of the same function in QScrollArea, but converted
the private calls to public calls and removed the cache.
this code was copied from the regular implementation of the same function in QScrollArea but converted the private calls to public calls and removed the cache .
QSize AZAutoSizingScrollArea::sizeHint() const
    {
        int initialSize = 2 * frameWidth();
        QSize sizeHint(initialSize, initialSize);
        if (widget())
        {
            sizeHint += this->widgetResizable() ? widget()->sizeHint() : widget()->size();
        }
        else
        {
            int fontHeight = fontMetrics().height();
            sizeHint += QSize(2 * fontHeight, 2 * fontHeight);
        }
        if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
        {
            sizeHint.setWidth(sizeHint.width() + verticalScrollBar()->sizeHint().width());
        }
        if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
        {
            sizeHint.setHeight(sizeHint.height() + horizontalScrollBar()->sizeHint().height());
        }
        return sizeHint;
    }
QSize AZAutoSizingScrollArea :: sizeHint ( ) const { int initialSize = 2 * frameWidth ( ) ; QSize sizeHint ( initialSize , initialSize ) ; if ( widget ( ) ) { sizeHint += this -> widgetResizable ( ) ? widget ( ) -> sizeHint ( ) : widget ( ) -> size ( ) ; } else { int fontHeight = fontMetrics ( ) . height ( ) ; sizeHint += QSize ( 2 * fontHeight , 2 * fontHeight ) ; } if ( verticalScrollBarPolicy ( ) == Qt :: ScrollBarAlwaysOn ) { sizeHint . setWidth ( sizeHint . width ( ) + verticalScrollBar ( ) -> sizeHint ( ) . width ( ) ) ; } if ( horizontalScrollBarPolicy ( ) == Qt :: ScrollBarAlwaysOn ) { sizeHint . setHeight ( sizeHint . height ( ) + horizontalScrollBar ( ) -> sizeHint ( ) . height ( ) ) ; } return sizeHint ; }
this code was copied from the regular implementation of the same function in QScrollArea, but converted
the private calls to public calls and removed the cache.
this code was copied from the regular implementation of the same function in QScrollArea but converted the private calls to public calls and removed the cache .
// If we don't have a widget, we want to reserve some space visually for ourselves.            