Using Google's Geocoding API

In this example, we will learn how to obtain the full address of a specific location by using Google's Geocoding API.

How to do it…

Let's create a program that utilizes the Geocoding API by following these steps:

  1. First, create a new Qt Widgets Application project.
  2. Next, open up mainwindow.ui and add a couple of text labels, input fields, and a button to make your UI to look similar to this:
    How to do it…
  3. After that, open up your project (.pro) file and add the network module to your project. You can do that by simply adding the network text after core and gui, like so:
    QT += core gui network
  4. Then, open up mainwindow.h and add the following ...

Get Qt5 C++ GUI Programming Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.