#NEWLINE# def restoreState( settings , widget , key ) : #NEWLINE# #INDENT# settings . beginGroup ( key ) #NEWLINE# if settings . contains ( 'size' ) : #NEWLINE# #INDENT# widget . resize ( settings . value ( 'size' ) ) #NEWLINE# #UNINDENT# if settings . contains ( 'position' ) : #NEWLINE# #INDENT# widget . move ( settings . value ( 'position' ) ) #NEWLINE# #UNINDENT# if ( settings . contains ( 'state' ) and hasattr ( widget , 'restoreState' ) ) : #NEWLINE# #INDENT# widget . restoreState ( settings . value ( 'state' ) ) #NEWLINE# #UNINDENT# settings . endGroup ( )