Hi Paul,

I don't have the old versions you mention around anymore, but there's a
recent change to QOSGWidget.cpp that might help.  Appearently,
QtWidget::winId() returns a value which can be used as a window pointer
under Windows and Linux but not under OSX.

generic version (original code):
traits->inheritedWindowData = new WindowData(winId());

replaced with this for OSX only:
traits->inheritedWindowData = new
WindowData(HIViewGetWindow((HIViewRef)winId()));

the near equivalent Qt code:
traits->inheritedWindowData = new WindowData(qt_mac_window_for(this));

The fix assumes that OSG has been built for Carbon and not X11 windowing.
When built for X11 there's a seperate OSG rendering window in addition to Qt's.


-Don Leich

>
>
> Hello,
>
>
>
> Has anyone succeeded in using OSG to paint into Qt widgets on Mac OS X?
>
>
>
> On Windows it works without any problems if I do this:
>
> Producer::Camera *cam->getRenderSurface()->setWindow(QWidget::winId()).
>
>
>
> On Mac, however, this only works if the QWidget is a toplevel widget.
> If a QWidget is inside another widget, though, the window never gets
> repainted.
>
> I've tried using QWidget::handle() instead, but that only returns the
> same thing as winId for that widget's toplevel ancestor.
>
>
>
> I'm using Leopard 10.5.6.  But both OSG and Qt are old versions:  OSG
> 1.2 and Qt 3.3.8.  Sorry, but I can't upgrade now...
>
>
>
> Thanks
>
> Paul
>
>
>


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to