Set attribute to share OpenGL contexts

Setting this attribute will make sure OpenGL resources are alive when the parent widget is changed during layout changes like full screen view or changing docking configuration.
This commit is contained in:
Magne Sjaastad 2024-01-24 07:01:00 +01:00
parent 163d54fb24
commit 1703f33eb7

View File

@ -77,6 +77,12 @@ int main( int argc, char* argv[] )
}
#endif
// The Qt::AA_ShareOpenGLContexts setting is needed when we have multiple viz widgets in flight
// and we have a setup where these widgets belong to different top-level windows, or end up
// belonging to different top-level windows through re-parenting.
// See test application QtTestBenchOpenGLWidget
QApplication::setAttribute( Qt::AA_ShareOpenGLContexts );
// Create feature manager before the application object is created
RiaMainTools::initializeSingletons();