Home > database >  I have 4 nested ListViews where the outer one does not change view, while the currentIndex is change
I have 4 nested ListViews where the outer one does not change view, while the currentIndex is change

Time:02-11

Following the answer in the link how to implement nested listmodels in qml I have managed to make nested listviews with nested listmodels. The project is a calendar and is consisting of 4 listviews, "year", "month", "day" and "hour".These listviews are connected with a Calendar{} so I can get selected Date() and display it in the listviews.The problem is that the "day" and "month" are changing accordingly the selected Date() but "year" stays freezed.

Full code is in below link https://gist.github.com/cgiannakidis70/b95cfcf21376b5896967d9a00d8d3dbf

How can I make "year" listview change view accordingly with the others when i change the selected Date() in Calendar{}. Any help will be appreciated because I am stucked with it for days and I can not find the reason.

Thanks in advance.

CodePudding user response:

The problem was currentIndex of year ListView.I had to express it like this: currentIndex:calendarMonth.selectedDate.getFullYear()-2022 .Now the ListView's are working perfectly.

  • Related