Results 1 to 2 of 2

Thread: How to remove the border?

  1. #1
    Join Date
    Jun 2011
    Posts
    38
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default How to remove the border?

    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?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to remove the border?

    I guess you might be setting the QGLWidget as central widget with a layout, then use this
    Qt Code:
    1. QMainWindow::centralWidget()->layout()->setContentsMargins(0,0,0,0);
    To copy to clipboard, switch view to plain text mode 
    make sure you have proper central widget with layout else this will fail.

  3. The following user says thank you to Santosh Reddy for this useful post:

    P@u1 (22nd June 2011)

Similar Threads

  1. Replies: 2
    Last Post: 21st March 2012, 15:30
  2. Replies: 3
    Last Post: 4th May 2011, 15:29
  3. How to remove QMainWindow's title and border
    By meraj ansari in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2010, 18:22
  4. Replies: 0
    Last Post: 13th February 2009, 09:26
  5. Remove Widget Border?
    By winston2020 in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2008, 06:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.