Setting up the Qt location module

  1. First, create a new Qt Widgets Application project.
  2. After that, open up your project file (.pro) and add the following modules to your Qt project:
QT += core gui location qml quickwidgets 

Besides the location module, we also added qml and quickwidgets modules, which are required by the map display widget in the next section. That is all we need to do for enabling the Qt Location module in our project. Next, we will proceed to add the map display widget to our project.

Get Hands-On GUI Programming with C++ and Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.