Book Image

Qt5 C++ GUI Programming Cookbook

By : Lee Zhi Eng
Book Image

Qt5 C++ GUI Programming Cookbook

By: Lee Zhi Eng

Overview of this book

With the advancement of computer technology, the software market is exploding with tons of software choices for the user, making their expectations higher in terms of functionality and the look and feel of the application. Therefore, improving the visual quality of your application is vital in order to overcome the market competition and stand out from the crowd. This book will teach you how to develop functional and appealing software using Qt5 through multiple projects that are interesting and fun. This book covers a variety of topics such as look-and-feel customization, GUI animation, graphics rendering, implementing Google Maps, and more. You will learn tons of useful information, and enjoy the process of working on the creative projects provided in this book
Table of Contents (16 chapters)
Qt5 C++ GUI Programming Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Currency conversion


In this example, we will learn how to create a simple currency converter using Qt, with the help of an external service provider called Fixer.io.

How to do it…

Make yourself a currency converter with these simple steps:

  1. We start by opening Qt Creator and creating a new Qt Widgets Application project from File | New File or Project.

  2. Next, open up the project file (.pro) and add the network module to our project:

    QT += core gui network
  3. After that, open up mainwindow.ui and remove the menu bar, tool bar, and status bar from the UI.

  4. Then, add three horizontal layouts, a horizontal line, and a push button to the canvas. Once they're all placed, left-click on the canvas and follow by clicking the Lay Out Vertically button above the canvas. Then, set the label of the push button as Convert. The UI should now look something like this:

  5. After that, add two labels to the top layout and set the text of the left one as From:, followed by the right one as To:. Right after that, add two line...