I have the following custom widget:
QBrowserContainer::QBrowserContainer(QWidget *parent) :
QWidget(parent)
{
QPushButton *test= new QPushButton("Test",this);
// ----> layout()->addWidget(test);
}
In Qt creator i promoted a QWidget to QBrowserContainer.
in the commented line i add a widget to the layout but i cannot do this because we don't have yet a layout, is added in setupUI after QBrowserContainer creation. So my question is: is there any event that is triggered when a layout is added to a widget, so i can add the widget to the layout created?
I know that i can create a layout and add the widget like this:
QBrowserContainer::QBrowserContainer(QWidget *parent) :
QWidget(parent)
{
QPushButton *test= new QPushButton("Test",this);
QHBoxLayout* pLayout = new QHBoxLayout(this);
pLayout->addWidget(test);
}
but i want to use the layout created by the designer (created by SetupUI()).
Thanks