File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ void OcctQtTools::qtGlPlatformSetup()
135135 }
136136#endif
137137
138+ // request Qt to share resources between OpenGL contexts like QOpenGLWidget and QQuickWidget;
139+ // allows detaching OCCT 3D Viewer widget inside QDockWidget into new top-level window
140+ QCoreApplication::setAttribute (Qt::AA_ShareOpenGLContexts);
141+
138142/* #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
139143 // workaround for some bugs in Qt5
140144 OSD_Environment aQGlyph("QT_ENABLE_GLYPH_CACHE_WORKAROUND");
Original file line number Diff line number Diff line change @@ -179,10 +179,6 @@ int main(int theNbArgs, char** theArgVec)
179179 QCoreApplication::setOrganizationName (" OpenCASCADE" );
180180 QCoreApplication::setApplicationVersion (OCC_VERSION_STRING_EXT);
181181
182- // request OpenGL-compatible surface from Qt
183- const QSurfaceFormat aGlFormat = OcctQtTools::qtGlSurfaceFormat ();
184- QSurfaceFormat::setDefaultFormat (aGlFormat);
185-
186182 MyMainWindow aMainWindow;
187183 aMainWindow.resize (aMainWindow.sizeHint ());
188184 aMainWindow.show ();
You can’t perform that action at this time.
0 commit comments