title: Converting QByteArray to integer
body: <p>I have a <code>QByteArray</code> data which when I print it out with <code>qDebug</code> it yields something like:</p>
  
  <pre><code>qDebug() &lt;&lt; rawData; 
  //here is the reult:
  MXTP24\\x00\\x00\\xF3\\x8F
  </code></pre>
  
  <p>Now I need to convert that 4 hex string to a 32 bit integer, that is I need to parse <code>\x00 \x00 \xF3 \x8F</code> to an integer. I tried the following code but it fails:</p>
  
  <pre><code>QDataStream ds;
  ds &lt;&lt; rawData.mid(8,2);
  ds &lt;&lt; rawData.mid(13,2);
  ds &lt;&lt; rawData.mid(18,2);
  ds &lt;&lt; rawData.mid(23,2);
  
  quint32 sampleCounter = 0;
  ds &gt;&gt; sampleCounter;
  qDebug() &lt;&lt; "PARSER =&gt; onReceivePacket =&gt; sampleCounter =&gt; " &lt;&lt; sampleCounter;
  </code></pre>
  
  <p>But no matter how hard I try it fails and prints <code>0</code>. I do not know what exactly is going on in the <code>QByteArray</code>. I think this is a trivial task but I cant figure it out</p>