title: Using pointers to access elements of a QVector
body: <p>I have trouble with pointers and references to doubles.</p>
  
  <p>I want to access elements in QVector by names. The vector contains doubles:</p>
  
  <pre><code>QVector&lt;double&gt; properties;
  properties.append(28.0);
  properties.append(1.0);
  properties.append(44.0);
  properties.append(0.001);
  </code></pre>
  
  <p>Now I create pointers to doubles:</p>
  
  <pre><code>double* Amplitude;
  double* Frequency;
  double* PhaseDifference;
  double* Stepsize;
  </code></pre>
  
  <p>These pointers should provide access to the elements of my vector:</p>
  
  <pre><code>Amplitude = &amp;properties[0];
  Frequency = &amp;properties[1];
  PhaseDifference = &amp;properties[2];
  Stepsize = &amp;properties[3];
  </code></pre>
  
  <p>In my opinion dereferencing these pointers should give me the correct values, but it doesn't. In this case I got zeros for the first two pointers and the third and fourth were correct. </p>
  
  <p>I tried to use more entries in the vector and the result was that only the last two had the correct values. What is going wrong there? </p>
  
  <p>I create and print the values in the constructor. Printing of the vector gives the right values! </p>
  
  <p>Does anybody have an idea?</p>