title: GUI freeze when inserting javascript into a WebView in Qt
body: <p>I've got a small chat application that uses a <code>QTcpSocket</code> to communication with my server. </p>
  
  <p>My server sends JSON commands to my Qt chat client which i parse inside of the <code>readyRead()</code>. When a receive the command <code>newUser</code> the below method is executed. For some reason the below method causes my application to freeze on some machines. Meaning it yields the GUI to become unresponsive. The user then has to minimize and then maximize the application for it to become responsive.</p>
  
  <p>Any ideas what could be causing this?</p>
  
  <pre><code>void MainWindow::addUser(QString channelID, QString visitorName) {
  
      int exists = 0;
      if (onlineUsers.contains(channelID)) {
          exists = 1;
      }    
  
      // Add the user to our QWebView
      ui-&gt;allVisitorsWeb-&gt;page()-&gt;mainFrame()-&gt;evaluateJavaScript("$('#allUsers tr:last').after('&lt;tr id=" + channelID + "&gt;&lt;td&gt;" + visitorName + "&lt;/td&gt;&lt;/tr&gt;'); undefined");
  
      // Add to active chats QStringList
      onlineUsers &lt;&lt; channelID;
  
      // Display notification
      QSettings settings("MyApp", "App");
      settings.beginGroup("aSettings");
      if (settings.value("visitorNotification").toString() == "true") {
          //displayNotification(visitorName, "Has entered", channelID);
      }
      settings.endGroup();       
  
      // Added to fix freeze
      QCoreApplication::processEvents();
  }
  </code></pre>