Hi,
I have a custom titlebar in a custom QDockWidget to have a better undock behavior and possibilities.
All works good, the only problem is when I init one QMainWindow with dock inside, the focus of the QMainWindow is removed.
Here the code of my custom QDockWidget :
Qt Code:
  1. CDockWidget::CDockWidget( const QString& Title, QWidget* Parent ) :
  2. QDockWidget( Title, Parent )
  3. {
  4. m_Titlebar = new CTitlebarWidget( this );
  5. setTitleBarWidget( m_Titlebar );
  6. }
  7.  
  8. bool CDockWidget::event( QEvent* event )
  9. {
  10. switch( event->type() )
  11. {
  12. case QEvent::WindowTitleChange :
  13. {
  14. m_Titlebar->SetTitle( windowTitle() );
  15. return true;
  16. }
  17.  
  18. case QEvent::NonClientAreaMouseButtonDblClick :
  19. {
  20. if( isMaximized() )
  21. showNormal();
  22. else
  23. showMaximized();
  24. return true;
  25. }
  26. }
  27. return QDockWidget::event( event );
  28. }
To copy to clipboard, switch view to plain text mode 
If I comment the constructor code and the switch in the event function, the focus is not removed.
How can I solve this problem ?
Thanks for the help