How to change or detach layout of Widget?(+ or using private function)
-
first, i set the widget's layout,
ui->widget1->setLayout(layout1);
ui->widget2->setLayout(layout2);but i want to change the layout of widget, according to condition.
ui->widget1->setLayout(layout2);
ui->widget2->setLayout(layout1);they send the errormessage "~~already set the layout".
how can i solve this problem?
++
I find QWidget::takeLayout()
but it was private, so i can use this function :(..... plz give me the solution.. -
@p3c0
thanks to your replay :)!!!
i want to just change each layout....:(
i want to just detach the layout from widget, and reuse to another widget..
(if i use your solution, i can reuse layout1, 2... its correct?)
->(if i use your solution, i can't reuse layout1, 2... its correct?)