简体   繁体   中英

Force Qt Window on top of XPlane Window

I am writing a flight simulator application. For that my Qt Application window should stay on top of the flight simulator application window.

The flight simulators (P3D, FSX, XPlane) offer 2 different window modes, ie "windowed" and "full screen". The windowed modes are no problem, I can just set Qt::WindowStaysOnTopHint for my window and it works. However, it does not work for the XPlane fullscreen mode (but does for P3D/FSX).

I have no idea what XPlane fullscreen mode really does, only that it uses OpenGL. Obviously my window looses focus when I click into the XPlane Window. On Windows I can get it back on top with ALT+TAB

I have tried (triggered by timer) widget->activateWindow(); with no result. Are there any more "tricks" I could try.

In general, an application can't force itself to the front. It can request being brought to the front, but whether that request is granted is up to the window manager.

Applications (on some platforms) can tell the window manager that they will allow certain other applications to be brought to the front instead of themselves (which allows those applications to forcefully bring themselves to the front over the granting applications, but not over other uncooperative applications). Generally this is all a cooperative thing and no one application can force its will on all the others (which IMHO is a good thing).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM