Alex Blasche

QtLocation reloaded

Published Wednesday July 22nd, 2015
9 Comments on QtLocation reloaded
Posted in Qt, Qt Location

Once upon a time, back in the Qt 4 and QtMobility days, there used to be a Location API. Unfortunately, during the transition to Qt 5, this API never managed to get a complete port. Qt Mobility location code was tightly bound to QML1, while Qt 5 introduced QML 2. However if you looked carefully, you may have detected that some QML 2 work had already been done for Qt 5.0. More attention and love was required though. With Qt 5.2 Qt Positioning was released, which was a subset of the Qt 4 Location API offering. It focused on providing the means to determine the geographic position.

Now, with Qt 5.5 the remaining Location APIs are back as a Technology Preview. The main differences between the initial Qt 5.0 work and the current state are the removal of the Qt3D dependencies, updating the map rendering logic and fixing the mouse/touch handling.

The heart of every location offering is accessing and presenting map data. Qt Location builds on top of the Qt Positioning offering and uses Mercator projections for tile -maps. They are rendered using Qt Quick Scene Graph with tiles being simple texture nodes. Users can interact with maps using gestures, insert markers or draw simple geometric objects like rectangles & circles. There are currently three plug-ins providing map data:




In addition, Qt Location provides utilities to find a geographic coordinate based on a street address (geocoding) and navigation routes between two locations. It includes simple driving and walking directions. Everything is exposed with nice and familiar model types in QML, for example GeocodeModel and RouteModel. The obtained navigation data can be presented on the map using the Route type and follows the model-view-delegate pattern. The route instructions can be extracted via the RouteManeuver type. Currently, the HERE and OpenStreetMap plug-in provide support for geocoding and navigation.


Last but not least, there is the Places sub module. It not only provides the means to discover categorized places of interests (POIs) but also presents place details like reviews and associated images. The Places API centers around several QML models with the main two being CategoryModel and PleaseSearchModel. Other features such as search suggestions and reviews are implemented in similar ways. Currently POI functionality is provided by the OpenStreetMap and HERE plug-in.

In summary, QtLocation is back in Qt 5.5. Please checkout our documentation and we are looking forward to your feedback !

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt, Qt Location


Adrian Jäkel says:

We have a licence key to use google maps for enterprise – is there a way to use them as a provider?

Also, what are the plans for C++ integration?

Alex Blasche Alex Blasche says:

Google TOS do not permit us to offer a Google specific geoservices plugin.

Having a C++ integration is something we are considering but at this stage we want to concentrate on getting the current feature set stable. Any new feature in Qt 5.6 would be icing on the cake.

Adrian Jäkel says:

So even if we pay google for our licence to use their api, we arent allowed to use it how and where we want? Can you point to a specific part in the TOS where its restricted?

Alex Blasche Alex Blasche says:

There are several but take paragraph 10.2.a as example.

Alex Ivash says:

Any plans on vector tiles support? Or integration with Mapbox tiles rendering library

Alex Blasche Alex Blasche says:

We have no concrete plan in the work but it would be one of my two top desires (offline and vector support) too.

Firat Agdas says:

Looks awesome! Looking forward to use & test it!

Ferit Cubukcuoglu says:

Thank you, great work!

In Qt5.5 is it possible to use QtLocation with offline maps(e.g. openstreetmap) or is it planned for next versions?

Alex Blasche Alex Blasche says:

At this stage we don’t ship a plugin that supports it. You can write your own offline plugin though. It’s not an API issue.

Planning has not progressed beyond Qt 5.6 and from today’s point of view it is not part of Qt 5.6. As mentioned further above, it is one of the desirable features for future releases.

Commenting closed.

Get started today with Qt Download now