Hello! I'm mixing Qt and OSG in my app and found that great topic in the OSG 3 Cookbook that is Starting rendering loops in separate threads.
My app has this layout: |---------------------| |..1..|.....2............| |......|...................| |......|...................| |......|...................| |......|...................| |---------------------| 1 is a QTreeWidget and 2 is a custom widget that inherits from QWidget and wraps an osgViewer::Viewer. When I add an item to the QTreeWidget, a #2 widget is created with its own osg viewer. For now, it works fine. I can change between the widgets and interact with them. The problem came when I tried to add a rendering thread for each #2 widget, I got an error when adding a new item in the QTreeWidget: > > ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects > owned by a different thread. Current thread 5c2da018. Receiver '' (of type > 'QTreeView') was created in thread 5c30e7b0", file > kernel\qcoreapplication.cpp, line 469 > Invalid parameter passed to C runtime function. > Invalid parameter passed to C runtime function. > QObject::killTimers: timers cannot be stopped from another thread > What can I do to amend this? I have thought of using a single global viewer (and only one rendering thread) and switch nodes, so when I choose an item in the QTreeWidget, I will hide the previous one and show/render the selected one. Would this work? Or maybe starting/stopping the rendering threads whenever I choose an item in the tree? Thanks for your time! Adrián. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53410#53410 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

