Search code examples
qtqmlqabstractlistmodel

Qt Display states according to country selected using models in qml


I want to display 2 listmodels. One is a list of countries and other one is the states in the selected country. What is the best way to do this. Iam using qml for the ui. All the data must be fetched from cpp and passed to qml.

My usecase is not exactly the same. But similar to this. Display another list corresponding to the data selected on another list.


Solution

  • I could solve this using QAbstractListModel. It was the same use case i required. Always welcome if there is any better method than this. Attaching the link of a trial project here.

    https://github.com/igokul95/country_state_city_selection