title: append data into QByteArray
body: <p>I want to write a QString '<strong><em>str</em></strong>' into QByteArray '<strong><em>baData</em></strong>'.</p>
  
  <p>The 'baData' is having <strong>fixed size 80 Bytes</strong> (it's requirment).</p>
  
  <p>If the '<strong><em>str</em></strong>' size is <strong>less than 80</strong>, append the remaining data of '<strong><em>baData</em></strong>' with <strong>0 (zero)</strong> value. </p>
  
  <p>I wrote following code, but not working porperly.</p>
  
  <pre><code>void MyClass::CopyData(QByteArray &amp;packet)
  
  {
  
           packet.truncate(0);
           packet[0] = 0x12;
           packet[1] = 0x34;
           ....
  
           QByteArray baData;
           baData.resize(80);
           baData = 0;
  
          QString str = "Hello Wrold";
  
          baData = str.toLocal8Bit();
  
          packet.append(baData, 80);
  
  }
  </code></pre>
  
  <p>packet size is not fixed, but baData size if fixed i.e. 80.</p>