Hi,
I have a qWidget with a qglwidget an other form elements inside. How can I resize my qglwidget when i expand or reduce the qWidget?
Thanks
Hi,
I have a qWidget with a qglwidget an other form elements inside. How can I resize my qglwidget when i expand or reduce the qWidget?
Thanks
Add qglWidget to the layout and then add layout to the qWidget.
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
An how I add the qglwidget to the layout?
Something along these lines:
And also RTM!Qt Code:
l->addWidget( qglWidget ); this->setLayout( l );To copy to clipboard, switch view to plain text mode
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
In this case, all the qwidget is surrounded by the qglwidget, all my buttons are seen in black.
If you don't add buttons to the layout that's what will happen (if I understand Your correctly).
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
I wish to add buttons to the layout:
Qt Code:
l->addWidget(ui->GLpanel); l->addLayout(ui->buttonInterface); //buttonInterface is a layout this->setLayout(l);To copy to clipboard, switch view to plain text mode
However, if I do this, I have a segmentation fault calling l->addLayout(...)
I see you're using designer, so for simplicity sake do this:
1. place Your buttons and other widgets with designer
2. place EMPTY layout (whatever type) into place that You want to have qglWidget (You can place inside this layout temporary QWidget for easier visualisation, because empty layout is 0 pix width/height - depending on others layouts)
3. remove temporary QWidget and remember layout that this widget is in
at this point logical structure is like this (layout's are nested):
mainLayout (with all buttons + layout for glWidget)->glWidgetLayout (layout where you will place your glWidget)
then in your constructor, after UI initialization simply use:
Also see this article. There is ready project that You can examine, because You error is in lacking of knowledge about layouts (everything what You ask is in manual RTM)Qt Code:
ui->glWidgetLayout ->addWidget( glWidget );To copy to clipboard, switch view to plain text mode
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
Bookmarks