The LandmarkCategoryModel element provides access to categories. More...
Inherits LandmarkAbstractModel
This element was introduced in Mobility 1.2.
This 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) } Coordinate { id: initCoordinate latitude: -27.5 longitude: 153 } 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.
read-onlycategories : QDeclarativeListProperty |
This 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); } } }
This property group was introduced in Mobility 1.2.
landmark : Landmark |
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.
This property group was introduced in Mobility 1.2.
© 2008-2011 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
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.