Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.4.1
-
None
-
Macbook pro, OsX mavericks
Description
tI have been using the shader file with QOpenGLWindow and had the version 330 shader, everything was working fine.
However wanted to switch for a Widget to be able to dock it within my main window of application. I have been trying to get the right context ever since.
I am able to create the right one using the QGLWidget (which I have seen is deprecated):
QGLFormat format;
format.setProfile(QGLFormat::CoreProfile);
format.setVersion(3,3);
QGLFormat::setDefaultFormat(format);
When I am doing exactly the same thing with a QOpenGLWidget however:
I get
QOpenGLShader::compile(Vertex): ERROR: 0:1: '' : version '330' is not supported
Which is to some extand reasonable in a way that the management of the QGLFormat is not responsible for a new class.
However after switching to new classes and setting the core profile with:
QSurfaceFormat format;
format.setProfile(QSurfaceFormat::CoreProfile);
format.setVersion(3,3);
QSurfaceFormat::setDefaultFormat(format);
I am getting a crush:
0 libobjc.A.dylib 0x00007fff89f9a0dd objc_msgSend + 29
1 libqcocoa.dylib 0x000000011085e3a3 QCocoaIntegration::createPlatformOpenGLContext(QOpenGLContext*) const + 83
2 org.qt-project.QtGui 0x000000010d2c954a QOpenGLContext::create() + 74
3 org.qt-project.QtWidgets 0x000000010cc35a6d QOpenGLWidgetPrivate::initialize() + 141
4 org.qt-project.QtWidgets 0x000000010cc36e58 QOpenGLWidget::event(QEvent*) + 232
5 org.qt-project.QtWidgets 0x000000010cbd632b QApplicationPrivate::notify_helper(QObject*, QEvent*) + 251
6 org.qt-project.QtWidgets 0x000000010cbd9648 QApplication::notify(QObject*, QEvent*) + 8136
7 org.qt-project.QtCore 0x000000010da59d83 QCoreApplication::notifyInternal(QObject*, QEvent*) + 115
8 org.qt-project.QtWidgets 0x000000010cc18879 sendWindowChangeToTextureChildrenRecursively(QWidget*) + 73
9 org.qt-project.QtWidgets 0x000000010cc03339 QWidget::setParent(QWidget*, QFlags<Qt::WindowType>) + 2217
10 org.qt-project.QtWidgets 0x000000010cbf4569 QLayout::addChildWidget(QWidget*) + 201
11 org.qt-project.QtWidgets 0x000000010cd1e740 QMainWindowLayout::setCentralWidget(QWidget*) + 32
12 ultrahaptics.Optimus_gui 0x000000010cb27f74 MainWindow::MainWindow() + 580
13 ultrahaptics.Optimus_gui 0x000000010cb2396b main + 59
I am using Os X on the macbook pro.