Important: Please read the Qt Code of Conduct -

How can i use Widget from Qt designer to add a QWidget inside of it from the code

  • alt text

    QWidget *widget = new QWidget();
    QGridLayout *layout = new QGridLayout(widget);
    layout->addWidget(new QPushButton("My Button", widget));

    How can i add widget inside a Widget from qt designer

  • Lifetime Qt Champion

    Any widget you add in the designer is accessible via

    So if you place your code after setupUI in constructor then
    you can just use it like any normal pointer that you new'd yourself

Log in to reply