title: What is DataPtr in Qt used for?
body: <p><code>QVariant::DataPtr</code> is private, and yesterday I used <code>QBitArray</code> to do some work. There's a function <code>data_ptr()</code> returning <code>DataPtr&amp;</code>, but I don't know when and how to use this function. I write the returning data to a file and opened it in ST2, there shows an <code>SOH</code>:</p>
  
  <pre><code>int main()
  {
      QBitArray bit(8);
      bit[5] = true; //--&gt; I tried bit[7] = true; result is `SOH` still
      QFile file("out");
      file.open(QIODevice::WriteOnly);
      QDataStream outs(&amp;file);
      outs &lt;&lt; bit.data_ptr();
      file.close();
      return 0;
  }
  </code></pre>
  
  <p>I know <code>SOH</code> is the meaning of <code>Start Of Header</code>, and it is defined as <code>0x01</code>(1byte) for frame delimiting. First I wrote <code>bit[7]=true;</code> so I thought <code>bit.data_ptr()</code> may be the raw data(00000001 in binary) in <code>bit</code> which is an encapsulated <code>QBitArray</code>. But when I tried <code>bit[5]=true;</code> and opened the file in ST2, it still shew <code>SOH</code>. So I'm confused.<br>
  <img src="https://i.stack.imgur.com/g7PmK.png" alt="enter image description here"></p>