Someone suggested that I re-implement the QWheelEvent
handler and check each child widgets' visibleRegion
is 0 or not.
Are there any better suggestions?
Someone suggested that I re-implement the QWheelEvent
handler and check each child widgets' visibleRegion
is 0 or not.
Are there any better suggestions?
When you add the widget. Give it a name.
QWidget* myWidget = new QWidget;
myWidget->setObjectName( "myWidget" );
...
//create scroll area
//add a layout to the scroll area
...
scrollArea->layout()->addWidget( myWidget );
Then, check visibility like so:
QWidget* widget = scrollArea->findChild< QWidget* >( "myWidget" );
std::cout << widget->isVisible() << std::endl;
You could keep a list of your widget names to more easily loop through and check when you're ready.
© 2022 - 2024 — McMap. All rights reserved.