Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
If parent and child are of same type how can we propagate the event to a parent widget?
pratik041 last edited by
Suppose my parent is of QWidget type and child is also QWidget type. In child event if i will write QWidget::event(e); how we can distinguish whether the event is propagated to parent or child.
giesbert last edited by
If you get an event and call your base class, you call your base class. no other object. The propagation to the parent is done in the very base class itself and then always from child to parent, as the event is send to the child with the focus.
If you are talking about custom events, they will never be propagated to another widget.
BilbonSacquet last edited by
First the parent (and the parent of the parent until the QCoreApplication) dispacths it, but if the child (which has the focus or it is the destination) doesn't 'accept' it, it will be handled by the parent (and from the parent of the parent, ...).