PDA

View Full Version : How to keep specific window always above other specifi window?



grawp
7th August 2011, 00:13
How to keep specific window always above other specific window? I have the following situation:
I have one window with embedded video stream and then I have a transparent window of the same size as OSD. (I'm doing this because I need real transparency, not some double-buffered semi-thing.)
Keeping their positions synchronized is easy task. But I don't know how to make the the OSD 'always on top of the video stream'. I can only make it 'always on top of everything'.

Dong Back Kim
7th August 2011, 02:32
How to keep specific window always above other specific window? I have the following situation:
I have one window with embedded video stream and then I have a transparent window of the same size as OSD. (I'm doing this because I need real transparency, not some double-buffered semi-thing.)
Keeping their positions synchronized is easy task. But I don't know how to make the the OSD 'always on top of the video stream'. I can only make it 'always on top of everything'.

I guess you can achieve this by handling focus and mouse events. For example, if one of the "sub window", which should be always under the top window, is clicked or focus so it will attempt to be the top of all windows, then catch that event and make sure the top window is raised above the clicked one...

However, it seems your are doing some sort of overpainting... wouldn't it be easier make the two drawing into one widget?

Regards,

Santosh Reddy
7th August 2011, 06:17
Make the child window as model window, and set it's parent as the specific window.

grawp
7th August 2011, 11:48
However, it seems your are doing some sort of overpainting... wouldn't it be easier make the two drawing into one widget?

I've already tried. The problem is that the subwindow contains QX11EmbedContainer with embedded video window from Linphone (VOIP sw.) and I can't draw on a window from external application.

grawp
7th August 2011, 16:44
I've solved this issue by setting modality to Qt::WindowModal and window flags to Qt::Window to have true separate X11 window.