O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 combobox (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.

It looks like this:

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required