Cleaned up the Qt find package, and made changed the default threading model to SingleThreaded when using Qt5 to avoid crash due to regresssion since Qt4.

This commit is contained in:
Robert Osfield 2014-01-23 10:09:53 +00:00
parent ea429d5d46
commit fd85542d8f
2 changed files with 7 additions and 1 deletions

View File

@ -601,7 +601,7 @@ IF(OSG_USE_QT AND NOT ANDROID)
#If we have found Qt5, let's try to top off by getting the webkit as well #If we have found Qt5, let's try to top off by getting the webkit as well
IF ( Qt5Widgets_FOUND ) IF ( Qt5Widgets_FOUND )
FIND_PACKAGE(Qt5WebKitWidgets) FIND_PACKAGE(Qt5WebKitWidgets QUIET)
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@ -93,7 +93,13 @@ int main( int argc, char** argv )
{ {
osg::ArgumentParser arguments(&argc, argv); osg::ArgumentParser arguments(&argc, argv);
#if QT_VERSION >= 0x050000
// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::SingleThreaded;
#else
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext; osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
#endif
while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded; while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext; while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext; while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;