title: Convert QByteArray to unsigned short: not as expected
body: <p>I have a <code>QByteArray</code> like this:</p>
  
  <pre><code>QByteArray idx0;
  
  // idx0 is then assigned 4 bytes,
  // idx0 content is shown on debugger as:
  
  // idx0 "\000\000\001\000"  QByteArray
  //          '\0'    0       0x00    char
  //          '\0'    0       0x00    char
  //                  1       0x01    char
  //          '\0'    0       0x00    char
  </code></pre>
  
  <p>I convert the <code>QbyteArray</code> to <code>unsigned short</code> like this:</p>
  
  <pre><code>unsigned short ushortIdx0;
  if ( idx0.size() &gt;= sizeof(ushortIdx0) ) {
      ushortIdx0 = *reinterpret_cast&lt;const unsigned short *&gt;( idx0.data() );
  }
  </code></pre>
  
  <p>The Debugger shows <code>ushortIdx0</code> value as<code>0</code>:</p>
  
  <pre><code>// Debugger shows:
  //
  // ushortIdx0   0   unsigned short
  </code></pre>
  
  <hr>
  
  <p><strong>However</strong>, when I convert the Little Endian value of <code>0x 00 00 01 00</code> to <code>UINT32 - Little Endian</code> by <a href="https://www.scadacore.com/tools/programming-calculators/online-hex-converter/" rel="nofollow noreferrer">this website</a>, I get:</p>
  
  <pre>
  UINT32 - Little Endian (DCBA):
  
  Raw             UINT32
  00 01 00 00     65536
  </pre>
  
  <hr>
  
  <p><strong>Why</strong> the result of <a href="https://www.scadacore.com/tools/programming-calculators/online-hex-converter/" rel="nofollow noreferrer">that website</a> is different from what I get by my code? I don't get it. I appreciate any help.</p>