1 Attachment(s)
Add OpenGl window to the grid layout of the child qwidget.
Hi Friends,
I am facing some problem while adding the opengl window to the child qwidget. I have:
- Parent qwidget.
- 1 grid layout
- 1 opengl window
- 1 child qwidget (of parent qwidget).
1'st I am adding the opengl window to the gridlayout then I am adding the gridlayout to the child qwidget. But I did not get any view (also paintGl is not calling, if by how I call paintGl then also I am not getting the view)
Note: If I directly set the layout to the parent qwidget then I got the open gl window.
What I am missing here??? I have attached my example along with this post.
Thank you very much...Attachment 5527
Re: Add OpenGl window to the grid layout of the child qwidget.
Create a layout and add the dummy frame to it as well. Your dummy frame probably has a QSize(0,0).
Code:
{
//OpenGL object
oGlDraw = new OpenGlDraw();
//QWidget
//dummyFrame->setWindowFlags( Qt::Dialog); //Point 3
//Grid layout
gLayout->addWidget(oGlDraw);
//setLayout(gLayout);
dummyFrame->setLayout(gLayout);
// this does it:
l->addWidget(dummyFrame);
setLayout(l);
};