PDA

View Full Version : Problem with layout!



sang
24th August 2010, 21:20
QHBoxLayout *layout = new QHBoxLayout( this );
QWidget *newTab = new QWidget( this );
newTab->setLayout( layout );

QRadioButton *aCOption_ = new QRadioButton( "Button 1", this );
QRadioButton *aWOption_ = new QRadioButton( "Button 2", this );
QRadioButton *aBOption_ = new QRadioButton( "Button 3", this );

layout->addWidget( aCOption_ );
layout->addWidget( aWOption_ );
layout->addWidget( aBOption_ );
layout->addStretch();

tabWidget->addTab( newTab, ( "New tab" ) );

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

Lykurg
24th August 2010, 21:32
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.

sang
24th August 2010, 22:01
Oh thanks!
;)