How to determine whether a Widget is really visible? (in a scroll area)
I need to be able to determine whether a given QWidget is really visible or not – required for some lazy loading in a QScrollArea.
The Show and Polish(Request) events are called even if the widget is not visible.
To be more specific: I would like to test whether the widget will be paint-ed or not. Is this information available somehow? The paintEvent() of the widget is not called, so I guess Qt knows it internally that the widget won’t be visible.
calling the widget’s visibleRegion() gives correct information – but where should I test it? I don’t want to test with a timer, I would like to get an event about it or test it when a related event occurs.
Is there any related event (occurs when the widget is moved into / moved out from the visible area)?