QMenu modess / async

QMenu can be created using popup () or exec (). The former creates it asynchronously, while the latter blocks. But this is not useful if you are using QMenuBar (AFAIK).

My question is, can QMenuBar tell only asynchrous / modeless QMenus popup? I'm not sure that the conditions are true, but all I want is a Menu that will not block the rest of the application when users click on it.

+4
source share
1 answer

The workaround you are looking for is to move objects that cannot live with this “abuse” to a separate QThread. If you have a clean interface using signals and slots, this is trivial. Just use moveToThread() and you moveToThread() done. You do not need to worry about anything else.

0
source

Source: https://habr.com/ru/post/1447823/


All Articles