title: Qt Quick Game Loop
body: <p>This is one of the things that still confuses me about QML / QtQuick: How shall I implement a simple game like pong that uses a loop?</p>
  
  <p>I googled a bit and looked through similar questions here but none of them addressed the following:</p>
  
  <ul>
  <li><p>I want to create a simple game like pong that uses a loop. In this loop first all the objects are updated (in case of pong the ball and the bars) and then everything is rendered. For the rendering part I think QML will do the job once all the properties are set.</p></li>
  <li><p>I want to use QML and QtQick and not QGraphicsScene.</p></li>
  <li><p>I have seen some examples that just use a timer and then adjust the properties, for example this one: <a href="https://github.com/NicholasVanSickle/QtQuickTests/blob/master/Pong.qml" rel="nofollow noreferrer">https://github.com/NicholasVanSickle/QtQuickTests/blob/master/Pong.qml</a> But is this really the way to do it. In this case you would have the loop that updates the QML properties and the timer as well and I don't understand how the work together.</p></li>
  <li><p>Also there are some game engines that use QML. I would like to know how to use QML within a game loop. For example could you write the game loop in C++ and then have QML on top of it? Or what is the recommended way of doing it. Sadly I could not find this in any of the Qt documentation.</p></li>
  </ul>