Book Image

Qt5 C++ GUI Programming Cookbook - Second Edition

By : Lee Zhi Eng
Book Image

Qt5 C++ GUI Programming Cookbook - Second Edition

By: Lee Zhi Eng

Overview of this book

With the growing need to develop GUIs for multiple targets and multiple screens, improving the visual quality of your application becomes important so that it stands out from your competitors. With its cross-platform ability and the latest UI paradigms, Qt makes it possible to build intuitive, interactive, and user-friendly user interfaces for your applications. Qt5 C++ GUI Programming Cookbook, Second Edition teaches you how to develop functional and appealing user interfaces using the latest version of QT5 and C++. This book will help you learn a variety of topics such as GUI customization and animation, graphics rendering, implementing Google Maps, and more. You will also be taken through advanced concepts like asynchronous programming, event handling using signals and slots, network programming, various aspects of optimizing your application. By the end of the book, you will be confident to design and customize GUI applications that meet your clients' expectations and have an understanding of best practice solutions for common problems.
Table of Contents (15 chapters)

Introduction

The signals and slots mechanism in Qt 5 is one of its most important features. It's a method that allows communication between objects, which is a crucial part of a program's graphical user interface. A signal can be emitted from any QObject objects or its subclasses, which will then trigger any slot functions of any objects that are connected to the signal.

Compared to callbacks (which Qt 5 also support), the signals and slots mechanism is comparably more fluid and flexible for the programmer to use. The signals and slots mechanism is both type safe and not strongly coupled to the processing function, which makes it better than the callback's implementation.

A signal of an arbitrary class can trigger any private slots of an unrelated class that is going to be invoked, which is not possible with callbacks.
...