QT GLWidget
-
So, i made my code, but when i run the program the ui only shows a black GLWidget, what can i do to solve this? i'm using the newest version of QT
-
@Daniel-Acosta said in QT GLWidget:
So, i made my code, but when i run the program the ui only shows a black GLWidget, what can i do to solve this? i'm using the newest version of QT
First, try switching to
QOpenGLWidget
instead. This fixes a number of problems withQGLWidget
.Next, open the "Examples" section of Qt Creator and try to run the "OpenGL Window Example". Does that work?
If the example works but your own app doesn't work, post some code.
-
@JKSH first, thanks for the fast reply, the example works, the code i'm using is exactly the code on this page http://www.bogotobogo.com/Qt/Qt5_OpenGL_QGLWidget.php
-
@Daniel-Acosta said in QT GLWidget:
the code i'm using is exactly the code on this page http://www.bogotobogo.com/Qt/Qt5_OpenGL_QGLWidget.php
That example uses the old
QGLWidget
. As I said, you should useQOpenGLWidget
instead.@JKSH first, thanks for the fast reply, the example works
You're welcome.
I'm glad to hear that the "OpenGL Window Example" works. Next, try the "Hello GL2 Example" from Qt Creator. If that works, that means there is nothing wrong with Qt or your system -- Just use different tutorials instead.
-
I have this problem.I try run this code :http://www.bogotobogo.com/Qt/Qt5_OpenGL_QGLWidget.php
but page is black. -
@Saeed_Nowroozi said in QT GLWidget:
I have this problem.I try run this code :http://www.bogotobogo.com/Qt/Qt5_OpenGL_QGLWidget.php
but page is black.Read the other posts in this thread and follow their instructions.