PDA

View Full Version : How to fill a QFrame space in QSplitter layout



henryjoye
12th October 2010, 02:14
Hi all,
I use QSplitter to layout my window. I firstly create window components in a ui file and then use QSplitter in the program to layout it.

I use a QFrame as the container in the ui file. In my cpp program, my derived QGLWidget uses QFrame as the parent to fill it. QFrame works fine when I move the splitter handle. However, even if I setStretchFactor for QFrame and QGLWidget, my derived QGLWidget always cannot stretch to fill the QFrame. In fact, the derived QGLWidget does not stretch at all. Does anyone show me how to solve this problem? Thank you very much!

J.

tbscope
12th October 2010, 04:42
Are you looking for:
http://doc.qt.nokia.com/4.7/qwidget.html#setContentsMargins
?

henryjoye
12th October 2010, 05:18
Thank you very much! This still does not work.

It is like that, if I donot use QFrame in ui file as the parent of my QGLWidget, but use the splitter as the parent, it then works. But I need to get the location of the QGLWidget in the overall window and have to use QFrame. Any more ideas? Thank you very much!