PDA

View Full Version : add qml item dynamically on btn click



jfinn88
6th October 2016, 02:12
I want to added check boxes to a dialog on a button click but not sure how to get started. either a function in qml or c++ to add a check-box item to a dialog....

any ideas?

anda_skoa
6th October 2016, 17:06
Depends a bit on what you need, but likely by using a model that has the label and the state of the checkbox and provides methods for changing the state.
Then using that model as the input for a Repeater (http://doc.qt.io/qt-5/qml-qtquick-repeater.html) or ListView.

Cheers,
_