Hi,

I have reimplemented the keyPressEvent of QLineEdit ( Qt4). Following is the code
Qt Code:
  1. void LineEdit::keyPressEvent(QKeyEvent *e)
  2. {
  3. if(e->key() == Qt::Key_Backtab){
  4. //Do something
  5. }
  6. else if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Tab || e->key() == Qt::Key_Enter){
  7. //Do something
  8. }
  9. else{
  10. QLineEdit::keyPressEvent(e);
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

1. When I press the tab key this part of code is not executed. Another widget which is the part of my application gets the focus (Which should have happened if I wouldn't have reimplemented the keyPressEvent). How can i override this behaviour?

2. Is Qt::KeyBacktab same as Shift+Tab?

3. Can some please show me how to use modifiers. I am trying to use it in the following way :
Qt Code:
  1. if(e->key() == Qt::Key_Return && e->modifiers() == Qt::ShiftModifier){
  2.  
  3. }
To copy to clipboard, switch view to plain text mode 
Is it the correct way of using modifiers?

Thanks a lot.