1
votes

I'm trying to put a new customized widget when the user press a button, using layout->addWidget(mywidget) where layout is a QVBoxLayout, but it's not working.

Tried: - Passing this to the widget constructor as parent - Passing the layout pointer as the parent - Passing 0 as the parent - The scrollArea pointer where the customized widget should be in as the parent

None works. When layout->addWidget is called in the constructor it works though.

1
Maybe you can add the part of your code concerned by your problem?Patrice Bernassola

1 Answers

3
votes

Nevermind, just use widget->show() and everything goes fine. Weird, qt should do this by default, no?