title: Convert QByteArray to vector of quint32
body: <p>I am reading a <code>QByteArray</code> from binary file and need to convert it to a <code>QVector&lt;quint32&gt;</code>. I have tried the following code:</p>
  <pre><code>QVector&lt;quint32&gt; qByteArrayToQuint32Vector(const QByteArray bytes, QDataStream::ByteOrder byteOrder) {
     QByteArray temp;
     QVector&lt;quint32&gt; convertedData;
     QDataStream stream(&amp;temp, QIODevice::ReadWrite);
  
     for (int i = 0; i &lt; bytes.length(); i++) {
         stream &lt;&lt; bytes[i];
     }
  
     stream.setByteOrder(byteOrder);
     quint32 t = 0;
  
     for (int i = 0; i &lt; bytes.length(); i += 4) {
         stream &gt;&gt; t;
         convertedData.push_back(t);
     }
  
     return convertedData;
  }
  </code></pre>
  <p>It does not work, and the converted data is just zeroes.</p>