Hello everyone,
imagine that i have something like this in a class
//...
private:
//...
private:
QWidget *widget;
To copy to clipboard, switch view to plain text mode
and in one of the public functions i want to add other widgets like maybe a QPushButton and a QVBoxLayout. How can i do that?
For the QPushButton i tried it this way:
widget->layout()->addWidget(btn);
QPushButton *btn = new QPushButton("Hello");
widget->layout()->addWidget(btn);
To copy to clipboard, switch view to plain text mode
But the widget has currently no layout, so i cannot try it out...
Is it possible to do it this way, and how can i apply a layout to the widget?
Bookmarks