Dynamically creating GUIs on the same window
-
I am trying to dynamically instance new GUIs on to the current widget window. I tried doing this:
@QLabel* newLabel = new QLabel("Hello");
newLabel->show()@but that creates a new window with that widget.
Is it possible to dynamically create widgets on the same window?
-
Also, check out QLayout to control how you arrange your new widgets. Use centralWindow->setLayout() first, and then you can dynamically call addWidget() on the layout.
I'd start with "QVBoxLayout":http://qt-project.org/doc/qt-4.8/qvboxlayout.html or "QHBoxLayout":http://qt-project.org/doc/qt-4.8/qhboxlayout.html (vertical or horizontal boxes), and move on to more advanced layouts after that.