Time for action – using Google's Distance Matrix API

The GUI for this example is kept simple—the source code is attached with the book. It consists of two line edits (ui->from and ui->to) that allow you to enter the origin and destination of the journey. It also provides you with a combo box (ui->vehicle) that allows you to choose a mode of transportation—whether you want to drive a car, ride a bicycle, or walk—a push button (ui->search) to start the request, and a text edit or (ui->result) to show the results. The result will look like this:

Time for action – using Google's Distance Matrix API

MainWindow—a subclass of QMainWindow—is the application's main class that holds two private members: m_nam ...

Get Game Programming Using Qt 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.