title: Qt : Display a picture during application loading
body: <p>I want add a splash screen to an application which is slow to load.
  I have create a simple app to test.</p>
  
  <p>main.cpp :</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      QPixmap pixmap("/home/helene/Images/my_image.png");
      if (pixmap.isNull())
      {
          pixmap = QPixmap(300, 300);
          pixmap.fill(Qt::magenta);
      }
  
      QSplashScreen *splash = new QSplashScreen(pixmap);
      splash-&gt;show();
      splash-&gt;showMessage("Loaded modules dsjhj");
  
      QQmlApplicationEngine engine;
      engine.load(QUrl("qrc:/main.qml"));
  
      QObject *topLevel = engine.rootObjects().value(0);
      QQuickWindow *window = qobject_cast&lt;QQuickWindow *&gt;(topLevel);
      if ( !window )
      {
          qWarning("Error: Your root item has to be a Window.");
          return -1;
      }
      else
      {
          window-&gt;showFullScreen();
      }
      return app.exec();
  }
  </code></pre>
  
  <p>main.qml</p>
  
  <pre><code>Window {
      visible: false
      width: 360
      height: 360
  
      property variant t: determineT()
      MouseArea {
          anchors.fill: parent
          onClicked: {
              Qt.quit();
          }
      }
  
      Text {
          text: qsTr("Hello World")
          anchors.centerIn: parent
      }
  
      function determineT() {
          for(var i=0; i&lt;1000000000; i++);
      }
  }
  </code></pre>
  
  <p>I have added a long function to rise the time of loading.
  When the app state, I can see "the shadow" of the picture. The picture seems completely loading just before the application.
  I have tried with image on resources and with absolute path but the problem is the same.
  <img src="https://i.stack.imgur.com/wFN40.png" alt="Picture of the &quot;shadow&quot;"></p>