title: How to connect textEdit widget to a function through key press event PyQt5
body: <p>I want to save the text in a textEdit widget whenever the user presses Return or Enter inside the widget. But I'm not sure how to register that the user has pressed a specific key <em>inside</em> the bounds of the widget.</p>
  <p>.returnPressed only works for lineEdits. I have tried to utilize keyPressEvent() but, as far as I can tell, that is a standalone function and I wouldn't know how to connect it to the text widget.</p>
  <p>If I was using Tkinter, I'd write something like this:</p>
  <pre><code>entry.bind(&quot;&lt;Return&gt;&quot;, entry_get)
  </code></pre>
  <p>But I don't know how to do it in PyQt5.</p>