Hi guys.
I have a QWidget as the child of another within my application. The task consists of putting the internal widget in full screen mode and being able to see it again in normal mode with the same button. This partly I have managed to do it in the following way:
Qt Code:
  1. if(!isFullScreen())
  2. {
  3. setWindowFlags(windowFlags() | Qt::Window);
  4. showFullScreen();
  5. }
  6. else
  7. {
  8. setWindowFlags(windowFlags() & ~Qt::Window);
  9. showNormal();
  10. activateWindow();
  11. }
To copy to clipboard, switch view to plain text mode 
The problem arises when you return to see the widget in normal mode. Things that happen:

  • The mouse cursor stays with pointing hand cursor.
  • The button to change mode remains in hover state (the background color is changed when the mouse is over).
  • Passing the mouse through other widget controls does not change its appearance.



I have to click on the widget to fix the behavior. It's as if the widget did not receive events of any kind or something like that. I tried calling setFocus () and it did not work. I have also tried to send an event by hand in the following way but it has not worked either:
Qt Code:
  1. QMouseEvent my_event(QEvent::MouseButtonPress, QPointF (0, 0), Qt :: NoButton, 0, 0);
  2. QApplication::sendEvent(this, & my_event);
To copy to clipboard, switch view to plain text mode 
Any ideas?

Thanks.