There is something wrong with QOpenGLWidget
-
I wrote several small programs with QOpenGLWidget, which could be run independently about two months ago.
Today, I want to use them and find that these softwares can be opened (no .dll missing), but once it was involved in the opengl interface, it would get stuck and crash (kind of like entering a dead loop).
I put opengl32.dll into the root directory, and then I use qdebug to locate the problem whiling show() triggered. A large number of debug info: "Failed to make context current." "QOpenGLWidget: Failed to make context current" "composeAndFlush: makeCurrent() failed"
The opengl demo from qt creator is not successful either.
I tried to uninstall qt and install qt again but it didnt work.
ps: Softwares work perfectly on my colleague's computer.
I really want to know what happened. My environment is QT5.11.1 + MSVC2017 +Win11x64. I guess something is changed in these two months but I dont know how to deal -
Hi and welcome to devnet,
One possible thing is an update to your graphics driver. You should start by checking this. Then either upgrade or downgrade it depending if it's the latest version or if a new one is available.
-
Hi and welcome to devnet,
One possible thing is an update to your graphics driver. You should start by checking this. Then either upgrade or downgrade it depending if it's the latest version or if a new one is available.
-
Because that is not the driver for your graphics card. That's the thing you should check.
-
What exactly are you doing with that widget ?
-
@SGaist said in There is something wrong with QOpenGLWidget:
What exactly are you doing with that widget ?
I'm sure that I did nothing. Also the demo of qt creator which use QOpenGLWidget don't work.
@Jerry-Le QT5.11.1 is kind of old. Get a newer version of QT(for example above 5.15.2)
Troubleshooting Steps:
Update Drivers: Ensure that your graphics drivers are up to date.
Check OpenGL Version: Verify that your system supports the required OpenGL version.
Qt Settings: Review your Qt configuration, particularly the OpenGL settings.
Environment Variables: Try setting QT_OPENGL=angle or QT_OPENGL=software as a temporary workaround.
Application Logs: Check the application logs for more detailed error messages that might point to the root cause.