Notification window in Mac. With or without Qt

后端 未结 5 1531
一整个雨季
一整个雨季 2021-02-06 13:03

Qt project on Mac OS X. I need to show notification window on top without stealing a focus from any active application.

Here the widget constructor part:



        
5条回答
  •  [愿得一人]
    2021-02-06 13:50

    Ive just tested these flags

    Qt::FramelessWindowHint |Qt::WindowSystemMenuHint |Qt::WindowStaysOnTopHint
    

    And

     setFocusPolicy(Qt::NoFocus);
     setAttribute(Qt::WA_ShowWithoutActivating,true); 
    

    Without Cocoa or Carbon code for window flags/masks. And notifyWindow works like on Windows or Linux.

提交回复
热议问题