Results 1 to 3 of 3

Thread: Problem with layout!

  1. #1
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with layout!

    Qt Code:
    1. QHBoxLayout *layout = new QHBoxLayout( this );
    2. QWidget *newTab = new QWidget( this );
    3. newTab->setLayout( layout );
    4.  
    5. QRadioButton *aCOption_ = new QRadioButton( "Button 1", this );
    6. QRadioButton *aWOption_ = new QRadioButton( "Button 2", this );
    7. QRadioButton *aBOption_ = new QRadioButton( "Button 3", this );
    8.  
    9. layout->addWidget( aCOption_ );
    10. layout->addWidget( aWOption_ );
    11. layout->addWidget( aBOption_ );
    12. layout->addStretch();
    13.  
    14. tabWidget->addTab( newTab, ( "New tab" ) );
    To copy to clipboard, switch view to plain text mode 

    Error is that it puts the buttons on one line, but would require that the buttons would be on a separate line

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem with layout!

    Quote Originally Posted by sang View Post
    Error is that it puts the buttons on one line, but would require that the buttons would be on a separate line
    ...then you probably should use QVBoxLayout.

  3. #3
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with layout!

    Oh thanks!

Similar Threads

  1. Problem with layout
    By franco.amato in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2009, 19:32
  2. QT Layout problem
    By bod in forum Qt Programming
    Replies: 8
    Last Post: 1st July 2008, 13:50
  3. QT Layout problem
    By bod in forum Qt Programming
    Replies: 1
    Last Post: 1st July 2008, 13:29
  4. Layout Problem
    By sabonis in forum Qt Tools
    Replies: 4
    Last Post: 3rd March 2008, 20:57
  5. Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 4
    Last Post: 19th April 2006, 11:08

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.