Hi,
I have a doubt regarding focus. Maybe this is not a Qt related topic, if so sorry in advance.
I have a Widget inherited from QWidget having some children ( push buttons and other widgets ).
So:

Qt Code:
  1. class WaveWidget : public QWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. WaveWidget( QWidget* parent = 0 );
  7. virtual ~WaveWidget();
  8.  
  9. void setSoundFile( QString soundName_ );
  10. void closeSoundFile( QString soundName_ );
  11.  
  12. public slots:
  13. void playSound();
  14. void stopSound();
  15. void zoomIn();
  16. void zoomOut();
  17. void setZoomFactor( float f );
  18.  
  19. signals:
  20. void zoomFactorChanged( float );
  21.  
  22. protected:
  23. virtual void focusInEvent( QFocusEvent * );
  24. virtual void focusOutEvent( QFocusEvent * );
  25. virtual void keyPressEvent( QKeyEvent* event );
  26.  
  27. private:
  28. WaveDisplay* m_WaveDisplay;
  29. PanelInfo* m_panel;
  30.  
  31. SoundData* m_wave;
  32.  
  33. QPushButton* button1;
  34. QPushButton* button2;
  35. QPushButton* button3;
  36. QPushButton* button4;
  37. QPushButton* button5;
  38. QPushButton* button6;
  39. QPushButton* button7;
  40. QPushButton* button8;
  41. QPushButton* button9;
  42. QPushButton* button10;
  43. QPushButton* m_zoomInBtn;
  44. QPushButton* m_zoomOutBtn;
  45.  
  46. QLabel* m_titleLabel;
  47.  
  48. QLed* m_statusLed;
  49.  
  50. float m_ZoomFactor;
  51. };
To copy to clipboard, switch view to plain text mode 

The WaveWidget should react to keyboard keys pressed ( I reimplemented keyPressEvent ).
If initially WaveWidget has focus, pressing tab the focus pass to it's children. In this case WaveWidges still react to keyboard keypressed?
I would like yes, but I don't know how to implement such behaviour.

Best Regards