I'm developing an application using Qt, where I have two QDockWidgets.
I have set these widgets to only dock on the left side of the main window, one on the left top and one on the left bottom, and I have set them to return to their original position automatically when they are dragged out and then released.
When I drag out one of the QDockWidgets, the remaining QDockWidgets automatically resize to fill the entire left side. However, when I release the dragged QDockWidget, causing it to return to its original position, a flicker occurs.
And I discovered that the returning QDockWidget first overlaps with the other QDockWidgets, and then the other QDockWidgets resize and reposition themselves. That's the cause of the flickering.
What I want to achieve is for the other QDockWidgets to immediately resize and reposition themselves when a QDockWidget is re-docked, in order to prevent this flickering.
How can I achieve this?
I've tried using an eventFilter to detect the QEvent::MouseButtonRelease event and immediately adjust the layout of the QDockWidgets when this event occurs, but this hasn't solved the problem.
What else should I try?
Or should I try more on an eventFilter to immediately adjust the layout?