How to prevent child component from taking mouse focus


I’m not even sure how to properly ask this but I have child components that are plainly for visuals and they should not affect the parent component’s mouse focus. Is there a way to make components “invisible” to mouse so that the parent component would always receive mouse events when the mouse is inside that component even if a child component is under the mouse?

Yes, there is Component::setInterceptsMouseClicks().

This switches the hitTest to return false every time, so any mouse event will see through this component (or through its children, depending, which bool flag you set).
Despite the name it effects mouseEnter and mouseExit as well.

AH! I thought it would only affect clicks… Thank you so much!! :slight_smile: