Qt resizeGL problem
I'm writing a simple program where i have only one widget QGLWidget. I initialize it in constructor of my main class like this:
view3d = new GLBox(this);
开发者_开发问答
The view3d object is displayed properly but the problem is that the method resizeGL works only once - when the obejct is being created. After that it doesn't run when I change the size of the window. I used qDebug() function to chcek this and as I said it works only one time. I declared resizeGL as a protected method. Do you maybe know what can cause this problem? Thanks for your answers.
You should add your view3d widget into parent's layout. E.g.
view3d = new GLBox(this);
QVBoxLayout *box_layout = new QVBoxLayout;
box_layout->addWidget(view3d);
this->setLayout(box_layout);
精彩评论