PDA

View Full Version : How to set the Z-order in a Real-time rendering window



haji
7th May 2011, 03:04
Currently, I am working on a Navigation QT application. The Navigation SDK provided a implementation to connect the map control and windows like that:

bRequestCreateRenderView( windowHandle);

I get the windowshandle with the code : "this->winId()" (this = MainWindow) and that works.

Then, I came across with problems about Z-order. All the widgets in that windows are invisible, until I move the mouse to these widgets' position. I think it is because of the rendering view is the topmost layer, and covers all the widgets in that windows.

I had tried all the methods like "setWindowFlags(Qt::WindowStaysOnTopHint);" "hide() & show()"; "raise()"; "activateWindow();". but none works. Could anyone give me some advice about how to place a widget at topmost layer in this case?


(another method to work around this problem):
Meanwhile, I am trying to implement a window embedded in the application. This embedded window would connect with the map control, and rendering continuous. And another window with transparency background (included all the widgets) was placed on the topmost layer?

Is that possible? Or could anyone give me some advice to deal with my case?

wysota
8th May 2011, 23:25
I would suggest that you restate your problem in a somewhat clearer manner. We're not sitting inside your head and we have no idea what you are doing. Read your post and think how much you make out of it yourself.

haji
9th May 2011, 05:24
Thank you for your advice.
Since the problem is quite complex and hard to state clearly, I am trying to restate my problem.

menkey18
6th December 2012, 03:55
This is exactly the same problem I am having.

I have a vlc player embedded into a QX11EmbeddedContainer, and added to a QGridLayout.
Then on the QGridLayout add another widget, which is an image. I am expecting the image to display over the vlc video.

While I have specified the z order in the .ui file to do so, but the VLC video is still staying on top of my image widget.

I had one ugly solution which is to add the VLC video to a QStackedWidget, and then add another QLabel to it.
Then append the QStackedWidget to QGridLayout.

Once I ve done that and compiled with Qt library 4.6.3 it works.
But then I discover it doesn't work again in Qt4.7 or 4.8, which is rather confusing...

So I have to step onto this problem again and try to find a better solution.
Could anyone suggest a better way of doing this?

wysota
6th December 2012, 10:54
I don't think you can find a reliable solution to putting an overlay over an X11Embedded widget. Maybe you should use some other mechanism than XEmbed?

prof.ebral
6th December 2012, 14:34
Why not keep the widget out of the QGridLayout so it has no parent, and then move it to where you want on the screen? You can use .move or .setGeometry