In the debugger, I can see that my QMenu objects do not reside in the same thread as the main gui thread. E.g., QApplication.instance().thread() == 0xdeadbeef
, but mymenu.thread() == 0xdeadbabe
1) Is that expected? BTW, my QMenus are not native menus (I used setNativeMenuBar(False)
)
2) I want to block until the menu is finished processing all events. I tried QApplication.processEvents()
, but that's a little tricky because it has to be called from the same thread as the the widget I want to wait for (in my case, the menu). I used a custom event filter class in combination with moveToThread()
to make sure that processEvents()
is called from the same thread that QMenu is running in, but it doesn't seem to matter.
No matter what I try, I can't seem to block for the completion of all QMenu event/action signal handling. My only option seems to be to sleep()
long enough that I know the processing is finished. But that's not really acceptable for my use-case.