Hi Everyone,

To see how various keys behave in the context of Qt when pressed and released, I added 2 VIRTUAL FUNCTIONS to my MainWindow Class and implemented them in the following way:

Qt Code:
  1. void MainWindow::keyPressEvent ( QKeyEvent * event )
  2. {
  3. qDebug("Came here,,,, Key Pressed");
  4. }
  5.  
  6. void MainWindow::keyReleaseEvent(QKeyEvent *event)
  7. {
  8. qDebug("Came here,,,, Key Released");
  9. }
To copy to clipboard, switch view to plain text mode 


What I observed is that, whenever I pressed any key, I would get both the qDebug statements as expected. But in the case of following four keys, I get only the qDebug of the keyReleaseEvent method:
Tab key, LeftArrow key, RightArrow key, SpaceBar
That means, for these keys only release event happens. I am really confused . Can anyone please explain why it is so?


With Regards,
Sattu