title: embedded qtconsole in pyqt5 aplication does not works as expected
body: <p>I have a rather large project with an embedded Jupyter QtConsole 4.4.2.</p>
  
  <p>For more details see:
  <a href="https://github.com/3fon3fonov/trifon" rel="nofollow noreferrer">https://github.com/3fon3fonov/trifon</a></p>
  
  <p>Now, while some of the processes are running/finished I am trying to send some text to the Qtconsole and use it as an output screen (and vice-versa I want to the Jupyter to be able to take control over the GUI if needed, but this is another problem I have to deal later on).</p>
  
  <p>The problem is that some intrinsic to the "ConsoleWidget" functions 
  do not seems to work, and I cannotfind the reason for that...</p>
  
  <p>For example in my main GUI code:</p>
  
  <pre><code>ConsoleWidget_embed().push_vars({'fit':fit}) &lt;-- WORKS!   
  
  ConsoleWidget_embed().clear() &lt;-- Does not work!
  ConsoleWidget_embed().print_text("Test string")  &lt;-- Does not work!
  </code></pre>
  
  <p>Here is the code I am embedding in a Qtab.</p>
  
  <pre><code>import numpy as np
  import sys #,os
  from PyQt5 import QtCore, QtGui, QtWidgets, uic
  
  from qtconsole.rich_jupyter_widget import RichJupyterWidget
  from qtconsole.inprocess import QtInProcessKernelManager
  from qtconsole.console_widget import ConsoleWidget
  
  
  class ConsoleWidget_embed(RichJupyterWidget,ConsoleWidget):
      global fit
  
      def __init__(self, customBanner=None, *args, **kwargs):
          super(ConsoleWidget_embed, self).__init__(*args, **kwargs)
  
          if customBanner is not None:
              self.banner = customBanner
  
          #self.font_size = 4
          self.kernel_manager =   QtInProcessKernelManager()
          self.kernel_manager.start_kernel(show_banner=True)
          self.kernel_manager.kernel.gui = 'qt'
          self.kernel = self.kernel_manager.kernel
          self.kernel_client = self._kernel_manager.client()
          self.kernel_client.start_channels()
  
          #self._execute("kernel = %s"%fit, False) 
  
          def stop():
              self.kernel_client.stop_channels()
              self.kernel_manager.shutdown_kernel()
              self.guisupport.get_app_qt().exit()
  
          self.exit_requested.connect(stop)
  
  
      def push_vars(self, variableDict):
          """
          Given a dictionary containing name / value pairs, push those variables
          to the Jupyter console widget
          """
          self.kernel_manager.kernel.shell.push(variableDict)
  
      def clear(self):
          """
          Clears the terminal
          """
          self._control.clear()
  
          # self.kernel_manager
  
      def print_text(self, text):
          """
          Prints some plain text to the console
          """
          self._append_plain_text(text, before_prompt=False)
  
      def execute_command(self, command):
          """
          Execute a command in the frame of the console widget
          """
          self._execute(command, False)
  
  
  
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      main = mainWindow()
      main.show()
      sys.exit(app.exec_())  
  </code></pre>
  
  <p>Any ideas will be highly appreciated !</p>
  
  <p>All the best,
  Trifon</p>