how to refresh the appearance when the listmodel data has changed in a stackview ?
-
how to refresh the appearance when the listmodel data has changed in a stackview ? the page has pushed to a stackview, and the listmodel data is from c++ ,and how about refreshing a upper page ?
thanks -
@hasson
by "re-pushing" you recreate your (List?)View, meaning it itself - without reacting to the signal - fetches the data from the c++ model.The fact that it only does this when recreated means there's either something wrong in the model binding (possibly broken) or your c++ model does not in fact emit the modelChanged signal.
Impossible to tell, until you share some code with us
-
Hi @hasson,
you can try this.
first emit one signal from your c++ class, lets say emit listmodelChanged() each time whenever your listmodel changes and in qml follow the code.
StackView { id:stack } Connection { target:yourCppObject onListmodelChanged: { stack.pop(null) } }
-
how to refresh the appearance when the listmodel data has changed in a stackview ? the page has pushed to a stackview, and the listmodel data is from c++ ,and how about refreshing a upper page ?
thanks@hasson said in how to refresh the appearance when the listmodel data has changed in a stackview ?:
the listmodel data is from c++
What do you mean by that?
What is the type of your model and how do you update it in c++? -
@hasson said in how to refresh the appearance when the listmodel data has changed in a stackview ?:
the listmodel data is from c++
What do you mean by that?
What is the type of your model and how do you update it in c++? -
If you call the
dataChanged
signal and the[begin|end][Insert|Remove]Rows
functions appropriately, it should work out of the box. -
If you call the
dataChanged
signal and the[begin|end][Insert|Remove]Rows
functions appropriately, it should work out of the box.