QML LandmarkCategoryModel ElementThe LandmarkCategoryModel element provides access to categories. More... Inherits LandmarkAbstractModel Properties
Detailed DescriptionThis element is part of the QtMobility.location 1.1 module. LandmarkCategoryModel provides a model of categories from the categories store. The contents of the model can be specified with landmark, and sorted via the LandmarkAbstractModel::sortBy and LandmarkAbstractModel::sortOrder properties. Whether the model is automatically updated when the store or landmark changes, can be controlled with LandmarkAbstractModel::autoUpdate property. There are two ways of accessing the category data: via model by using views and delegates, or alternatively via categories list property. Of the two, the model access is preferred. Direct list access (i.e. non-model) is not guaranteed to be in order set by sortBy and sortOrder. At the moment only data role provided by the model is category. Through that one can access any data provided by the LandmarkCategory element. LandmarkCategoryModel { id: landmarkCategoryModel autoUpdate: true onModelChanged: console.log("Category model changed, category count: " + count) } Component { id: landmarkCategoryListDelegate Item { width: 200; height: 50 Text { color: "white"; font.bold: true; style: Text.Raised; styleColor: "black" id: nameField; text: category.name } } } See also LandmarkAbstractModel, LandmarkModel, and QLandmarkManager. Property DocumentationThis element holds the list of LandmarkCategory elements that the model currently has. Accessing categories by iterating over this list is not guaranteed to be in the order set by LandmarkAbstractModel::sortBy or LandmarkAbstractModel::sortOrder LandmarkCategoryModel { id: categoriesOfGivenLandmark autoUpdate: false onCategoriesChanged: { console.log("log: Categories count is: "+ count); for (var index = 0; index < categories.length; index++) { console.log("Index, name:" + index + " , " + categories[index].name); } } } Landmark whose categories the model should represent. Note that the landmark needs to be from LandmarkModel because its internal category identifiers need to be set.
© 2008-2010 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. Privacy Policy X
|