#NEWLINE# def sizeHint( self ) : #NEWLINE# #INDENT# ' Get the size hint for the scroll area.\n\n        This reimplemented method fixes a Qt bug where the size hint\n        is not updated after the scroll widget is first shown. The\n        bug is documented on the Qt bug tracker:\n        https://bugreports.qt-project.org/browse/QTBUG-10545\n\n        ' #NEWLINE# hint = self . _size_hint #NEWLINE# if hint . isValid ( ) : #NEWLINE# #INDENT# return QSize ( hint ) #NEWLINE# #UNINDENT# fw = ( 2 * self . frameWidth ( ) ) #NEWLINE# hint = QSize ( fw , fw ) #NEWLINE# font_height = self . fontMetrics ( ) . height ( ) #NEWLINE# widget = self . widget ( ) #NEWLINE# if ( widget is not None ) : #NEWLINE# #INDENT# if self . widgetResizable ( ) : #NEWLINE# #INDENT# hint += widget . sizeHint ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hint += widget . size ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# hint += QSize ( ( 12 * font_height ) , ( 8 * font_height ) ) #NEWLINE# #UNINDENT# if ( self . verticalScrollBarPolicy ( ) == Qt . ScrollBarAlwaysOn ) : #NEWLINE# #INDENT# vbar = self . verticalScrollBar ( ) #NEWLINE# hint . setWidth ( ( hint . width ( ) + vbar . sizeHint ( ) . width ( ) ) ) #NEWLINE# #UNINDENT# if ( self . horizontalScrollBarPolicy ( ) == Qt . ScrollBarAlwaysOn ) : #NEWLINE# #INDENT# hbar = self . horizontalScrollBar ( ) #NEWLINE# hint . setHeight ( ( hint . height ( ) + hbar . sizeHint ( ) . height ( ) ) ) #NEWLINE# #UNINDENT# hint = hint . boundedTo ( QSize ( ( 36 * font_height ) , ( 24 * font_height ) ) ) #NEWLINE# self . _size_hint = hint #NEWLINE# return QSize ( hint )