Results 1 to 1 of 1

Thread: QMainWindow _really_ remove margin

  1. #1
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    7
    Qt products
    Qt4

    Default Re: QMainWindow _really_ remove margin

    I do this in the constructor of a QMainWindow superclass:

    Qt Code:
    1. layout()->setContentsMargins(0, 0, 0, 0);
    2. centralWidget()->layout()->setContentsMargins(0, 0, 0, 0);
    To copy to clipboard, switch view to plain text mode 

    but still some margins remain (about 2 pixels) between the central widget and the main window. How do I remove the margins completely? I am trying to do this as I use QMainWindow as a child of QStackedWidget and don't need the margins.


    Added after 20 minutes:


    It was a QFrame frameShape of a subcontrol that made it appear, as if margins still existed. Thanks!
    Last edited by ugluk; 17th May 2012 at 11:50.

Similar Threads

  1. Remove max,min button on a QMainWindow
    By Krish_ng in forum Qt Programming
    Replies: 9
    Last Post: 3rd August 2012, 13:36
  2. Replies: 3
    Last Post: 19th February 2012, 11:40
  3. Replies: 0
    Last Post: 22nd July 2011, 15:38
  4. Replies: 1
    Last Post: 23rd May 2011, 06:26
  5. How to remove QMainWindow's title and border
    By meraj ansari in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2010, 17:22

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.