title: Why query->next() from QSqlQuery don't work as expected?
body: <p>I work on a Qt application linked with a SQLite database. All work fine everywhere in my code except in one place where the command query->next() don't work.</p>
  
  <p>SQL request</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT category.idCategory, category.text FROM Category, Category_User, User WHERE Category_User.category = category.idCategory AND Category_User.user = User.idUser AND User.idUser = 1;
  </code></pre>
  
  <p>The result of the request</p>
  
  <pre><code>idCategory | text  |
  -----------|-------|
           1 |first  |
           2 |second |
           3 |third  |
           4 |fourth |
  </code></pre>
  
  <p>My code</p>
  
  <pre class="lang-cpp prettyprint-override"><code>query-&gt;exec(&lt;&lt;request above&gt;&gt;)
  int value = 0;
  while (query-&gt;next()) {
      this-&gt;category[value] = new Category(query-&gt;value("idCategory").toInt(), query-&gt;value("text").toString());
      value++;
      }
  </code></pre>
  
  <p>The point is, it enters one only time in the while loop instead of four as expected. Only this->category[0] is filled.</p>