Some questions about the Qt designer
-
Hello,
After a long time I'm starting to use Qt again, and in particular I'm going over the Qt Designer, which is the tool that Qt has for facilitating the layout, style and properties of the various widgets, the one you find by clicking on the file with the ".ui" extension.
I was doing some testing when a few questions arose:
1)
Is it possible to dynamically create a series of widgets? Example:
A window with:- button
- input text
you enter a quantity in the input text and when you click the button, a number of widgets are created.
2)
Let's imagine this case: I have a menu with 3 buttons:
"Home"
"Info"
"Other".Depending on which button is clicked, a new section opens in the main window; in each section there is an additional button to return to the section with the 3 buttons.
To do this, I thought of creating groupings (the sections I'm talking about), in these groupings are my widgets, and for each button is associated a function that hides all sections except the one concerned.
I don't know if this approach is the best, and I don't know what the widget for grouping multiple widgets is called.
-
Hello,
After a long time I'm starting to use Qt again, and in particular I'm going over the Qt Designer, which is the tool that Qt has for facilitating the layout, style and properties of the various widgets, the one you find by clicking on the file with the ".ui" extension.
I was doing some testing when a few questions arose:
1)
Is it possible to dynamically create a series of widgets? Example:
A window with:- button
- input text
you enter a quantity in the input text and when you click the button, a number of widgets are created.
2)
Let's imagine this case: I have a menu with 3 buttons:
"Home"
"Info"
"Other".Depending on which button is clicked, a new section opens in the main window; in each section there is an additional button to return to the section with the 3 buttons.
To do this, I thought of creating groupings (the sections I'm talking about), in these groupings are my widgets, and for each button is associated a function that hides all sections except the one concerned.
I don't know if this approach is the best, and I don't know what the widget for grouping multiple widgets is called.
Hi,
@Alby said in Some questions about the Qt designer:
Is it possible to dynamically create a series of widgets?
I don't thing so.
I thought of creating groupings (the sections I'm talking about), in these groupings are my widgets, and for each button is associated a function that hides all sections except the one concerned.
It's called QStackedWidget
-
Hi,
@Alby said in Some questions about the Qt designer:
Is it possible to dynamically create a series of widgets?
I don't thing so.
I thought of creating groupings (the sections I'm talking about), in these groupings are my widgets, and for each button is associated a function that hides all sections except the one concerned.
It's called QStackedWidget
-
Hi,
@Alby said in Some questions about the Qt designer:
Is it possible to dynamically create a series of widgets?
I don't thing so.
I thought of creating groupings (the sections I'm talking about), in these groupings are my widgets, and for each button is associated a function that hides all sections except the one concerned.
It's called QStackedWidget
@mpergand said in Some questions about the Qt designer:
Is it possible to dynamically create a series of widgets?
I don't thing so.
Pardon? @Alby you can dynamically create any widgets at runtime if you wish (e.g. in response to a button being pressed) by just
newing them and attaching them to wherever. The (code generated from the).uifile does this anyway, but is intended only for when all your widgets are pre-designed/added in advance at design-time. -
@mpergand said in Some questions about the Qt designer:
Is it possible to dynamically create a series of widgets?
I don't thing so.
Pardon? @Alby you can dynamically create any widgets at runtime if you wish (e.g. in response to a button being pressed) by just
newing them and attaching them to wherever. The (code generated from the).uifile does this anyway, but is intended only for when all your widgets are pre-designed/added in advance at design-time.