Hello everyone,
imagine that i have something like this in a class
Qt Code:
  1. //...
  2. private:
  3. 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:
Qt Code:
  1. QPushButton *btn = new QPushButton("Hello");
  2. 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?