The Qt Positioning API provides positioning information via QML and C++ interfaces.
Currently, the API is supported on Android, iOS, macOS, Linux, and Windows
(with GPS receivers exposed as a serial port providing NMEA sentences or using Windows.Devices.Geolocation).
The Qt Positioning API lets you to determine a position by using a variety of possible sources, including satellite, wifi, or text files. That information can then be used to, for example, determine a position on a map. In addition, you can use to the API to retrieve satellite information and perform area based monitoring.
The QML types of the module are available through the QtPositioning import. To use the types, add the following import statement to your .qml file:
import QtPositioning
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
Use the find_package() command to locate the needed module component in the Qt6 package:
find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
For more details, see the Build with CMake overview.
To configure the module for building with qmake, add the module as a value of the QT variable in the project's .pro file:
QT += positioning
Starting from Qt 6.6, the Qt Positioning module uses new QPermission API to handle location permissions. This means that Qt itself no longer queries for these permissions, so this needs to be done directly from the client application.
Please refer to the Application Permissions page for an example of how to integrate the new QPermission API into the application.
Changes to Qt Positioning lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.
Qt Positioning is available under commercial licenses from The Qt Company. In addition, it is available under free software licenses. Since Qt 5.4, these free software licenses are GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: