diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-08 16:01:11 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-08 16:01:11 +0100 |
commit | b29d6b416af7ea2cd47ec72af1e083d91583db95 (patch) | |
tree | 80b46620cc1e5ee467fb90f94bfcee77a86451e1 /src | |
parent | d21ed648f2958efaab9a041b2cd2607f4676be59 (diff) | |
parent | 8dabd241c2d7ac095cfe7be847397a288158f004 (diff) | |
download | qtlocation-b29d6b416af7ea2cd47ec72af1e083d91583db95.tar.gz |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I18bb1c341e7d87cd1d649f2c3fc9c50141c6a1a9
Diffstat (limited to 'src')
50 files changed, 88 insertions, 1075 deletions
diff --git a/src/imports/location/qquickgeomapgesturearea.cpp b/src/imports/location/qquickgeomapgesturearea.cpp index f324d10e..629c9658 100644 --- a/src/imports/location/qquickgeomapgesturearea.cpp +++ b/src/imports/location/qquickgeomapgesturearea.cpp @@ -393,9 +393,9 @@ void QQuickGeoMapGestureArea::setAcceptedGestures(AcceptedGestures acceptedGestu return; m_acceptedGestures = acceptedGestures; - setPanEnabled(acceptedGestures & GeoMapGesture::PanGesture); - setFlickEnabled(acceptedGestures & GeoMapGesture::FlickGesture); - setPinchEnabled(acceptedGestures & GeoMapGesture::PinchGesture); + setPanEnabled(acceptedGestures & PanGesture); + setFlickEnabled(acceptedGestures & FlickGesture); + setPinchEnabled(acceptedGestures & PinchGesture); emit acceptedGesturesChanged(); } @@ -434,9 +434,9 @@ void QQuickGeoMapGestureArea::setEnabled(bool enabled) m_enabled = enabled; if (enabled) { - setPanEnabled(m_acceptedGestures & GeoMapGesture::PanGesture); - setFlickEnabled(m_acceptedGestures & GeoMapGesture::FlickGesture); - setPinchEnabled(m_acceptedGestures & GeoMapGesture::PinchGesture); + setPanEnabled(m_acceptedGestures & PanGesture); + setFlickEnabled(m_acceptedGestures & FlickGesture); + setPinchEnabled(m_acceptedGestures & PinchGesture); } else { setPanEnabled(false); setFlickEnabled(false); diff --git a/src/location/doc/images/example-mapviewer.png b/src/location/doc/images/example-mapviewer.png Binary files differdeleted file mode 100644 index 4dc13f72..00000000 --- a/src/location/doc/images/example-mapviewer.png +++ /dev/null diff --git a/src/location/doc/images/example-places.png b/src/location/doc/images/example-places.png Binary files differdeleted file mode 100644 index 0b1ac8b7..00000000 --- a/src/location/doc/images/example-places.png +++ /dev/null diff --git a/src/location/doc/images/places-list.png b/src/location/doc/images/places-list.png Binary files differdeleted file mode 100644 index bf09a031..00000000 --- a/src/location/doc/images/places-list.png +++ /dev/null diff --git a/src/location/doc/images/places-map.jpg b/src/location/doc/images/places-map.jpg Binary files differdeleted file mode 100644 index b5f2e35b..00000000 --- a/src/location/doc/images/places-map.jpg +++ /dev/null diff --git a/src/location/doc/images/places-map.png b/src/location/doc/images/places-map.png Binary files differdeleted file mode 100644 index 4982df23..00000000 --- a/src/location/doc/images/places-map.png +++ /dev/null diff --git a/src/location/doc/images/planespotter.jpg b/src/location/doc/images/planespotter.jpg Binary files differdeleted file mode 100644 index d65a0328..00000000 --- a/src/location/doc/images/planespotter.jpg +++ /dev/null diff --git a/src/location/doc/src/examples/example-parameters.qdocinc b/src/location/doc/src/example-parameters.qdocinc index 2ae351ba..2ae351ba 100644 --- a/src/location/doc/src/examples/example-parameters.qdocinc +++ b/src/location/doc/src/example-parameters.qdocinc diff --git a/src/location/doc/src/examples/declarative-mapviewer.qdoc b/src/location/doc/src/examples/declarative-mapviewer.qdoc deleted file mode 100644 index 8ba48112..00000000 --- a/src/location/doc/src/examples/declarative-mapviewer.qdoc +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example mapviewer - \title Map Viewer (QML) - \ingroup qtlocation-examples - - \brief The Map Viewer example shows how to display and interact with a map, - search for an address, and find driving directions. - - \image example-mapviewer.png - - This is a large example covering many basic uses of maps, positioning, and - navigation services in Qt Location. This page is divided into sections - covering each of these areas of functionality with snippets from the code. - - \include examples-run.qdocinc - - \include example-parameters.qdocinc - - \section1 Overview - - QML types shown in this example: - - \list - \li Displaying a map - \list - \li \l{QtLocation::Map}{Map} - \li \l{QtLocation::MapGestureArea}{MapGestureArea} - \li \l[QML]{Coordinate} - \endlist - \li Finding an address - \list - \li \l{QtLocation::GeocodeModel}{GeocodeModel} - \li \l{QtLocation::MapItemView}{MapItemView} - \li \l{QtLocation::MapCircle}{MapCircle} - \endlist - \li Directions and travel routes - \list - \li \l{QtLocation::RouteModel}{RouteModel} - \li \l{QtLocation::MapRoute}{MapRoute} - \endlist - \endlist - - \section1 Displaying a Map - - Drawing a map on-screen is accomplished using the Map type, as shown - below. - - \snippet mapviewer/map/MapComponent.qml top - \snippet mapviewer/map/MapComponent.qml coord - \snippet mapviewer/map/MapComponent.qml end - - In this example, we give the map an initial center \l [QML]{Coordinate}{coordinate} - with a set latitude and longitude. We also set the initial zoom level to 50% (halfway between - the maximum and minimum). - - \section1 Finding an Address (Geocoding) - - To locate a certain address or place on the map uses a process called - geocoding. In order to perform a geocode operation, we first need to adjust - our Map object to be able to receive the result. - - Receiving results of geocoding is done through a GeocodeModel: - - \snippet mapviewer/map/MapComponent.qml geocodemodel0 - - To display the contents of the GeocodeModel we use a MapItemView: - - \snippet mapviewer/map/MapComponent.qml geocodeview - - MapItemView uses an object called a "delegate" to act as a template for the - items it creates. This can contain any map object desired, but in this case - we show a MapCircle: - - \snippet mapviewer/map/MapComponent.qml pointdel0 - \snippet mapviewer/map/MapComponent.qml pointdel1 - - With these three objects, we have enough to receive Geocode responses and - display them on our Map. The final piece is to send the actual Geocode - request. - - To send a geocode request, first we create an \l [QML]{Address} object, and fill it - in with the desired parameters. - - \snippet mapviewer/mapviewer.qml geocode0 - - Then we set "geocodeModel.query" to the filled in \l [QML]{Address}, - and call update() on the GeocodeModel. - - \snippet mapviewer/map/MapComponent.qml geocode1 - - \section1 Directions and Travel Routes - - Similar to the GeocodeModel, Qt Location also features the RouteModel type, - which allows information about routes (for example driving directions) between two - or more points, to be received and used with a Map. - - Here again, we instantiate the RouteModel as a property of our Map: - - \snippet mapviewer/map/MapComponent.qml routemodel0 - - To display the contents of a model to the user, we need a view. Once again - we will use a MapItemView, to display the Routes as objects on the Map: - - \snippet mapviewer/map/MapComponent.qml routeview0 - \snippet mapviewer/map/MapComponent.qml routeview1 - - To act as a template for the objects we wish the view to create, we create - a delegate component: - - \snippet mapviewer/map/MapComponent.qml routedelegate0 - \snippet mapviewer/map/MapComponent.qml routedelegate1 - - With the model, view and delegate now complete, the only missing component - is some kind of control over the model to begin the Route request process. - In the simplest case, we can fill out a Route request using two already - available \l [QML]{Coordinate}{coordinates}: - - \snippet mapviewer/mapviewer.qml routecoordinate - - In the next snippet, we show how to set up the request object and instruct - the model to update. We also instruct the map to center on the start - coordinate for our routing request. - - \snippet mapviewer/map/MapComponent.qml routerequest0 - \snippet mapviewer/map/MapComponent.qml routerequest1 - \snippet mapviewer/map/MapComponent.qml routerequest2 - - This is all that is required to display a Route on the Map. However, it is - also useful to be able to retrieve the written directions and explanation - of the travel route. In the example, these are displayed in a \l {ListView} element. - To create this content, we use a standard \l {Models and Views in Qt Quick#ListModel}{ListModel} and - \l {ListView} pair. The data in the \l {Models and Views in Qt Quick#ListModel}{ListModel} is - built from the routeModel's output: - - \snippet mapviewer/forms/RouteList.qml routeinfomodel0 - \snippet mapviewer/forms/RouteList.qml routeinfomodel1 - \snippet mapviewer/forms/RouteList.qml routeinfomodel3 - - Inside the RouteModel, as you can see above, we add an - \l{QtLocation::RouteModel::status}{onStatusChanged} handler, which - calls the \c{showRouteList()} which updates the \c{routeInfoModel}: - - \snippet mapviewer/forms/RouteList.qml routeinfomodel2 -*/ diff --git a/src/location/doc/src/examples/declarative-places.qdoc b/src/location/doc/src/examples/declarative-places.qdoc deleted file mode 100644 index 414ccfca..00000000 --- a/src/location/doc/src/examples/declarative-places.qdoc +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example places - \title Places (QML) - \ingroup qtlocation-examples - - \brief The Places example demonstrates how to search for Places and access - related content. - - \image example-places.png - - The Places example demonstrates how to search for Places. In particular it shows - how further information such as reviews, images and related content can be retrieved. - - \include examples-run.qdocinc - - \include example-parameters.qdocinc - - \section1 Overview - - The Places example presents an application window displaying a map. At the top of the window - is a search box, which is used to enter a place search query. To search for a place enter a - search term into the text box and click the magnifying glass icon. To search for a place by - category, click the category icon to display the list of available categories and select the - desired category. The place search query will be for places that are near the current location - shown on the map. - - For some plugins like \l {Qt Location HERE Plugin} the search box provides search term - suggestions when three or more characters are entered. Selecting one of the suggestions will - cause a place search to be performed with the selected search text. - - Clicking on a search result will display details about the place. If a places has rich content - (editorials, reviews and images), these can be accessed by the buttons on the details page. - To find similar places click the "Find similar" button. - - The geo service provider can be changed by accessing the "Provider" menu. - - \section1 Displaying Categories - - Before search by category can be performed, the list of available categories needs to be - retrieved. This is achieved by creating a \l CategoryModel. - - \snippet places/places.qml CategoryModel model - - The \l CategoryModel type provides a model of the available categories. It can provide - either a flat list or a hierarchical tree model. In this example, we use a hierarchical tree - model, by setting the \l {CategoryModel::hierarchical}{hierarchical} property to \e true. The - \l {CategoryModel::plugin}{plugin} property is set during example intalization. - - Next we create a \l {ListView} to display the category model. - - \snippet places/views/CategoryView.qml CategoryModel view - - Because a hierarchical model is being used, a \l DelegateModel is needed to provide - navigation functionality. If flat list model was being used the view could use the - \l CategoryModel directly. - - The \e rootIndex property sets the root index of the \l DelegateModel. Categories are - displayed by the \e CategoryDelegate, which provides two signals. The \e onShowSubcategories - emits the \b showSubcategories() signal with root index to the current index causing the - sub categories of the selected category to be displayed. The \e onSearchCategory handler emits - the \b searchCategory() signal with a category parameter indicating which specific category - has been chosen. - - The \e CategoryDelegate displays the category name and emits the \b searchCategory() signal when - the \l {Label} is clicked: - - \snippet places/views/CategoryDelegate.qml CategoryModel delegate text - - The \e CategoryDelegate also displays \e arrow \l {ToolButton} when \e hasModelChildren property is set. - - \snippet places/views/CategoryDelegate.qml CategoryModel delegate arrow - - - \target Presenting-Search-Suggestions - \section1 Presenting Search Suggestions - - The \l PlaceSearchSuggestionModel type is used to fetch suggested search terms based on a - partially entered search term. - - A new suggestion search is triggered whenever the entered search term is changed. - - \snippet places/places.qml PlaceSearchSuggestionModel search text changed 1 - \snippet places/places.qml PlaceSearchSuggestionModel search text changed 2 - \snippet places/places.qml PlaceSearchSuggestionModel search text changed 3 - - Suggestions are only queried if the length of the search term is three or more characters. - - When the status of the \l PlaceSearchSuggestionModel changes, search suggestions are displayed. - - \snippet places/places.qml PlaceSearchSuggestionModel model - - The main object in the "SuggestionsShown" state is the \l ListView showing the search - suggestions. - - \snippet places/views/SuggestionView.qml PlaceSearchSuggestionModel view 1 - \codeline - \snippet places/views/SuggestionView.qml PlaceSearchSuggestionModel view 2 - - A \l {Label} object is used as the delegate to display the suggestion text. Clicking on the - suggested search term updates the search term and triggers a place search using the search - suggestion. - - - \section1 Searching for Places - - The \l PlaceSearchModel type is used to search for places. - - \snippet places/places.qml PlaceSearchModel model - - First some of the model's properties are set, which will be used to form the search request. - The \l {PlaceSearchModel::searchArea}{searchArea} property is set to the - \e searchRegion object which is a \l [QML]{geocircle} with a center that is linked to the current - location displayed on the \l Map. - - Finally, we define three helper functions \b searchForCategory(), \b {searchForText()} and - \b searchForRecommendations() which set either the \l {PlaceSearchModel::categories}{categories} or - \l {PlaceSearchModel::searchTerm}{searchTerm} or \l {PlaceSearchModel::recommendationId}{recommendationId} - properties and invokes the \l {PlaceSearchModel::update()}{update()} method to start the - place search. The search results are displayed in a \l ListView. - - \snippet places/views/SearchResultView.qml PlaceSearchModel place list - - The delegate used in the \l ListView, \e SearchResultDelegate, is designed to handle multiple - search result types via a \l Loader object. For results of type \e PlaceResult the delegate - is: - - \snippet places/views/SearchResultDelegate.qml PlaceSearchModel place delegate - - \section1 Displaying Place Content - - Places can have additional rich content, including editorials, reviews and images. Rich - content is accessed via a set of models. Content models are generally not created directly by - the application developer, instead models are obtained from the - \l {Place::editorialModel}{editorialModel}, \l {Place::reviewModel}{reviewModel} and - \l {Place::imageModel}{imageModel} properties of the \l Place type. - - \snippet places/views/EditorialView.qml PlaceEditorialModel view - -*/ diff --git a/src/location/doc/src/examples/places-list.qdoc b/src/location/doc/src/examples/places-list.qdoc deleted file mode 100644 index 7ef02b99..00000000 --- a/src/location/doc/src/examples/places-list.qdoc +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example places_list - \title Places List (QML) - \ingroup qtlocation-examples - - \brief The Places List example demonstrates how to search for and display a list of places using a \l ListView. - \image places-list.png - - \include examples-run.qdocinc - - The \c {Places List} example demonstrates how to search for a list of places - in a certain area and displays the result using a \l ListView. In this particular case, a search - for places associated with the term \c pizza is performed. - - \section1 Performing a Place Search - - To write a QML application that will show places in a list, we start by - making the following import declarations. - - \snippet places_list/places_list.qml Imports - - Instantiate a \l Plugin instance. The \l Plugin is effectively the backend - from where places are sourced from. Depending on the type of the plugin, - some mandatory parameters may be need to be filled in. The most likely type - of PluginParameter are some form of service access token which are documented - in the service plugin. As an example see the \l - {Mandatory Parameters} {HERE Plugin} documentation. In this snippet the \c osm - plugin is used which does not require any further parameter: - - \snippet places_list/places_list.qml Initialize Plugin - - Next we instantiate a \l PlaceSearchModel which we can use to specify - search parameters and perform a places search operation. For illustrative - purposes, \l {PlaceSearchModel::update} {update()} is invoked once - construction of the model is complete. Typically \l - {PlaceSearchModel::update} {update()} would be invoked in response to a - user action such as a button click. - - \snippet places_list/places_list.qml PlaceSearchModel - - Finally we instantiate a \l ListView to show the search results found by - the model. An inline delegate has been used and we have assumed that - every search result is of \l {Search Result Types} {type} \c - PlaceSearchesult. Consequently it is assumed that we always have access to - the \e place \l {PlaceSearchModel Roles} {role}, other search result types - may not have a \e place \l {PlaceSearchModel Roles} {role}. - - \snippet places_list/places_list.qml Places ListView -*/ diff --git a/src/location/doc/src/examples/places-map.qdoc b/src/location/doc/src/examples/places-map.qdoc deleted file mode 100644 index 6e58bfb8..00000000 --- a/src/location/doc/src/examples/places-map.qdoc +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example places_map - \title Places Map (QML) - \ingroup qtlocation-examples - - \brief The Places Map example demonstrates how to search for and display a list of places - on a map using a MapItemView - \image places-map.png - - The example displays a map of the current location or, if no position is - available, it uses Brisbane/Australia. Subsequently a search for places - matching the term "pizza" is performed and each result shown on the map. - - \include examples-run.qdocinc - - \section1 Local Search - - To write the QML application that will show places on a map, we start by - making the following import declarations. - - \snippet places_map/places_map.qml Imports - - Instantiate a \l Plugin instance. The \l Plugin is effectively the backend - from where places are sourced from. Depending on the chosen plugin - some manadatory parameters may be needed. In this case the - \l {Qt Location Open Street Map Plugin}{OSM plugin} is selected which does not have any mandatory - parameters. - - \snippet places_map/places_map.qml Initialize Plugin - - Next we instantiate a \l PlaceSearchModel which we can use to specify - search parameters and perform a places search operation. For illustrative - purposes, \l {PlaceSearchModel::update} {update()} is invoked once - construction of the model is complete. Typically \l - {PlaceSearchModel::update} {update()} would be invoked in response to a - user action such as a button click. - - \snippet places_map/places_map.qml PlaceSearchModel - - The map is displayed by using the \l Map type and inside we declare the \l - MapItemView and supply the search model and a delegate. An inline delegate - has been used and we have assumed that every search result is of \l {Search - Result Types} {type} \c PlaceSerachesult. Consequently it is assumed that - we always have access to the \e place \l {PlaceSearchModel Roles} {role}, - other search result types may not have a \e place \l {PlaceSearchModel - Roles} {role}. - - \snippet places_map/places_map.qml Places MapItemView - - Finally, a \c PositionSource is used to reset the map to the curent - location and find "pizza" places in the new area. The position information - is updated every 2 minutes and if the new position is more than 500 meters - away from the last pizza search area the place search is retriggered. - - \snippet places_map/places_map.qml Current Location -*/ diff --git a/src/location/doc/src/examples/planespotter.qdoc b/src/location/doc/src/examples/planespotter.qdoc deleted file mode 100644 index a07eb96a..00000000 --- a/src/location/doc/src/examples/planespotter.qdoc +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example planespotter - \title Plane Spotter (QML) - \ingroup qtlocation-examples - - \brief The \c {Plane Spotter} example demonstrates the tight integration of - location and positioning data types into QML - - \image planespotter.jpg - - The \c {Plane Spotter} example demonstrates how to integrate location and positioning - related C++ data types into QML and vice versa. This is useful when it is desirable to - run CPU intensive position calculations in native environments - but the results are supposed to be displayed using QML. - - The example shows a map of Europe and airplanes on two routes across Europe. - The first airplane commutes between Oslo and Berlin and the second airplane - commutes between London and Berlin. The position tracking of each airplane - is implemented in C++. The Oslo-Berlin plane is piloted in QML and the London-Berlin - plane is commanded by a C++ pilot. - - \include examples-run.qdocinc - - \section1 Overview - - - This example makes use of the \l Q_GADGET feature as part of its position controller - implementation. It permits \l {Cpp_value_integration_positioning}{direct integration} - of non-QObject based C++ value types into QML. - - The main purpose of the \c PlaneController class is to track the current - coordinates of the plane at a given time. It exposes the position - via its position property. - - \snippet planespotter/main.cpp PlaneController1 - \snippet planespotter/main.cpp PlaneController2 - - The example's \c main() function is responsible for the binding of the - \c PlaneController class instances into the QML context: - - \snippet planespotter/main.cpp PlaneControllerMain - - Similar to QObject derived classes, \l QGeoCoordinate can be integrated without - an additional QML wrapper. - - \section1 Steering the Planes - - As mentioned above, the primary purpose of \c PlaneController class is to track the current - positions of the two planes (Oslo-Berlin and London-Berlin) and advertise them as a property - to the QML layer. Its secondary purpose is to set and progress a plane along a given - flight path. In a sense it can act as a pilot. This is very much like - \l CoordinateAnimation which can animate the transition from one geo coordinate to another. - This example demonstrates how the \c {PlaneController}'s position property is modified - by C++ code using the PlaneController's own piloting abilities and by QML code using - \l CoordinateAnimation as pilot. The Oslo-Berlin plane is animated using QML code - and the London-Berlin plane is animated using C++ code. - - No matter which pilot is used, the results to the pilot's - actions are visible in C++ and QML and thus the example demonstrates unhindered and direct - exchange of position data through the C++/QML boundary. - - The visual representation of each \c Plane is done using - the \l MapQuickItem type which permits the embedding of arbitrary QtQuick items - into a map: - - \snippet planespotter/Plane.qml PlaneMapQuick1 - \snippet planespotter/Plane.qml PlaneMapQuick2 - - \section2 The C++ Pilot - - The C++ plane is steered by C++. The \c from and \c to property of the controller - class set the origin and destination which the pilot uses to calculate the - bearing for the plane: - - \snippet planespotter/main.cpp C++Pilot1 - - The pilot employs a \l QBasicTimer and \l {QTimerEvent}{QTimerEvents} to - constantly update the position. During each timer iteration - \c PlaneController::updatePosition() is called and a new position calculated. - - \snippet planespotter/main.cpp C++Pilot3 - - Once the new position is calculated, \c setPosition() is called and - the subsequent change notification of the property pushes the new position - to the QML layer. - - The C++ plane is started by clicking on the plane: - - \snippet planespotter/planespotter.qml CppPlane1 - \snippet planespotter/planespotter.qml CppPlane2 - - \l {azimuthTo}() calculates the bearing in degrees from one coordinate to another. - Note that the above code utilizes a QML animation to tie the rotation - and the position change into a single animation flow: - - \snippet planespotter/planespotter.qml CppPlane3 - - First, \l NumberAnimation rotates the plane into the correct direction - and once that is done the \c startFlight() function takes care of - starting the plane's position change. - - \snippet planespotter/main.cpp C++Pilot2 - - \section2 The QML Pilot - - The \l CoordinateAnimation type is used to control the flight from Oslo - to Berlin and vice versa. It replaces the above \l ScriptAction. - - \snippet planespotter/planespotter.qml QmlPlane1 - - The \l MouseArea of the QML plane implements the logic for the course setting - and starts the animation when required. - - \snippet planespotter/planespotter.qml QmlPlane2 - -*/ diff --git a/src/location/doc/src/places.qdoc b/src/location/doc/src/places.qdoc index 291af614..72e31c9c 100644 --- a/src/location/doc/src/places.qdoc +++ b/src/location/doc/src/places.qdoc @@ -125,7 +125,7 @@ \li \snippet places_list/places_list.qml Places ListView \li - \inlineimage places-list.png + \inlineimage places_list.png \endtable \note For simplicty's sake we have assumed that every search result is of @@ -155,7 +155,7 @@ \li \snippet places_map/places_map.qml Places MapItemView \li - \inlineimage places-map.png + \inlineimage places_map.png \endtable \note For simplicty's sake we have assumed that every search result is of diff --git a/src/location/doc/src/examples/qtlocation-examples.qdoc b/src/location/doc/src/qtlocation-examples.qdoc index ce4047cb..6155a6fd 100644 --- a/src/location/doc/src/examples/qtlocation-examples.qdoc +++ b/src/location/doc/src/qtlocation-examples.qdoc @@ -32,7 +32,14 @@ \ingroup all-examples \ingroup qtlocation - These are the Qt Location examples. + These examples show a range of different uses for \l{Qt Location}, + such as displaying a map within a QML user interface, implementing basic routing and + place search, as well as integrating positioning data types. + + These examples can work with any of the available geo services plugins. However, some plugins may + require additional \l {QtLocation::PluginParameter}{plugin parameters} in order to function correctly. + The default plugin used by these examples is \l {Qt Location Open Street Map Plugin}, which does not + require any parameters. */ diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h index f713e421..048493b4 100644 --- a/src/location/maps/qgeocodereply.h +++ b/src/location/maps/qgeocodereply.h @@ -63,7 +63,7 @@ public: UnknownError }; - QGeoCodeReply(Error error, const QString &errorString, QObject *parent = 0); + explicit QGeoCodeReply(Error error, const QString &errorString, QObject *parent = Q_NULLPTR); virtual ~QGeoCodeReply(); bool isFinished() const; @@ -83,7 +83,7 @@ Q_SIGNALS: void error(QGeoCodeReply::Error error, const QString &errorString = QString()); protected: - QGeoCodeReply(QObject *parent = 0); + explicit QGeoCodeReply(QObject *parent = Q_NULLPTR); void setError(Error error, const QString &errorString); void setFinished(bool finished); diff --git a/src/location/maps/qgeocodingmanager.h b/src/location/maps/qgeocodingmanager.h index b33cda75..eb366f68 100644 --- a/src/location/maps/qgeocodingmanager.h +++ b/src/location/maps/qgeocodingmanager.h @@ -78,7 +78,7 @@ Q_SIGNALS: void error(QGeoCodeReply *reply, QGeoCodeReply::Error error, QString errorString = QString()); private: - QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *parent = 0); + explicit QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *parent = Q_NULLPTR); QGeoCodingManagerPrivate *d_ptr; Q_DISABLE_COPY(QGeoCodingManager) diff --git a/src/location/maps/qgeocodingmanagerengine.h b/src/location/maps/qgeocodingmanagerengine.h index 3e915758..ce7021a0 100644 --- a/src/location/maps/qgeocodingmanagerengine.h +++ b/src/location/maps/qgeocodingmanagerengine.h @@ -51,7 +51,7 @@ class Q_LOCATION_EXPORT QGeoCodingManagerEngine : public QObject { Q_OBJECT public: - QGeoCodingManagerEngine(const QVariantMap ¶meters, QObject *parent = 0); + explicit QGeoCodingManagerEngine(const QVariantMap ¶meters, QObject *parent = Q_NULLPTR); virtual ~QGeoCodingManagerEngine(); QString managerName() const; diff --git a/src/location/maps/qgeoroutereply.h b/src/location/maps/qgeoroutereply.h index 52f9133d..318d85f8 100644 --- a/src/location/maps/qgeoroutereply.h +++ b/src/location/maps/qgeoroutereply.h @@ -60,7 +60,7 @@ public: UnknownError }; - QGeoRouteReply(Error error, const QString &errorString, QObject *parent = 0); + explicit QGeoRouteReply(Error error, const QString &errorString, QObject *parent = Q_NULLPTR); virtual ~QGeoRouteReply(); bool isFinished() const; @@ -77,7 +77,7 @@ Q_SIGNALS: void error(QGeoRouteReply::Error error, const QString &errorString = QString()); protected: - QGeoRouteReply(const QGeoRouteRequest &request, QObject *parent = 0); + explicit QGeoRouteReply(const QGeoRouteRequest &request, QObject *parent = Q_NULLPTR); void setError(Error error, const QString &errorString); void setFinished(bool finished); diff --git a/src/location/maps/qgeoroutingmanager.h b/src/location/maps/qgeoroutingmanager.h index 0648a15b..56cd8e51 100644 --- a/src/location/maps/qgeoroutingmanager.h +++ b/src/location/maps/qgeoroutingmanager.h @@ -77,7 +77,7 @@ Q_SIGNALS: void error(QGeoRouteReply *reply, QGeoRouteReply::Error error, QString errorString = QString()); private: - QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject *parent = 0); + explicit QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject *parent = Q_NULLPTR); QGeoRoutingManagerPrivate *d_ptr; Q_DISABLE_COPY(QGeoRoutingManager) diff --git a/src/location/maps/qgeoroutingmanagerengine.h b/src/location/maps/qgeoroutingmanagerengine.h index 9fa02727..21aef7ce 100644 --- a/src/location/maps/qgeoroutingmanagerengine.h +++ b/src/location/maps/qgeoroutingmanagerengine.h @@ -51,7 +51,7 @@ class Q_LOCATION_EXPORT QGeoRoutingManagerEngine : public QObject { Q_OBJECT public: - QGeoRoutingManagerEngine(const QVariantMap ¶meters, QObject *parent = 0); + explicit QGeoRoutingManagerEngine(const QVariantMap ¶meters, QObject *parent = Q_NULLPTR); virtual ~QGeoRoutingManagerEngine(); QString managerName() const; diff --git a/src/location/places/qplacecontentreply.h b/src/location/places/qplacecontentreply.h index 1d824485..fa96a0e2 100644 --- a/src/location/places/qplacecontentreply.h +++ b/src/location/places/qplacecontentreply.h @@ -49,7 +49,7 @@ class Q_LOCATION_EXPORT QPlaceContentReply : public QPlaceReply Q_OBJECT public: - explicit QPlaceContentReply(QObject *parent = 0); + explicit QPlaceContentReply(QObject *parent = Q_NULLPTR); virtual ~QPlaceContentReply(); QPlaceReply::Type type() const; diff --git a/src/location/places/qplacedetailsreply.h b/src/location/places/qplacedetailsreply.h index c9530c34..09593a1e 100644 --- a/src/location/places/qplacedetailsreply.h +++ b/src/location/places/qplacedetailsreply.h @@ -47,7 +47,7 @@ class Q_LOCATION_EXPORT QPlaceDetailsReply : public QPlaceReply { Q_OBJECT public: - explicit QPlaceDetailsReply(QObject *parent = 0); + explicit QPlaceDetailsReply(QObject *parent = Q_NULLPTR); virtual ~QPlaceDetailsReply(); QPlaceReply::Type type() const; diff --git a/src/location/places/qplaceidreply.h b/src/location/places/qplaceidreply.h index abdab7aa..ea44828b 100644 --- a/src/location/places/qplaceidreply.h +++ b/src/location/places/qplaceidreply.h @@ -55,7 +55,7 @@ public: RemoveCategory }; - explicit QPlaceIdReply(OperationType operationType, QObject *parent = 0); + explicit QPlaceIdReply(OperationType operationType, QObject *parent = Q_NULLPTR); virtual ~QPlaceIdReply(); QPlaceReply::Type type() const; diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index 37e7c053..bd4b1676 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -112,7 +112,7 @@ Q_SIGNALS: void dataChanged(); private: - QPlaceManager(QPlaceManagerEngine *engine, QObject *parent = 0); + explicit QPlaceManager(QPlaceManagerEngine *engine, QObject *parent = Q_NULLPTR); Q_DISABLE_COPY(QPlaceManager) QPlaceManagerEngine *d; diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h index aca0a875..0c11278f 100644 --- a/src/location/places/qplacemanagerengine.h +++ b/src/location/places/qplacemanagerengine.h @@ -53,7 +53,7 @@ class Q_LOCATION_EXPORT QPlaceManagerEngine : public QObject Q_OBJECT public: - QPlaceManagerEngine(const QVariantMap ¶meters, QObject *parent = 0); + explicit QPlaceManagerEngine(const QVariantMap ¶meters, QObject *parent = Q_NULLPTR); virtual ~QPlaceManagerEngine(); QString managerName() const; diff --git a/src/location/places/qplacematchreply.h b/src/location/places/qplacematchreply.h index e5935e33..df4b3fda 100644 --- a/src/location/places/qplacematchreply.h +++ b/src/location/places/qplacematchreply.h @@ -47,7 +47,7 @@ class Q_LOCATION_EXPORT QPlaceMatchReply : public QPlaceReply { Q_OBJECT public: - explicit QPlaceMatchReply(QObject *parent = 0); + explicit QPlaceMatchReply(QObject *parent = Q_NULLPTR); ~QPlaceMatchReply(); QPlaceReply::Type type() const; diff --git a/src/location/places/qplacereply.h b/src/location/places/qplacereply.h index 987ab446..374c68b3 100644 --- a/src/location/places/qplacereply.h +++ b/src/location/places/qplacereply.h @@ -71,7 +71,7 @@ public: MatchReply }; - explicit QPlaceReply(QObject *parent = 0); + explicit QPlaceReply(QObject *parent = Q_NULLPTR); ~QPlaceReply(); bool isFinished() const; @@ -89,7 +89,7 @@ Q_SIGNALS: void error(QPlaceReply::Error error, const QString &errorString = QString()); protected: - QPlaceReply(QPlaceReplyPrivate *, QObject *parent = 0); + explicit QPlaceReply(QPlaceReplyPrivate *, QObject *parent = Q_NULLPTR); void setFinished(bool finished); void setError(QPlaceReply::Error error, const QString &errorString); QPlaceReplyPrivate *d_ptr; diff --git a/src/location/places/qplacesearchreply.h b/src/location/places/qplacesearchreply.h index ddf850bc..52c88899 100644 --- a/src/location/places/qplacesearchreply.h +++ b/src/location/places/qplacesearchreply.h @@ -49,7 +49,7 @@ class Q_LOCATION_EXPORT QPlaceSearchReply : public QPlaceReply { Q_OBJECT public: - explicit QPlaceSearchReply(QObject *parent = 0); + explicit QPlaceSearchReply(QObject *parent = Q_NULLPTR); ~QPlaceSearchReply(); QPlaceReply::Type type() const; diff --git a/src/location/places/qplacesearchsuggestionreply.h b/src/location/places/qplacesearchsuggestionreply.h index 6aee36cb..3909b14f 100644 --- a/src/location/places/qplacesearchsuggestionreply.h +++ b/src/location/places/qplacesearchsuggestionreply.h @@ -49,7 +49,7 @@ class Q_LOCATION_EXPORT QPlaceSearchSuggestionReply : public QPlaceReply { Q_OBJECT public: - explicit QPlaceSearchSuggestionReply(QObject *parent = 0); + explicit QPlaceSearchSuggestionReply(QObject *parent = Q_NULLPTR); ~QPlaceSearchSuggestionReply(); QStringList suggestions() const; diff --git a/src/plugins/geoservices/mapbox/mapbox.pro b/src/plugins/geoservices/mapbox/mapbox.pro index 7fdfa508..d4797e37 100644 --- a/src/plugins/geoservices/mapbox/mapbox.pro +++ b/src/plugins/geoservices/mapbox/mapbox.pro @@ -1,9 +1,6 @@ TARGET = qtgeoservices_mapbox -QT += location-private positioning-private network -PLUGIN_TYPE = geoservices -PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapbox -load(qt_plugin) +QT += location-private positioning-private network HEADERS += \ qgeoserviceproviderpluginmapbox.h \ @@ -20,3 +17,6 @@ SOURCES += \ OTHER_FILES += \ mapbox_plugin.json +PLUGIN_TYPE = geoservices +PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapbox +load(qt_plugin) diff --git a/src/plugins/geoservices/nokia/nokia.pro b/src/plugins/geoservices/nokia/nokia.pro index 62b04870..cd340f50 100644 --- a/src/plugins/geoservices/nokia/nokia.pro +++ b/src/plugins/geoservices/nokia/nokia.pro @@ -1,4 +1,5 @@ TARGET = qtgeoservices_nokia + QT += location-private positioning-private network contains(QT_CONFIG, location-china-support) { @@ -7,10 +8,6 @@ contains(QT_CONFIG, location-china-support) { QT += systeminfo } -PLUGIN_TYPE = geoservices -PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryNokia -load(qt_plugin) - HEADERS += \ qgeocodereply_nokia.h \ qgeocodexmlparser.h \ @@ -59,3 +56,6 @@ INCLUDEPATH += ../../../location/maps OTHER_FILES += \ nokia_plugin.json +PLUGIN_TYPE = geoservices +PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryNokia +load(qt_plugin) diff --git a/src/plugins/geoservices/osm/osm.pro b/src/plugins/geoservices/osm/osm.pro index a00f1fb8..e73c16d7 100644 --- a/src/plugins/geoservices/osm/osm.pro +++ b/src/plugins/geoservices/osm/osm.pro @@ -1,9 +1,6 @@ TARGET = qtgeoservices_osm -QT += location-private positioning-private network -PLUGIN_TYPE = geoservices -PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryOsm -load(qt_plugin) +QT += location-private positioning-private network HEADERS += \ qgeoserviceproviderpluginosm.h \ @@ -37,3 +34,6 @@ SOURCES += \ OTHER_FILES += \ osm_plugin.json +PLUGIN_TYPE = geoservices +PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryOsm +load(qt_plugin) diff --git a/src/plugins/position/android/src/src.pro b/src/plugins/position/android/src/src.pro index 9c81dde5..3a19c85e 100644 --- a/src/plugins/position/android/src/src.pro +++ b/src/plugins/position/android/src/src.pro @@ -1,10 +1,6 @@ TARGET = qtposition_android -QT = core positioning - -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryAndroid -load(qt_plugin) +QT = core positioning HEADERS = \ positionfactory_android.h \ @@ -19,3 +15,7 @@ SOURCES = \ qgeosatelliteinfosource_android.cpp OTHER_FILES = plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryAndroid +load(qt_plugin) diff --git a/src/plugins/position/corelocation/corelocation.pro b/src/plugins/position/corelocation/corelocation.pro index 1415643b..dbb5b6b3 100644 --- a/src/plugins/position/corelocation/corelocation.pro +++ b/src/plugins/position/corelocation/corelocation.pro @@ -1,9 +1,6 @@ TARGET = qtposition_cl -QT = core positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryCL -load(qt_plugin) +QT = core positioning OBJECTIVE_SOURCES += \ qgeopositioninfosource_cl.mm \ @@ -19,3 +16,7 @@ OTHER_FILES += \ osx: LIBS += -framework Foundation else: ios|tvos: LIBS += -framework CoreFoundation LIBS += -framework CoreLocation + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryCL +load(qt_plugin) diff --git a/src/plugins/position/geoclue/geoclue.pro b/src/plugins/position/geoclue/geoclue.pro index 0d9aab7d..3f75cbf0 100644 --- a/src/plugins/position/geoclue/geoclue.pro +++ b/src/plugins/position/geoclue/geoclue.pro @@ -1,9 +1,6 @@ TARGET = qtposition_geoclue -QT = core positioning dbus -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryGeoclue -load(qt_plugin) +QT = core positioning dbus HEADERS += \ qgeopositioninfosource_geocluemaster.h \ @@ -35,3 +32,7 @@ INCLUDEPATH += $$QT.location.includes $$OUT_PWD OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryGeoclue +load(qt_plugin) diff --git a/src/plugins/position/gypsy/gypsy.pro b/src/plugins/position/gypsy/gypsy.pro index f5c5a087..be65f183 100644 --- a/src/plugins/position/gypsy/gypsy.pro +++ b/src/plugins/position/gypsy/gypsy.pro @@ -1,9 +1,6 @@ TARGET = qtposition_gypsy -QT = core positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryGypsy -load(qt_plugin) +QT = core positioning HEADERS += \ qgeosatelliteinfosource_gypsy_p.h \ @@ -18,3 +15,7 @@ PKGCONFIG += gypsy gconf-2.0 OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryGypsy +load(qt_plugin) diff --git a/src/plugins/position/positionpoll/positionpoll.pro b/src/plugins/position/positionpoll/positionpoll.pro index cb84e79a..be60bf43 100644 --- a/src/plugins/position/positionpoll/positionpoll.pro +++ b/src/plugins/position/positionpoll/positionpoll.pro @@ -1,9 +1,6 @@ TARGET = qtposition_positionpoll -QT = core positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryPoll -load(qt_plugin) +QT = core positioning SOURCES += \ qgeoareamonitor_polling.cpp \ @@ -15,3 +12,7 @@ HEADERS += \ OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryPoll +load(qt_plugin) diff --git a/src/plugins/position/serialnmea/serialnmea.pro b/src/plugins/position/serialnmea/serialnmea.pro index 81570837..bdeb3f13 100644 --- a/src/plugins/position/serialnmea/serialnmea.pro +++ b/src/plugins/position/serialnmea/serialnmea.pro @@ -1,9 +1,6 @@ TARGET = qtposition_serialnmea -QT = core positioning serialport -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactorySerialNmea -load(qt_plugin) +QT = core positioning serialport HEADERS += \ qgeopositioninfosourcefactory_serialnmea.h @@ -13,3 +10,7 @@ SOURCES += \ OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactorySerialNmea +load(qt_plugin) diff --git a/src/plugins/position/simulator/simulator.pro b/src/plugins/position/simulator/simulator.pro index dc00ae1a..c3e6ea3c 100644 --- a/src/plugins/position/simulator/simulator.pro +++ b/src/plugins/position/simulator/simulator.pro @@ -1,12 +1,9 @@ TARGET = qtposition_simulator -QT = core network positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactorySimulator -load(qt_plugin) +QT = core network positioning simulator + INCLUDEPATH += ../../../positioning -QT += simulator DEFINES += QT_SIMULATOR SOURCES += qgeopositioninfosource_simulator.cpp \ qgeosatelliteinfosource_simulator.cpp \ @@ -19,3 +16,7 @@ HEADERS += qgeopositioninfosource_simulator_p.h \ OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactorySimulator +load(qt_plugin) diff --git a/src/plugins/position/winrt/winrt.pro b/src/plugins/position/winrt/winrt.pro index c58c6c18..bc740671 100644 --- a/src/plugins/position/winrt/winrt.pro +++ b/src/plugins/position/winrt/winrt.pro @@ -1,9 +1,6 @@ TARGET = qtposition_winrt -QT = core core-private positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryWinRT -load(qt_plugin) +QT = core core-private positioning SOURCES += qgeopositioninfosource_winrt.cpp \ qgeopositioninfosourcefactory_winrt.cpp @@ -12,3 +9,7 @@ HEADERS += qgeopositioninfosource_winrt_p.h \ OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryWinRT +load(qt_plugin) diff --git a/src/positioning/doc/images/example-satelliteinfo.png b/src/positioning/doc/images/example-satelliteinfo.png Binary files differdeleted file mode 100644 index aa9a217c..00000000 --- a/src/positioning/doc/images/example-satelliteinfo.png +++ /dev/null diff --git a/src/positioning/doc/images/example-weatherinfo.png b/src/positioning/doc/images/example-weatherinfo.png Binary files differdeleted file mode 100644 index 6557b57b..00000000 --- a/src/positioning/doc/images/example-weatherinfo.png +++ /dev/null diff --git a/src/positioning/doc/images/qml-flickr-1.jpg b/src/positioning/doc/images/qml-flickr-1.jpg Binary files differdeleted file mode 100644 index 42514ff0..00000000 --- a/src/positioning/doc/images/qml-flickr-1.jpg +++ /dev/null diff --git a/src/positioning/doc/src/examples/geoflickr.qdoc b/src/positioning/doc/src/examples/geoflickr.qdoc deleted file mode 100644 index 6d043d4d..00000000 --- a/src/positioning/doc/src/examples/geoflickr.qdoc +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example geoflickr - \title GeoFlickr (QML) - \ingroup qtpositioning-examples - - \brief The GeoFlickr example shows how to use the user's current position to - fetch local content from a web service. - - This is a small example, illustrating one of the very core parts of the - \l{Qt Positioning} API: the ability to retrieve and use the user's current - geographic position. - - Key QML types shown in this example: - \list - \li \l{QtPositioning::PositionSource}{PositionSource} - \li \l{XmlListModel}{XmlListModel} - \endlist - - \image qml-flickr-1.jpg - - \include examples-run.qdocinc - - \section1 Retrieving the Current Position - - Retrieving the user's current position is achieved using the PositionSource - type. In this example, we instantiate the PositionSource as part of the - GeoTab component (the floating "window" describing current position and - status). - - \snippet geoflickr/flickrmobile/GeoTab.qml possrc - - When the "Locate and update" button is pressed, we first interrogate the - PositionSource to check if it has an available backend for positioning - data. If it does not, we fall back to using a pre-recorded NMEA log - for demonstration. We then instruct the PositionSource to update. - - \snippet geoflickr/flickrmobile/GeoTab.qml locatebutton-top - \snippet geoflickr/flickrmobile/GeoTab.qml locatebutton-clicked - - To share the new position data with the rest of the application, we use - properties that we have created on the GeoTab component: - - \snippet geoflickr/flickrmobile/GeoTab.qml props - - \section1 Using the Current Position - - The longitude and latitude values retrieved here are eventually set on - in properties on the RestModel component. The RestModel is an XmlListModel, - which retrieves XML data from a URL and creates a data model by performing - XPath queries on it. - - In this case, it retrieves data from the Flickr REST API online, based on - our current position - - \snippet geoflickr/flickrcommon/RestModel.qml restmodel - - This model data is then shown in a variety of Qt Quick views to produce - the example application. - -*/ diff --git a/src/positioning/doc/src/examples/logfilepositionsource.qdoc b/src/positioning/doc/src/examples/logfilepositionsource.qdoc deleted file mode 100644 index 6b008af6..00000000 --- a/src/positioning/doc/src/examples/logfilepositionsource.qdoc +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\example logfilepositionsource -\title Log File Position Source (C++) -\ingroup qtpositioning-examples - -\brief The Logfile Position Source shows how to create and work with a custom NMEA position source, - for platforms without GPS. - -The data is read from a file which has positional data in NMEA format. The resulting time and -position information is then displayed to the screen as simple text in date/time and -latitude/longitude format. - -This example class reads position data from a text file, \e log.txt. The file specifies position -data using a simple text format: it contains one position update per line, where each line contains -a date/time, a latitude and a longitude, separated by spaces. The date/time is in ISO 8601 format -and the latitude and longitude are in degrees decimal format. Here is an excerpt from \e log.txt: - -\code -2009-08-24T22:25:01 -27.576082 153.092415 -2009-08-24T22:25:02 -27.576223 153.092530 -2009-08-24T22:25:03 -27.576364 153.092648 -\endcode - -The class reads this data and distributes it via the -\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal. - -Here is the definition of the \c LogFilePositionSource class: - -\quotefromfile logfilepositionsource/logfilepositionsource.h -\skipto class LogFilePositionSource -\printuntil }; - -The main methods overrided by the subclass are: - -\list - \li \l{QGeoPositionInfoSource::startUpdates()}{startUpdates()}: called by client applications - to start regular position updates. - \li \l{QGeoPositionInfoSource::stopUpdates()}{stopUpdates()}: called by client applications to - stop regular position updates. - \li \l{QGeoPositionInfoSource::requestUpdate()}{requestUpdate()}: called by client applications - to request a single update, with a specified timeout. -\endlist - -When a position update is available, the subclass emits the -\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal. - -Here are the key methods in the class implementation: - -\quotefromfile logfilepositionsource/logfilepositionsource.cpp -\skipto LogFilePositionSource::LogFilePositionSource -\printuntil /^\}/ -\skipto LogFilePositionSource::startUpdates -\printuntil /^\}/ -\skipto LogFilePositionSource::stopUpdates -\printuntil /^\}/ -\skipto LogFilePositionSource::requestUpdate -\printuntil /^\}/ -\printuntil LogFilePositionSource::readNextPosition -\printuntil /^\}/ -*/ diff --git a/src/positioning/doc/src/examples/satelliteinfo.qdoc b/src/positioning/doc/src/examples/satelliteinfo.qdoc deleted file mode 100644 index 51e40867..00000000 --- a/src/positioning/doc/src/examples/satelliteinfo.qdoc +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example satelliteinfo - \title SatelliteInfo (C++/QML) - - \brief The SatelliteInfo example shows how the available satellites - at the user's current position and marks the satellites - currently contributing to the GPS fix as pink. - - \ingroup qtpositioning-examples - - Key \l{Qt Positioning} classes used in this example: - - \list - \li \l{QGeoSatelliteInfo} - \li \l{QGeoSatelliteInfoSource} - \endlist - - \image ../images/example-satelliteinfo.png - - The example displays the signal strength of all satellites in view. Any satellite - that is currently used to calculate the GPS fix has been marked pink. The number at - the bottom of each signal bar is the individual satellite identifier. - - The application operates in three different modes: - - \table - \header - \li Application mode - \li Description - \row - \li running - \li The application continuously queries the system for satellite updates. When new data - is available it will be displayed. - \row - \li stopped - \li The application stops updating the satellite information. - \row - \li single - \li The application makes a single update request with a timeout of 10s. The display - remains empty until the request was answered by the system. - \endtable - - If the platform does not provide satellite information the application automatically - switches into a demo mode whereby it continuously switches between predefined - sets of satellite data. - - \include examples-run.qdocinc -*/ diff --git a/src/positioning/doc/src/examples/weatherinfo.qdoc b/src/positioning/doc/src/examples/weatherinfo.qdoc deleted file mode 100644 index 3db6fcbf..00000000 --- a/src/positioning/doc/src/examples/weatherinfo.qdoc +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example weatherinfo - \title Weather Info (C++/QML) - - \brief The Weather Info example shows how to use the user's current position - to retrieve local content from a web service in a C++ plugin for QML. - - \ingroup qtpositioning-examples - - Key \l{Qt Positioning} classes used in this example: - - \list - \li \l{QGeoPositionInfo} - \li \l{QGeoPositionInfoSource} - \endlist - - \image ../images/example-weatherinfo.png - - \include examples-run.qdocinc - - The example uses weather data provided by \l http://www.openweathermap.org. - - The key part of this example is the application's data model, contained - in the WeatherData and AppModel classes. WeatherData represents the weather - information taken from the HTTP service. It is a simple data class, but we - give it Q_PROPERTies to expose it nicely to QML, later. - - \snippet weatherinfo/appmodel.h 0 - \snippet weatherinfo/appmodel.h 1 - - AppModel models the state of the entire application. At startup, the - application first begins by waiting for network connectivity. We do - this using the QNetworkConfigurationManager and QNetworkSession family - of C++ APIs. - - \snippet weatherinfo/appmodel.cpp 0 - \snippet weatherinfo/appmodel.cpp 1 - - Once the network session is open, we proceed to get the platform's - default position source using QGeoPositionInfo::createDefaultSource() - - \snippet weatherinfo/appmodel.cpp 2 - - If no default source is available, we take a static position and fetch - weather for that. If, however, we do have a position source, we connect - its positionUpdated() signal to a slot on the AppModel and call - startUpdates(), which begins regular updates of device position. - - When a position update is received, we use the longitude and latitude - of the returned coordinate to retrieve the current "city" name for use - in the weather lookup. - - \snippet weatherinfo/appmodel.cpp 3 - - To inform the UI about this process, the cityChanged() signal is emitted - when a new city is used, and the weatherChanged() signal whenever a - weather update occurs. - - \snippet weatherinfo/appmodel.h 2 - \snippet weatherinfo/appmodel.h 3 - \snippet weatherinfo/appmodel.h 4 - - We use a QQmlListProperty for the weather forecast information, - which contains the next 4 days of forecast weather. This makes it - easy to access from QML. - - To expose these to the QML UI layer, we use the qmlRegisterType() - function. We call this once for each type we wish to register, before - loading the actual QML file. - - \snippet weatherinfo/main.cpp 0 - \snippet weatherinfo/main.cpp 1 - - Finally, in the actual QML, we instantiate the AppModel. - - \snippet weatherinfo/weatherinfo.qml 0 - \snippet weatherinfo/weatherinfo.qml 1 - \snippet weatherinfo/weatherinfo.qml 2 - - Once instantiated like this, we can use its properties elsewhere in the - QML document: - - \snippet weatherinfo/weatherinfo.qml 3 - \snippet weatherinfo/weatherinfo.qml 4 - -*/ diff --git a/src/positioning/doc/src/examples/qtpositioning-examples.qdoc b/src/positioning/doc/src/qtpositioning-examples.qdoc index 57d129a0..57d129a0 100644 --- a/src/positioning/doc/src/examples/qtpositioning-examples.qdoc +++ b/src/positioning/doc/src/qtpositioning-examples.qdoc diff --git a/src/positioning/qnmeapositioninfosource.h b/src/positioning/qnmeapositioninfosource.h index 363c6d33..d951f577 100644 --- a/src/positioning/qnmeapositioninfosource.h +++ b/src/positioning/qnmeapositioninfosource.h @@ -55,7 +55,7 @@ public: SimulationMode }; - explicit QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent = 0); + explicit QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent = Q_NULLPTR); ~QNmeaPositionInfoSource(); void setUserEquivalentRangeError(double uere); |