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

Image conversion


In this section, we will learn how to build a simple image converter that converts an image from one format to another. Qt supports reading and writing different types of image formats, and this support comes in the form of external DLL files due to licensing issues. However, you don't have to worry about that because as long as you include those DLL files in your project, it will work seamlessly across different formats. There are certain formats that only support reading and not writing, and some that support both. You can check out the full details at http://doc.qt.io/qt-5/qtimageformats-index.html.

How to do it…

Qt's built-in image libraries make image conversion really simple:

  1. First of all, open up Qt Creator and create a new Qt Widgets Application project.

  2. Open up mainwindow.ui and add a line edit and push button to the canvas for selecting image files, a combo box for selecting the desired file format, and another push button for starting the conversion process:

  3. Next,...