PDA

View Full Version : losing the stretch factor when the orientation changes



malaz
11th June 2015, 16:43
i have a splitter and it has one widget and i set the orientaion "Horizonal"
and when in run time i chaged the oriention to "Vertical" and add another widget
i get wrong ratio, it should be 1:1


Main_layout->setOrientation(Qt::Horizontal);
Main_layout->addWidget(buttion1);

by click a button


Main_layout->setOrientation(Qt::Vertical);
Main_layout->addWidget(buttion1);

but if i set at the beginning the orientation vertical, it works
but actually i have another button to split horizontally.
and if i split horizontally it works because in initializing the value is "Horizontal" and it's the same at the other side
if the first value "vertical" and i split vertically it works,but if i split horizontally i lose the right ratio (1,1)