Add dynamically new item in gridView
-
wrote on 16 Mar 2017, 08:30 last edited by
-
Since you are using the model view frame with GridView, Model and Delegate, just add new element to the model. Grid View will be updated automatically with new delegate. No extra effort!!!!
-
Since you are using the model view frame with GridView, Model and Delegate, just add new element to the model. Grid View will be updated automatically with new delegate. No extra effort!!!!
wrote on 16 Mar 2017, 10:25 last edited by@dheerendra said in Add dynamically new item in gridView:
Since you are using the model view frame with GridView, Model and Delegate, just add new element to the model. Grid View will be updated automatically with new delegate. No extra effort!!!!
Can you show me sample code to add in my "button.onClicked" function to do this ?
-
You can do something like follows in button.onClicked handler.
gridView.model.insert(...) or gridView.model.append(..).
See the ListModel documentation for the insert and/or append documentation. It should help you.
-
You can do something like follows in button.onClicked handler.
gridView.model.insert(...) or gridView.model.append(..).
See the ListModel documentation for the insert and/or append documentation. It should help you.
wrote on 16 Mar 2017, 10:35 last edited by@dheerendra said in Add dynamically new item in gridView:
ListModel
Thanks a lot !
Its work perfectly :) -
Cool. Make the issue to "Solved". It helps others.
1/6