Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想显示 2 个列表模型。一个是国家列表,另一个是所选国家/地区的州。做这个的最好方式是什么。我正在为 ui 使用 qml。所有数据都必须从 cpp 获取并传递给 qml。
我的用例并不完全相同。但与此类似。显示与在另一个列表中选择的数据相对应的另一个列表。
我可以使用QAbstractListModel. 这是我需要的相同用例。如果有比这更好的方法,总是欢迎。在此处附上一个试验项目的链接。
QAbstractListModel
https://github.com/igokul95/country_state_city_selection