summaryrefslogtreecommitdiff
path: root/src/positioning
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-08 16:01:11 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-08 16:01:11 +0100
commitb29d6b416af7ea2cd47ec72af1e083d91583db95 (patch)
tree80b46620cc1e5ee467fb90f94bfcee77a86451e1 /src/positioning
parentd21ed648f2958efaab9a041b2cd2607f4676be59 (diff)
parent8dabd241c2d7ac095cfe7be847397a288158f004 (diff)
downloadqtlocation-b29d6b416af7ea2cd47ec72af1e083d91583db95.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I18bb1c341e7d87cd1d649f2c3fc9c50141c6a1a9
Diffstat (limited to 'src/positioning')
-rw-r--r--src/positioning/doc/images/example-satelliteinfo.pngbin27371 -> 0 bytes
-rw-r--r--src/positioning/doc/images/example-weatherinfo.pngbin82081 -> 0 bytes
-rw-r--r--src/positioning/doc/images/qml-flickr-1.jpgbin66794 -> 0 bytes
-rw-r--r--src/positioning/doc/src/examples/geoflickr.qdoc87
-rw-r--r--src/positioning/doc/src/examples/logfilepositionsource.qdoc87
-rw-r--r--src/positioning/doc/src/examples/satelliteinfo.qdoc75
-rw-r--r--src/positioning/doc/src/examples/weatherinfo.qdoc113
-rw-r--r--src/positioning/doc/src/qtpositioning-examples.qdoc (renamed from src/positioning/doc/src/examples/qtpositioning-examples.qdoc)0
-rw-r--r--src/positioning/qnmeapositioninfosource.h2
9 files changed, 1 insertions, 363 deletions
diff --git a/src/positioning/doc/images/example-satelliteinfo.png b/src/positioning/doc/images/example-satelliteinfo.png
deleted file mode 100644
index aa9a217c..00000000
--- a/src/positioning/doc/images/example-satelliteinfo.png
+++ /dev/null
Binary files differ
diff --git a/src/positioning/doc/images/example-weatherinfo.png b/src/positioning/doc/images/example-weatherinfo.png
deleted file mode 100644
index 6557b57b..00000000
--- a/src/positioning/doc/images/example-weatherinfo.png
+++ /dev/null
Binary files differ
diff --git a/src/positioning/doc/images/qml-flickr-1.jpg b/src/positioning/doc/images/qml-flickr-1.jpg
deleted file mode 100644
index 42514ff0..00000000
--- a/src/positioning/doc/images/qml-flickr-1.jpg
+++ /dev/null
Binary files differ
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);