title: QTextEdit refresh after setText()/insertPlainText()
body: <p>I have a QTextEdit widget in a private slot, which I update regularly with setText() and insertPlainText().</p>
  
  <p>I have found that setText()/insertPlainText() does not update the QTextEdit widget immediately.  Instead, the QTextWidget is updated when the slot function returns.  To test this, I have put a sleep() just after the setText()/insertPlainText().</p>
  
  <pre><code>class MyWindow : public Widget
  {
      MyWindow()
      {
          my_button = new QPushButton(this);
          my_edit   = new QTextEdit(this);
  
          connect(my_button, 
                  &amp;QPushButton::clicked, 
                  this, 
                  &amp;MyWindow::my_callback);
      }
  
      private slots:
  
          void my_callback()
          {
              my_edit-&gt;setText("sample text");
  
              // nothing happens; the QTextEdit 
              // widget does not show "sample text"
  
              sleep(10); 
  
              // the QTextEdit widget will show
              // "sample text" AFTER the sleep,
              // when my_callback returns.
           }
  
      private:
          QPushButton* my_button;
          QTextEdit*   my_edit;
  }
  </code></pre>
  
  <p>This is a problem for me because I need to print a message in my QTextEdit widget BEFORE launching a time-consuming process (using QProcess).  Currently, this message is not being printed until after QProcess process has returned.</p>
  
  <p>Does anyone know how I can get the QTextEdit widget to show its contents right after setText()/insertPlainText()?</p>
  
  <p>Using Qt5 on Fedora 29.  </p>