Ubuntu 24.04
OCC 7.8.1
QT 6.4.2
У меня есть QWindow, который содержит QTabWidget, и этот TabWidget имеет два дочерних виджета
First tab simply associates with a QPushButton
Second tab associates with an OccQtViewer
OccQtViewer унаследован от QOpenGLWidget и содержит все, что связано с OCC, например:

После переключения с первой вкладки на вторую пользовательский интерфейс портится и вкладки больше не реагируют на нажатие, и в то же время распечатываются следующие предупреждающие сообщения:
QOpenGLContext::makeCurrent() called with non-opengl surface 0x5c468b22deb0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x5c468b22deb0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x5c468b22deb0
QRhiGles2: Failed to make context current. Expect bad things to happen.
...
И я приложил сюда весь исходный код
https://dev.opencascade.org/system/file ... /occqt.zip
и
Under Windows, same code works fine with Qt_6
Under linux, it works fine with Qt_5, but with Qt_6, it will print out above warnings.
Я обнаружил, что о подобной проблеме сообщалось здесь:
https://github.com/MythTV/mythtv/issues/754
И попробовал предложение внутри него установитьSurfaceType следующим образом:
QWidget* native = nativeParentWidget();
windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
if (native && native->windowHandle())
native->windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
Не повезло, это может быть проблема совместимости,
но я не уверен, связана ли эта проблема с OCC или QT_6 (под Linux),
Would you please help to fix this issue?
Подробнее здесь: https://stackoverflow.com/questions/793 ... -after-upg
Мобильная версия