#NEWLINE# def contentsSizeChanged( self , newSize ) : #NEWLINE# #INDENT# 'scroll notesView while editing (adding new lines)\n           Whithout this, every `updateView` will result in scroll to top.\n        ' #NEWLINE# if ( self . scrollPosition == QPoint ( 0 , 0 ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# viewFrame = self . page ( ) . mainFrame ( ) #NEWLINE# newY = ( ( self . scrollPosition . y ( ) + newSize . height ( ) ) - self . contentsSize . height ( ) ) #NEWLINE# self . scrollPosition . setY ( newY ) #NEWLINE# viewFrame . setScrollPosition ( self . scrollPosition )