Results 1 to 2 of 2

Thread: Layout without margin??

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Prague
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Layout without margin??

    Hi,

    when I wrote following simple code:

    Qt Code:
    1. QPushButton button("Button");
    2. button.show();
    To copy to clipboard, switch view to plain text mode 

    it creates me window with button without any margins around.

    But when I want to create window with two buttons, so I wrote following code:

    Qt Code:
    1. QWidget mainwindow;
    2. QHBoxLayout layout;
    3. QPushButton button1("Button A");
    4. QPushButton button2("Button B");
    5. layout.addWidget(&button1);
    6. layout.addWidget(&button2);
    7. mainwindow.setLayout(&layout);
    8. mainwindow.show();
    To copy to clipboard, switch view to plain text mode 

    But it creates me margin around both buttons and I really dont want it at all.
    Last edited by jpn; 2nd August 2008 at 09:54. Reason: missing [code] tags

Similar Threads

  1. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  2. Replies: 2
    Last Post: 9th July 2008, 22:28
  3. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  4. Resizing problems when applying a layout
    By JimBrown in forum Newbie
    Replies: 1
    Last Post: 21st February 2007, 22:54
  5. "dynamic" layout
    By hulk in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2006, 07:16

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
  •  
Qt is a trademark of The Qt Company.