title: Convert hexadecimal string to QByteArray
body: <p>I need to convert a <code>QString</code> which is
   already in hexadecimal format to a <code>QByteArray</code>. For example:</p>
  
  <pre><code>QString a = "AF5603B4"
  </code></pre>
  
  <p>Should be stored in <code>QByteArray</code> as:</p>
  
  <pre><code>QByteArray ba[4] = { 0xAF, 0x56, 0x03, 0xB4 }
  </code></pre>
  
  <p>How do I do this in Qt 5.9? I have tried using many methods but all of these convert the string characters to their ASCII values and then give that hexadecimal value. </p>
  
  <p>I found <code>Convert.toByte</code> method to use in C# ; is there an equivalent in Qt I can use? </p>