N
N
Nikita Lubchich2013-12-17 00:19:29
Qt
Nikita Lubchich, 2013-12-17 00:19:29

How to clone widget groups?

I'm trying to find information on how to clone widgets on a form by copying them to a new line when the button is clicked. They suggested that somehow it can be done through the layout, but they did not say how. :(
Here is an example set of widgets.
dda4e045cfca.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tugo, 2013-12-18
@Cybran

In your project, you need to create a widget class (Add New->Qt->Qt Designer Form Class).
In the .ui file, draw what you have in the red frame. In the .cpp and .h file, implement the logic of the widget.
By clicking on + create an object of your widget and place it where necessary.
You can work with such a widget like with any built-in widget, such as QPushButton.
The only thing is that it will not be available in the Designer, you will have to create and place it manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question