PDA

View Full Version : Qt-Painting and OpenGL - is that a problem?



unusual
8th July 2010, 17:01
Hallo u all,
I try to bring OpenGL into a given application. The system uses QWidgets as Components. Overlapping or moving a Widget with transparent areas over a QGLWidget works not as expected. The Background is not shining through like on a normal Widget. Is this a default behaviour because of better performance or a matter of principle?
Are there solutions?

greetz

Mike

wysota
8th July 2010, 17:08
Is the moving widget a child of the gl widget or are they both independent windows?

unusual
8th July 2010, 17:45
The GLWidget and the moving Widget are independent. They are brothers for example. My system is highly configurable so the GLWidget is maybe the child of a child of achild of the form and the moving widget just a child of the form. The do not know anything about each other. - hope that helps to understand the problem...

lg

Mike

that was posible a litte cofusing - again: the QWidget is above the QGLWidget - overlapping - half in Qt-World half in GL-World...

wysota
8th July 2010, 19:29
Background of the GL widget is usually cleared to black or some other colour by the GL engine itself. You can try setting the clear colour of the GL context to transparent but I don't know whether it has a chance of working.

unusual
8th July 2010, 20:03
clearing GL with transparent color would make the GL-Background transparent - I want it the other way - the "normal" widget above the GL-Widget should be transparent - may I can send a screenshot tomorrow...

unusual
9th July 2010, 07:47
http://linux-rt.de/qtforum/screenshot002.jpg

The problem looks like this :(

(inside the box frame should only a be seen an ellipse on a transparent area)

wysota
9th July 2010, 10:53
Widgets are usually not used like that. Maybe you should implement your application with graphics view?

unusual
9th July 2010, 11:40
Well my nickis "unusual" ;) - the screenshot is a small test application just for keeping the problem simple - in my real application it is necessary to overlap widgets with a GL area. Just think about a touch keyboard (half transparent) on top of a OpenGl View...

wysota
9th July 2010, 12:16
Well my nickis "unusual" ;)
"abusive" sounds more to the point here ;) Sibling widgets should not be overlapping.


in my real application it is necessary to overlap widgets with a GL area. Just think about a touch keyboard (half transparent) on top of a OpenGl View...
Graphics view would handle all that.

unusual
9th July 2010, 12:28
So I have to do some test implementation with graphics view - thanks so far!

lg

Mike