Category QML Type
The Category type represents a category that a Place can be associated with. More...
Import Statement: | import QtLocation 5.3 |
Since: | Qt Location 5.0 |
Properties
- category : QPlaceCategory
- categoryId : string
- icon : PlaceIcon
- name : string
- plugin : Plugin
- status : enumeration
- visibility : enumeration
Methods
- string errorString()
- void remove()
- void save()
Detailed Description
Categories are used to search for places based on the categories they are associated with. The list of available categories can be obtained from the CategoryModel. The PlaceSearchModel has a categories property that is used to limit the search results to places with the specified categories.
If the Plugin supports it, categories can be created or removed. To create a new category construct a new Category object and set its properties, then invoke the save() method.
import QtPositioning 5.2 import QtLocation 5.3 Category { id: category plugin: myPlugin name: "New Category" visibility: Category.PrivateVisibility } ... category.save();
To remove a category ensure that the plugin and categoryId properties are set and call the remove() method.
See also CategoryModel.
Property Documentation
category : QPlaceCategory |
For details on how to use this property to interface between C++ and QML see "Interfaces between C++ and QML Code".
This property holds the identifier of the category. The categoryId is a string which uniquely identifies this category within the categories plugin.
This property holds the image source associated with the category. To display the icon you can use the Image type.
plugin : Plugin |
This property holds the location based service to which the category belongs.
This property holds the status of the category. It can be one of:
Category.Ready | No error occurred during the last operation, further operations may be performed on the category. |
Category.Saving | The category is currently being saved, no other operations may be performed until the current operation completes. |
Category.Removing | The category is currently being removed, no other operations can be performed until the current operation completes. |
Category.Error | An error occurred during the last operation, further operations can still be performed on the category. |
This property holds the visibility of the category. It can be one of:
Category.UnspecifiedVisibility | The visibility of the category is unspecified. If saving a category, the plugin will automatically set a default visibility to the category saved in the backend. This default is dependent on the plugin implementation. |
Category.DeviceVisibility | The category is limited to the current device. The category will not be transferred off of the device. |
Category.PrivateVisibility | The category is private to the current user. The category may be transferred to an online service but is only ever visible to the current user. |
Category.PublicVisibility | The category is public. |
Note that visibility does not affect how Places associated with the category are displayed in the user-interface of an application on the device. Instead, it defines the sharing semantics of the category.
Method Documentation
Returns a string description of the error of the last operation. If the last operation completed successfully then the string is empty.
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.