8

Someone suggested that I re-implement the QWheelEvent handler and check each child widgets' visibleRegion is 0 or not.

Are there any better suggestions?

ymoreau
  • 3,402
  • 1
  • 22
  • 60
Nyaruko
  • 4,329
  • 9
  • 54
  • 105

1 Answers1

3

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.

davepmiller
  • 2,620
  • 3
  • 33
  • 61