code: def resizeEvent(self, event):
          
          super(XTextEdit, self).resizeEvent(event)
          
          if self.autoResizeToContents():
              self.resizeToContents()
docs: Processes when this edit has been resized.
          
          :param      event | <QResizeEvent>