title: Stylesheet Performance Hits with Qt
body: <p>I would like to know if it's possible to load stylesheets a lot faster than using my method in a Qt app.</p>
  
  <p>Here my codes:</p>
  
  <pre><code>this-&gt;setStyleSheet("background-color : black;");
  </code></pre>
  
  <p>Took 270 ms to execute this simple css/qss styling.</p>
  
  <p>With a lot bigger qss styling using this import method</p>
  
  <pre><code>QFile file("style.qss");  
  if(!file.open(QFile::ReadOnly)){  
      qDebug() &lt;&lt; "Style QSS file not found";  
  }  
  css = QString::fromLatin1(file.readAll());  
  file.close(); 
  </code></pre>
  
  <p>this command</p>
  
  <pre><code>this-&gt;setStyleSheet(css);
  </code></pre>
  
  <p>took 330ms so it's not that bad considering the difference of css styling blocks executed.</p>
  
  <p>So it looks like the init of the setStyleShet command is very long.
  My question is: Is there a way of speeding up this command (by not using Qstring, other import methods,....) or by threading ?</p>
  
  <p>For me it's huge because I need to update often my stylesheets and it's taking as much time as all my logic executed.</p>
  
  <p>Thanks.
  Have a nice day :)</p>