Results 1 to 6 of 6

Thread: QHBoxLayout Problem

  1. #1
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QHBoxLayout Problem

    QWidget *window = new QWidget;
    QPushButton *button1 = new QPushButton("One");
    QPushButton *button2 = new QPushButton("Two");

    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(button1);
    layout->addWidget(button2);


    Can some body explain how to specify space between each widgets that are added to QHBoxLayout?

    Thanks in advance,
    Seema Rao

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

  3. #3
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QHBoxLayout Problem

    addSpacing adds space at the end of the layout
    setSpacing adds space between widgets inside the layout

  4. #4
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1

    Default Re: QHBoxLayout Problem

    May be Qt should have a FormLayout like SWT

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QHBoxLayout Problem

    You mean something like the Border Layout Example?
    J-P Nurmi

  6. #6
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1

    Default Re: QHBoxLayout Problem

    Yes, BorderLayout is simple and easy to use. But I also want a FormLayout which is more flexibility. If you have used Java/Eclipse/SWT, you will know the FormLayout. And I think the BorderLayout and FormLayout should be part of the Qt library but not supplied in the example.

Similar Threads

  1. Problem with QHBoxlayout & QVBoxlayout
    By phillip_Qt in forum Qt Tools
    Replies: 5
    Last Post: 13th January 2009, 10:26
  2. QVBoxLayout and QHBoxLayout problem
    By fmariusd in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2009, 20:58
  3. QHBoxlayout Size problem
    By Spitz in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2008, 21:09
  4. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  5. Replies: 2
    Last Post: 19th May 2007, 18:25

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.