Hello! I have several QWidget windows I'm making click through by using

Qt Code:
  1. setWindowFlag(Qt.WindowType.WindowTransparentForInput, True)
To copy to clipboard, switch view to plain text mode 

The issue is that these windows are already visible and setting window flags hides them, forcing me to show() them again. The result is awful, they blink as if glitching. I've thought of two possible solutions:

1. Use overrideWindowFlags() instead

Qt Code:
  1. flags = self.windowFlags() | Qt.WindowType.WindowTransparentForInput
  2. self.overrideWindowFlags(flags)
To copy to clipboard, switch view to plain text mode 

I'm not sure it's the solution because I couldn't get it to work. Unfortunately there's very little on the internet about how implement it. When used to override flags it won't notify the window system. And how do you notify it later? Mystery! Without this notification the flags changes never kick in. I've thrown lots of codes at it without success.

My latest tries have been around winId. Besides hiding the window, setFlags will erase the winId and set it again. I couldn't find a way to really reproduce this to make the override maybe work.

2. Cover window then reveal when it's done painting

The alternative solution is to capture the screen and cover the window with flags being set with a dummy window with the screenshot, hiding it when the real window is repainted. Besides being contrived it comes with its own can of worms, starting with the fact that most methods to check if a window is visible don't return true when they're drawn, but way before that, when the request to be shown comes in. Again I couldn't find a reliable method to solve the issue, in this case signal when a window is done painting.

Ideas?