Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGLWidget not showing
I am new to OpenGL and fairly new to Qt and I encountered a curious problem. Based on the "tutorial":http://files.linux-addicted.net/qtproject/learning/developerguides/qtopengltutorial/OpenGLTutorial.pdf linked on this homepage I implemented some basic OpenGL examples. They work fine and I was even able to extend them to my wishes.
But, as soon as I try to use the widget as a component in a layout the frame stays black.
After some trail and error I also found that the original widget does not show if I instantiate it through a pointer. I suppose this might have something to do with the problem.
int main(int argc, char *argv)
QApplication a(argc, argv);
//This is not showing:
GlWidget *sphere1 = new GlWidget();
//This is showing:
I am using Qt 5.3 and really hope you can help me solve this. It is a central point for the project I'm working on right now. If you need any further code please let me know (but basically it is the code described in chapter 3.5 of the tutorial and can be downloaded via "link ":http://download.qt.io/learning/developerguides/qtopengltutorial/ ).
Cheers and thanks in advance,
just tried it with the original scr and works perfectly. I'll just try and rebuild it from that point.
Thanks for the interest in the topic,
I solved it. It was a case of personal stupidity and not a technical problem. I failed with the declaration of a parameter (I love C++ ;-D).
Somebody please close this thread.
Hi and welcome to devnet,
What parameter was it ? It might help another forum user :)