Siblings on top of QGLWidget
-
According to the Qt documentation siblings on top of QGLWidget are not supported on mac.
bq. On Mac OS X, when Qt is built with Cocoa support, a QGLWidget can't have any sibling widgets placed ontop of itself. This is due to limitations in the Cocoa API and is not supported by Apple. ("here":http://doc.qt.nokia.com/latest/qglwidget.html)
As you can see in the quote it says: On Mac OS X, when Qt is built with Cocoa support...
So, is there a possibility turning the Cocoa support off? I mean, from this sentence I understand, that it might be possible.
It would be such a great help if I could place siblings on top of my QGLWidget...
Thanks...
-
Sure, you can compile Qt for carbon: configure -carbon ... . Note however that this is not as well supported any more (Tier 2 for 4.7), no 64 bit support ... See also http://doc.qt.nokia.com/4.7-snapshot/developing-on-mac.html
-
Thanks for your answer. But I dont mean Qt in general. I mean especially creating siblings on top of a QGLWidget, which is a problem on mac.
-
Your Qt is either using Cocoa, or Carbon. This isn't a runtime switch, but a compile switch, so I'm afraid you're out of luck.
(Btw, I ran into the same problem a while ago, but could solve it by changing the widget hierarchy. Maybe you can make your sibling objects to be inside the QGLWidget scene)?
-
bq. (Btw, I ran into the same problem a while ago, but could solve it by changing the widget hierarchy. Maybe you can make your sibling objects to be inside the QGLWidget scene)?
This is interesting. Can you be more specific about that. How did you manage to do that? Maybe an example. I am new to Qt, so it is difficult to understand everything from descriptions.
THANKS
-
A QGLWidget can have child widgets, which are then automatically rendered in the OpenGL context. That is, if you've a hypothetical hierarchy:
@MainWindow
ToolBar1
GLCanvas
ToolBar2
@
And you want to allow the toolbars to overlay the canvas, you can try to change the hierarchy to@MainWindow
GLCanvas
ToolBar1
ToolBar2@