Editing a QFrame using QtDesigner
-
Hello.
I have a system of scenes and for each scene I would like to have my own set of buttons and other things.Now I create a separate QFrame and consistently add the necessary widgets from the code of a specific scene.
I would like to be able to create separate forms that will relate to my QFrame and load them as needed.
How can I do this? -
Hi,
Do you mean have several "scenes" and be able to switch between them like with a QStackedWidget ?
-
@SGaist,
OK, if I'm going to use QStackedWidget, can I create a separate widget using QtDesigner?I want to create my own widget in QtDesigner for each scene and load them when compiling, then just switch them using QStackedWidget. Is this correct?
-
@mrjbom said in Editing a QFrame using QtDesigner:
load them when compiling
Not sure what you mean here. Nothing gets "loaded" while compiling.
You can design each of your widgets as separate
.ui
files from Designer. These will result in separate classes in C++ code, from theuic
run on the.ui
files.It is then up to you when these get created/instantiated at run time. You can create them dynamically, when wanted, via
new MyWiget1()
. And you can then insert each of these into aQStackedWidget
via itsaddWidget(QWidget *widget)
method. You show any one them at a given time viaQStackedWidget::setCurrentWidget(QWidget *widget)
.Does that answer what you are seeking to do?