What's the suitable widget in PyQt to create a floating widget on the desktop?
I'd like to create something very alike to Rainlendar with python. Currently I'm using PyQt for GUI, but there doesn't seem t开发者_JS百科o be a widget type that can directly display something like that, specifically I mean:
- No edge displayed, incuding buttons on the top right corner.
- No corresponding bar in the task bar.
- Able to display a icon in the icon area in the bottom right corner of the desktop.
Is there any widget capable of this ? Or can I do some modification to any existing widget to achieve this ?
Thanks.
- Have a look at the docs for QWidget.setWindowFlags. In particular, when coupled with Qt.FramelessWindowHint it should be borderless and buttonless.
- Another task for setWindowFlags — setting it to Qt.Tool stops the task bar entry. So combined with the above, you want
window.setWindowFlags(Qt.Tool | Qt.FramelessWindowHint)
- See the docs for QSystemTrayIcon
精彩评论