Rebekka
28th September 2010, 07:53
I wrote a simple opengl program using QGLWidget. It looks like this
http://i074.radikal.ru/1009/2d/18a01f314ec6.jpg
As you can see glwidget takes all the space of the window. How can I resize it?
glViewport() does not help.
http://s53.radikal.ru/i140/1009/20/ae57be5022ec.jpg
I want to make it smaller and add some buttons on the right.
I use this code to add glwidget on the window:
Window::Window() // constructor
{
glWidget = new MyGLWidget;
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addWidget(glWidget);
setLayout(mainLayout);
setWindowTitle(tr("Hello GL"));
}
P.S. Sorry for my English.
http://i074.radikal.ru/1009/2d/18a01f314ec6.jpg
As you can see glwidget takes all the space of the window. How can I resize it?
glViewport() does not help.
http://s53.radikal.ru/i140/1009/20/ae57be5022ec.jpg
I want to make it smaller and add some buttons on the right.
I use this code to add glwidget on the window:
Window::Window() // constructor
{
glWidget = new MyGLWidget;
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addWidget(glWidget);
setLayout(mainLayout);
setWindowTitle(tr("Hello GL"));
}
P.S. Sorry for my English.