| qdeclarativecategory.cpp |
!
\qmltype Category
\nativetype QDeclarativeCategory
\inqmlmodule QtLocation
\ingroup qml-QtLocation5-places
\ingroup qml-QtLocation5-places-data
\since QtLocation 5.5
\brief The Category type represents a category that a \l Place can be associated with.
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 \l CategoryModel. The
\l PlaceSearchModel has a \l {PlaceSearchModel::categories}{categories} property that is used
to limit the search results to places with the specified categories.
If the \l 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 \l save() method.
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml Category
\dots 0
\snippet declarative/places.qml Category save
To remove a category ensure that the \l plugin and categoryId properties are set and call the
\l remove() method.
\sa CategoryModel
|
11641 |
- |
| qdeclarativecategory_p.h |
|
3633 |
- |
| qdeclarativecontactdetails.cpp |
!
\qmltype ContactDetails
\nativetype QDeclarativeContactDetails
\inqmlmodule QtLocation
\ingroup qml-QtLocation5-places
\ingroup qml-QtLocation5-places-data
\since QtLocation 5.5
\brief The ContactDetails type holds contact details for a \l Place.
The ContactDetails type is a map of \l contactDetail objects.
To access contact details in the map use the \l keys() method to get the list of keys stored in
the map and then use the \c {[]} operator to access the \l contactDetail items.
The following keys are defined in the API. \l Plugin implementations are free to define
additional keys.
\list
\li phone
\li fax
\li email
\li website
\endlist
ContactDetails instances are only ever used in the context of \l {Place}{Places}. It is not possible
to create a ContactDetails instance directly or re-assign ContactDetails instances to \l {Place}{Places}.
Modification of ContactDetails can only be accomplished via Javascript.
\section1 Examples
The following example shows how to access all \l {contactDetail}{contact details}
and print them to the console:
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml ContactDetails read
The returned list of contact details is an \l {QObjectList-based model}{object list} and so can be used directly as a data model. For example, the
following demonstrates how to display a list of contact phone numbers in a list view:
\snippet declarative/places.qml QtQuick import
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml ContactDetails phoneList
The following example demonstrates how to assign a single phone number to a place in JavaScript:
\snippet declarative/places.qml ContactDetails write single
The following demonstrates how to assign multiple phone numbers to a place in JavaScript:
\snippet declarative/places.qml ContactDetails write multiple
|
2882 |
- |
| qdeclarativecontactdetails_p.h |
|
1243 |
- |
| qdeclarativeplace.cpp |
|
37099 |
- |
| qdeclarativeplace_p.h |
|
8269 |
- |
| qdeclarativeplacecontentmodel.cpp |
!
\qmltype EditorialModel
\inqmlmodule QtLocation
\ingroup qml-QtLocation5-places
\ingroup qml-QtLocation5-places-models
\since QtLocation 5.5
\brief The EditorialModel type provides a model of place editorials.
The EditorialModel is a read-only model used to fetch editorials related to a \l Place.
Binding a \l Place via \l EditorialModel::place initiates an initial fetch of editorials.
The model performs fetches incrementally and is intended to be used in conjunction
with a View such as a \l ListView. When the View reaches the last of the editorials
currently in the model, a fetch is performed to retrieve more if they are available.
The View is automatically updated as the editorials are received. The number of
editorials which are fetched at a time is specified by the
\l {EditorialModel::}{batchSize} property. The total number of editorials available can be
accessed via the \l {EditorialModel::}{totalCount} property.
The model returns data for the following roles:
\table
\header
\li Role
\li Type
\li Description
\row
\li supplier
\li \l supplier
\li The supplier of the content.
\row
\li user
\li \l user
\li The user who contributed the content.
\row
\li attribution
\li string
\li Attribution text which must be displayed when displaying the content.
\row
\li url
\li url
\li The URL of the image.
\row
\li imageId
\li string
\li The identifier of the image.
\row
\li mimeType
\li string
\li The MIME type of the image.
\row
\li text
\li string
\li The editorial's textual description of the place. It can be either rich (HTML based) text or plain text
depending upon the provider.
\row
\li title
\li string
\li The title of the editorial.
\row
\li language
\li string
\li The language that the editorial is written in.
\row
\li dateTime
\li datetime
\li The date and time that the review was posted.
\row
\li text
\li string
\li The review's textual description of the place. It can be either rich (HTML based) text or plain text
depending on the provider.
\row
\li language
\li string
\li The language that the review is written in.
\row
\li rating
\li real
\li The rating that the reviewer gave to the place.
\row
\li reviewId
\li string
\li The identifier of the review.
\row
\li title
\li string
\li The title of the review.
\endtable
\section1 Example
The following example shows how to display editorials for a place:
\snippet declarative/places.qml QtQuick import
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml EditorialModel
|
16322 |
- |
| qdeclarativeplacecontentmodel_p.h |
|
4245 |
- |
| qdeclarativesearchmodelbase.cpp |
!
\internal
|
8259 |
- |
| qdeclarativesearchmodelbase_p.h |
|
3709 |
- |
| qdeclarativesearchresultmodel.cpp |
|
33489 |
- |
| qdeclarativesearchresultmodel_p.h |
|
5980 |
- |
| qdeclarativesearchsuggestionmodel.cpp |
!
\qmltype PlaceSearchSuggestionModel
\nativetype QDeclarativeSearchSuggestionModel
\inqmlmodule QtLocation
\ingroup qml-QtLocation5-places
\ingroup qml-QtLocation5-places-models
\since QtLocation 5.5
\brief Provides access to search term suggestions.
The PlaceSearchSuggestionModel can be used to provide search term suggestions as the user enters their
search term. The properties of this model should match that of the \l PlaceSearchModel, which
will be used to perform the actual search query, to ensure that the search suggestion results are
relevant.
There are two ways of accessing the data provided by this model, either through the
\l suggestions property or through views and delegates. The latter is the preferred
method.
The \l offset and \l limit properties can be used to access paged suggestions. When the
\l offset and \l limit properties are set the suggestions between \l offset and
(\l offset + \l limit - 1) will be returned. Support for paging may vary
from plugin to plugin.
The model returns data for the following roles:
\table
\header
\li Role
\li Type
\li Description
\row
\li suggestion
\li string
\li Suggested search term.
\endtable
The following example shows how to use the PlaceSearchSuggestionModel to get suggested search terms
from a partial search term. The \l searchArea is set to match what would be used to perform the
actual place search with \l PlaceSearchModel.
\snippet declarative/places.qml QtQuick import
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml SearchSuggestionModel
\sa PlaceSearchModel, {QPlaceManager}
|
9314 |
- |
| qdeclarativesearchsuggestionmodel_p.h |
|
2033 |
- |
| qdeclarativesupportedcategoriesmodel.cpp |
!
\qmltype CategoryModel
\nativetype QDeclarativeSupportedCategoriesModel
\inqmlmodule QtLocation
\ingroup qml-QtLocation5-places
\ingroup qml-QtLocation5-places-models
\since QtLocation 5.5
\brief The CategoryModel type provides a model of the categories supported by a \l Plugin.
The CategoryModel type provides a model of the categories that are available from the
current \l Plugin. The model supports both a flat list of categories and a hierarchical tree
representing category groupings. This can be controlled by the \l hierarchical property.
The model supports the following roles:
\table
\header
\li Role
\li Type
\li Description
\row
\li category
\li \l Category
\li Category object for the current item.
\row
\li parentCategory
\li \l Category
\li Parent category object for the current item.
If there is no parent, null is returned.
\endtable
The following example displays a flat list of all available categories:
\snippet declarative/places.qml QtQuick import
\snippet declarative/maps.qml QtLocation import
\codeline
\snippet declarative/places.qml CategoryView
To access the hierarchical category model it is necessary to use a \l DelegateModel to access
the child items.
|
21004 |
- |
| qdeclarativesupportedcategoriesmodel_p.h |
|
4121 |
- |