PDA

View Full Version : How to remove the border?



P@u1
21st June 2011, 23:23
Hi everyone,

I have a QMainWindow with a menu bar and inside the QMainWindow I have a QGLWidget (actually a derived class).
Before I added the menu bar, the QGLWidget filled up the whole mainWindow.
Now with the menu bar there is a border at all sides, which looks ugly.

How can I remove it?

Santosh Reddy
22nd June 2011, 00:42
I guess you might be setting the QGLWidget as central widget with a layout, then use this

QMainWindow::centralWidget()->layout()->setContentsMargins(0,0,0,0);
make sure you have proper central widget with layout else this will fail.