hi,
I use the ViewerQOSG in Examples osgviewerQT for my app. I create a class
CViewer : public ViewerQOSG, and add it to my QMainWindow as the
centralWidget. That works well.
However, now I want to use multi-thread in my qt app. I leant from the
example osgQtBrowser, but I find it hard to add ViewerFrameThread. The code
follows:
if (useFrameLoopThread)
{
ViewerFrameThread viewerThread(viewer.get(), true);
viewerThread.startThread();
return QApplication::exec();
}
else
{
while(!viewer-done())
{
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
viewer-frame();
}
return 0;
}
The code above is in the main.cpp in osgQtBrowser. But now in my main.cpp it
is like this:
MainWindow *mainWin = new MainWindow;
mainWin-show();
return app.exec();
and the CViewer is constructed in MainWindow's constructor function.
and now frame() is in QOSGWidget.h like:
virtual void paintEvent( QPaintEvent * event ) { frame(); }
So how can I add a thread in my app(has a QMainWindow and a CViewer), like
in the example osgQtBrowser.
Thanks for all !
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org