PDA

View Full Version : QGLWidget questions.



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.

tbscope
28th September 2010, 07:58
Use layouts.
You already use one.

Rebekka
28th September 2010, 09:26
Use layouts.
You already use one.

Thanks for the right direction to search :)

http://s55.radikal.ru/i147/1009/f3/11f5f1365717.jpg