The opengl window only flashes........
-
i create an opengl widget and want the windows to show up when i push the button (not in main(),but in other func)
this is my code ,when i push the button ,the windows only flashes and i can not see what has been paint in the window.@void Widget::startrun(){
visualazition grvisual;
grvisual.show();
}@the func "startrun" has already been connectd to the button(cleck()). visualization is the class name of my opengl widget class.
how can i solve the problem? -
[quote author="qxoz" date="1322369122"]if visualazition inherit from QWidget try
@
visualazition *grvisual = new visualazition;
grvisual->show();
@[/quote]it works! thanks a lot! through it actually inherit from qglwidgt.
why it's that? is there any difference between pointers & normal class? -
I`l glad to,
but my English is very bad, and i do't think that i can give right explanation
search here about function scope(or vision area )
"http://www.cprogramming.com/tutorial.html":http://www.cprogramming.com/tutorial.html
"http://www.learncpp.com/":http://www.learncpp.com/
"http://www.cplusplus.com/doc/tutorial/":http://www.cplusplus.com/doc/tutorial/and of course
"http://qt.nokia.com/learning":http://qt.nokia.com/learning