title: QML: running functions in parallel threads
body: <p>In my code I'm creating 16x16 buttons in cycle and this take few seconds.</p>
  
  <pre><code>onCreateField:
  {
      for(var i=0;i&lt;fieldWidth;i++)
      {
          for(var j=0;j&lt;fieldHeight;j++)
          {
              createButton(i, j);
          }
      }
  }
  
  function createButton(x, y)
  {
      __buttonX = x;
      __buttonY = y;
  
      __component = Qt.createComponent("GameButton.qml");
  
      if(__component != null)
          continueButtonCreation();
      else
          __component.ready.connect(continueButtonCreation);
  }
  
  function continueButtonCreation()
  {
      var button = __component.createObject(field, {"row": __buttonY, "column": __buttonX});
  
       if (button == null) {
           // Error Handling
           console.log("Error creating object");
  
           return;
       }
  
       updateValveState.connect(button.stateUpdated);
       button.buttonClicked.connect(buttonClicked);
  
       field.clearField.connect(button.release);
  }
  </code></pre>
  
  <p>While function that creating buttons runs, app freezes. I want to show loading animation while this function runs. So, how to run this function in parallel thread to avoid freezing?</p>