title: QTimer::singleShot not work in the qkeyevent
body: <p>I create a keyevent which if I push key "A" it will do the function <code>A()</code>. </p>
  
  <p>In the A() function, I increment  global parameter "g" by 1 and create a <code>QTimer::singleShot</code> to wait 2 seconds and print the value of "g". For example, the initial value of "g" is 0. When I push Key "A" twice, the output value of "g" should be 1 in the first time and 2 in the second time.</p>
  
  <p>However, when I push the key in 2 seconds, I found that the <code>QTimer::singleShot</code> not work in the first time and the output is <strong>"first:g=2,second:g=2"</strong>. Why the output is <strong>"first:g=2,second:g=2"</strong> not <strong>"first:g=1,second:g=2"</strong>? Also why the  <code>QTimer::singleShot</code> not work in the first time,it just print the values in the same time, did not wait 2s.</p>
  
  <pre><code>int g = 0;
  void MainWindow::keyReleaseEvent(QKeyEvent *event) {
    Qt::Key_A: 
      g++;
      qtimer1-&gt;singleShot(2000, this, SLOT(a()));
  }
  
  //slots
  a() {
    qdebug &lt;&lt; g;//print value
  }
  </code></pre>
  
  <p>If I push the key in 2s,the output are "2, 2" not "1,2". It means that <code>QTimer::singleShot</code> not work. How can i do to get the true values when i push the key so quickly. </p>