Added QApplication::setAttribute(Qt::AA_ShareOpenGLContexts) to properly support top level window change of OpenGL widgets

This commit is contained in:
Uwe Kindler 2024-04-19 07:42:03 +02:00
parent 5af55c1258
commit 8eb200b9a9
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ Makefile
*.dll
*.a
build-*
build_*
# IDEs
.idea

View File

@ -43,7 +43,7 @@ int main(int argc, char *argv[])
#endif
#endif
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
std::shared_ptr<int> b;
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QApplication a(argc, argv);
a.setApplicationName("Advanced Docking System Demo");
a.setQuitOnLastWindowClosed(true);