https://bugs.kde.org/show_bug.cgi?id=374568

--- Comment #10 from Yichao Yu <yyc1...@gmail.com> ---
I agree the code is likely UB. Still curious why it only crashes on your setup
and what code the compiler actually generate. When the method is protected,
would the following work?

```
struct HackedMenu: public QMenuBar {
static void send(QMenuBar *menubar, QMouseEvent *event)
{
    menubar->event(event);
}
};

if (((HackEvent*)event)->adjust()) {
   HackedMenu::send(menu, event);
   return true;
}
```

This should not be UB (I hope?) and does not have any of the casts.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to