PDA

View Full Version : refresh form after adding a widget



cyrille
2nd February 2007, 10:13
Hello everyone,

I'm trying to add a QGLWidget inside a QMainWindow, after the first "show()".

The code looks like that :



_window = new QMainWindow;
_ui.setupUi(_window);
createActions();
_window->show();

and inside a slot (when I push a button) :



myGLWidget *glwidget=new myGLWidget(_ui.centralwidget);
glwidget->setGeometry(QRect(20, 200, 660, 680));


when, I put the myGLWidget before _window->show(), the widget is displayed, but, when inside the slot, it is like nothing appened...

-> Is there a method (show, refresh, update.. ?) to force my QGLWidget to show itself?

Cyrille

wysota
2nd February 2007, 10:19
Yes, call show() on the gl widget just like you did for the main window.

cyrille
2nd February 2007, 10:40
Thanks a lot, ... I thought I already tried "show()" and that's why I posted here.
Well it works anyway, thank you again!