Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
When is QEvent::LayoutRequest generated
Hello All, I'm new to this forum.
I know that QEvent::LayoutRequest is used to recalculate the layout upon a new child addition/removal. But i just want to know if there are any other cases that might call this.
Thanks in advance,
Other case: change of widget visibility.
Thanks for the reply @SGaist ,
I know this case & I forgot to mention this in my question.
I'm wondering if this is generated in any other cases.
Like when a widget gets a paint event, does it also get this?
Not necessarily, you can have a widget with custom painting an not any layout set on it.
You can check Qt's sources for all the use of that event.
QEvent::LayoutRequestis triggered whenever the layout has to be redone. There are many many places where such event is generated.
Basically it should be triggered whenever a child has been added to or removed from the layout. Or ones of the widgets layout properties has changed (margins, paddings, border, spacing, sizeHint etc.) (see QWidget::updateGeometry())