GosuSan
GosuSan

Reputation: 109

Keep QDialog on top of everything, even fullscreen applications?

On a project I work on, using Python3 + PySide, I try to print a popup-message as some sort of notification.

This popup needs to be on top of everything, this includes fullscreen applications like games or browsers. And that's the point that does not work. It works fine for all windows on my Desktop, normal windows, maximized, but as soon as there is a fullscreen application or a borderless window ("pseudo fullscreen") the popup is created, but "behind" the fullscreen app.

I already use self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) but this flag does get ignored by other fullscreen apps.

How do I fix this? Also without giving focus to the popup. It is just there to present information, and it is not good when your window looses focus while playing a game.

My code can be found here: https://github.com/GosuSan/PyECM

additional Info:
- my project aims to be cross-platform, so I need a platform-independend solution
- I am running linux, without having a windows machine atm, so I can't test stuff there.

If you need any more info, let me know!

Edit:
It seems that PySide.QtGui.QSystemTrayIcon.showMessage does what I want, it works on fullscreen as well as on borderless-windows. So I will try to either find out how those messages are displayed on top, or just use them, not sure for now.

Upvotes: 1

Views: 1094

Answers (0)

Related Questions