On Mon, Oct 25, 2021 at 9:40 AM David M. Cotter <d...@kjams.com> wrote:
> in the documentation here > <https://docs.microsoft.com/en-us/windows/win32/menurc/menus>, it > indicates i can get a message when the menu bar starts to be browsed, and > another when the browsing is completed. > > this is *exactly* what i need (the purpose is unrelated to this post). > > So in my QMainWindow derived class, i override the nativeEvent() method, > like so: > > [...] > > However, those messages are never sent :( > > Any idea why not? > I'm just guessing here, but it might be that the menu bar's events don't get delivered to the QMainWindow. Or, perhaps this documented caveat is important: "Note: Events are only delivered to this event handler if the widget has a native window handle." You might be able to catch the events if you use QCoreApplication::installNativeEventFilter ( https://doc.qt.io/qt-6/qcoreapplication.html#installNativeEventFilter). Adam
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest