[Solved]How to make always top window
-
wrote on 21 Oct 2010, 09:12 last edited by
I want to know how to make the widget which always keep top like TaskManager
whenever active window switches to any window.Please advise me!
-
wrote on 21 Oct 2010, 09:56 last edited by
@setWindowFlags(Qt::WindowStaysOnTopHint);@
-
wrote on 21 Oct 2010, 11:12 last edited by
Thank you for your quick response!
I succeeded^^
So this problem is solved. -
wrote on 21 Oct 2010, 11:24 last edited by
Sorry but When I used FramelessWindowHint,
my Widget can't keep "StaysOnTop".How should I do ? please teach me!
-
wrote on 21 Oct 2010, 13:01 last edited by
The Qt documentation for Qt::WindowStaysOnTopHint says:
bq. Informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass Qt::X11BypassWindowManagerHint for this flag to work correctly.
If you are on X11 try it
-
wrote on 22 Oct 2010, 06:51 last edited by
bq. Sorry but When I used FramelessWindowHint,
my Widget can’t keep “StaysOnTop”.How should I do ? please teach me!
This work for me (windows xp)
this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);maybe try the tips of mcosta if you're on x11.
-
wrote on 25 Oct 2010, 14:03 last edited by
Thank Mr stuk and mcosta for your kind reply!
I succeeded in making Frameless and StaysOnTop window.
My fault is that I called setWindowFlags twice for FramelessWindowHint and WindowStaysOnTopHint respectively.
I apologize for my poor knowledge.
So this issue is solved.
-
wrote on 1 Nov 2013, 21:00 last edited by
On a similar vein, from the main app I'm opening up a small dialog box by creating a QWebView.
By default its in the background I wanted it to show up on the foreground so I set the WindowStayOnTop flag, however I don't want it to always stay on top, just when its first created and then act like a normal window afterwards.
How do I achieve this?
-
wrote on 17 Dec 2013, 03:22 last edited by
really good answer, but I want more, if I want the widget won't be stay on top when i switch to other application, such as Chrome/Visual Studio, how to do that, that means, I want that widget only stay TOP in-application.
-
wrote on 30 Apr 2014, 08:12 last edited by
[quote author="lygstate" date="1387250539"]really good answer, but I want more, if I want the widget won't be stay on top when i switch to other application, such as Chrome/Visual Studio, how to do that, that means, I want that widget only stay TOP in-application.[/quote]
I'm looking for the same thank you! Anyone knows how to do it?
Thanks!
-
wrote on 12 Feb 2021, 12:56 last edited by
It can be done by adding flag Qt::Popup
and if you have some transparent window so you want to have it always on top of chrome etc.. and at the same time you want your that flag not to force you show the rectangular edges of the window
you also add the flag Qt::Sheet