I want to do a list that changes it's fields numbers when the user changes a the value of a spinbox. Something like this:
First 5 fields by default
Then just 1 field for example
And if the user wants to change it again, he can put 5 fields again.
I made a GridLayout and a couple of QList, one for the Labels and the other one for LineEdits. I did this:
I create a basic case (with just 1 field) and i later add more on excecution time adding Widgets to the GridLayout by:
gridLayout->addWidget(labels.at(x), 0, 1)
where labels is the QList. it works fine to add widgets but i can't remove and add again.
i tried using
gridLayout->removeWidget(lables.at(x), 0, 1)
labels.at(x)->hide()
label.at(x)->setVisible(false)
all works but i can't show it again with none of this:
gridLayout->addWidget(labels.at(x), 0, 1)
labels.at(x)->show()
label.at(x)->setVisible(true)