title: Is this the corrected way to use QPointer?
body: <p>How could I check whether a pointer's content is deleted? If I use QPointer like this:</p>
  
  <pre><code>myClass::myClass(myStruct* p){
   _p = p;//_p is a QPointer&lt;myStruct&gt;
  }
  
  myClass::function(){
  if(_p) {_p-&gt;function();}
  }
  </code></pre>
  
  <p>then I have</p>
  
  <pre><code>myStruct* p = new myStruct();
  myClass A(p);
  delete p;
  A.function();
  </code></pre>
  
  <p>will the last A.function() cuase the _p->function() be called and therefore cause access violation? when I delete p, what will happen to _p?</p>