10-01-2012 03:46 AM
Hello
I want make a SegmentedControl in a ListView, and load one dataModel or other. That dataModel are in sql, no xml. It works in separated ListView and in separated qml, but in the same ListView?
How I can do that?
Thank you
10-02-2012 07:27 AM
Solved for myself, Im sure this is not the "best" way for do it, but it works on me.
I created a variable
property variant _data
In the SelectValueChanged of SegmentedControl
onSelectedValueChanged: {
if (selectedValue == 1) {
_data = _model01;
}
if (selectedValue == 2) {
_data = _model02;
}
if (selectedValue == 3) {
_data = _model03;
}
}and in the dataModel in my ListView
dataModel: _data
If anyone know another way i'll be glad to know it.
Thank you