Use Qt 6 to design and build functional, appealing, and user-friendly graphical user interfaces (GUIs) for your applications Key Features Learn to use Qt 6 to design and customize the look and feel of your applications Improve the visual quality of an application by using graphics rende
Qt 6 C++ GUI Programming Cookbook - Third Edition: Practical recipes for building cross-platform GUI applications, widgets, and animations with Qt 6
✍ Scribed by Lee Zhi Eng
- Publisher
- Packt Publishing
- Year
- 2024
- Tongue
- English
- Leaves
- 428
- Edition
- 3
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Use Qt 6 to design and build functional, appealing, and user-friendly graphical user interfaces (GUIs) for your applications
Key Features
- Learn to use Qt 6 to design and customize the look and feel of your applications
- Improve the visual quality of an application by using graphics rendering and animation
- Understand the balance of presentation and web content that will make an application appealing yet functional
- Purchase of the print or Kindle book includes a free PDF eBook
Book Description
With the growing need to develop GUIs for multiple targets and multiple screens, improving the visual quality of your application has become pivotal in helping it stand 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 UIs for your applications.
The third edition of Qt 6 C++ GUI Programming Cookbook teaches you how to develop functional and appealing UIs using the latest version of Qt 6 and C++. This book will help you learn a variety of topics such as GUI customization and animation, graphics rendering, and implementing Google Maps. You'll also be taken through advanced concepts such as asynchronous programming, event handling using signals and slots, network programming, and other aspects to optimize your application.
By the end of this Qt book, you'll have the confidence you need to design and customize GUI applications that meet your clients' expectations and have an understanding of best-practice solutions to common problems during the app development process.
What you will learn
- Animate GUI elements using Qt 6's built-in animation system
- Draw vector shapes and bitmap images using Qt 6's powerful rendering system
- Implement an industry-standard OpenGL library in your project
- Build a mobile app that supports touch events and export it into devices
- Parse and extract data from an XML file and present it on your GUI
- Interact with web content by calling JavaScript functions from C++
- Access MySQL and SQLite databases to retrieve data and display it on your GUI
Who this book is for
This intermediate-level book is designed for those who want to develop software using Qt 6. If you want to improve the visual quality and content presentation of your software application, this book is for you. Prior experience with the C++ programming language is required.
Table of Contents
- Look-and-Feel Customization with Qt Designer
- Event Handling - Signals and Slots
- States and Animations with Qt and QML
- QPainter and 2D Graphics
- OpenGL Implementation
- Transitioning from Qt5 to Qt6
- Using Network and Managing Large Documents
- Threading Basics - Asynchronous Programming
- Building a Touch Screen Application with Qt6
- JSON Parsing Made Easy
- Conversion Library
- Accessing Databases with SQL Driver and Qt
- Develop Web Applications Using Qt WebEngine
- Performance Optimization
✦ Table of Contents
Cover
Title Page
Copyright and Credits
Dedication
Contributors
Table of Contents
Preface
Chapter 1: Look-and-Feel Customization with Qt Designer
Technical requirements
Using style sheets with Qt Designer
How to do it...
How it works...
There’s more...
Customizing basic style sheets
How to do it...
How it works…
Creating a login screen using style sheets
How to do it...
How it works…
Using resources in style sheets
How to do it…
How it works…
Customizing properties and sub-controls
How to do it…
How it works…
Styling in Qt Modeling Language (QML)
How to do it…
How it works…
Exposing the QML object pointer to C++
How to do it…
How it works…
There’s more…
Chapter 2: Event Handling – Signals and Slots
Technical requirements
Signals and slots in a nutshell
How to do it…
How it works…
There’s more…
UI events with signals and slots
How to do it…
Asynchronous programming made easier
How to do it…
How it works…
Function callbacks
How to do it…
How it works…
Chapter 3: States and Animations with Qt and QML
Technical requirements
Property animation in Qt
How to do it…
How it works…
There’s more…
Using easing curves to control property animation
How to do it…
How it works...
There’s more...
Creating an animation group
How to do it…
How it works…
There’s more…
Creating a nested animation group
How to do it…
How it works…
State machines in Qt 6
How to do it…
How it works…
There’s more…
States, transitions, and animations in QML
How to do it…
How it works…
There’s more…
Animating widget properties using animators
How to do it…
How it works…
There’s more…
Sprite animation
How to do it…
How it works…
There’s more…
Chapter 4: QPainter and 2D Graphics
Technical requirements
Drawing basic shapes on the screen
How to do it…
How it works...
There’s more…
Exporting shapes to SVG files
How to do it…
How it works...
There’s more…
Coordinate transformation
How to do it…
How it works...
There’s more…
Displaying images on screen
How to do it…
How it works...
There’s more…
Applying image effects to graphics
How to do it…
How it works...
There’s more…
Creating a basic paint program
How to do it…
How it works...
Rendering a 2D canvas in QML
How to do it…
Chapter 5: OpenGL Implementation
Technical requirements
Setting up OpenGL in Qt
How to do it…
How it works…
There’s more…
Hello World!
How to do it…
How it works...
Rendering 2D shapes
How to do it…
How it works...
Rendering 3D shapes
How to do it...
How it works...
Texturing in OpenGL
How to do it…
How it works...
Basic lighting in OpenGL
How to do it…
How it works...
Moving an object using keyboard controls
How to do it…
How it works...
Qt Quick 3D in QML
How to do it…
How it works...
Chapter 6: Transitioning from Qt 5 to Qt 6
Technical requirements
Changes in C++ classes
How to do it…
How it works…
There’s more…
Using Clazy checks for Clang and C++
How to do it…
How it works...
Changes in QML types
How to do it…
How it works...
Chapter 7: Using Network and Managing Large Documents
Technical requirements
Creating a TCP server
How to do it…
How it works…
Creating a TCP client
How to do it…
How it works…
Uploading and downloading files using FTP
How to do it…
How it works…
Chapter 8: Threading Basics –Asynchronous Programming
Technical requirements
Using threads
How to do it…
How it works…
QObject and QThread
How to do it…
How it works…
Data protection and sharing data between threads
How to do it…
How it works…
Working with QRunnable processes
How to do it…
How it works…
Chapter 9: Building a Touch Screen Application with Qt 6
Technical requirements
Setting up Qt for mobile applications
How to do it…
How it works…
Designing a basic user interface with QML
How to do it…
How it works…
Touch events
How to do it…
How it works…
There’s more…
Animation in QML
How to do it…
How it works…
Displaying information using model/view
How to do it…
How it works…
Integrating QML and C++
How to do it…
How it works…
Chapter 10: JSON Parsing Made Easy
Technical requirements
JSON format in a nutshell
How to do it…
How it works…
Processing JSON data from a text file
How to do it…
How it works…
There’s more…
Writing JSON data to a text file
How to do it…
How it works…
Using Google’s Geocoding API
How to do it…
How it works…
There’s more…
Chapter 11: Conversion Library
Technical requirements
Converting data
How to do it…
How it works…
There’s more…
Converting images
How to do it…
How it works…
There’s more…
Converting videos
How to do it…
How it works…
There’s more…
Converting currency
How to do it…
How it works…
There’s more…
Chapter 12: Accessing Databases with SQL Driver and Qt
Technical requirements
Setting up a database
How to do it…
How it works…
Connecting to a database
How to do it…
How it works…
Writing basic SQL queries
How to do it…
How it works…
Creating a login screen with Qt
How to do it…
How it works…
Displaying information from a database in model view
How to do it…
How it works…
Advanced SQL queries
How to do it…
How it works…
There’s more…
Chapter 13: Developing Web Applications Using Qt WebEngine
Technical requirements
Introducing Qt WebEngine
How to do it…
How it works…
There’s more…
Using webview and web settings
How to do it…
How it works…
Embedding Google maps in your project
How to do it…
How it works…
Calling C++ functions from JavaScript
How to do it…
How it works…
Calling Javascript functions from C++
How to do it…
How it works…
Chapter 14: Performance Optimization
Technical requirements
Optimizing forms and C++
How to do it…
How it works…
Profiling and optimizing QML
How to do it…
How it works…
Rendering and animation
How to do it…
How it works…
Index
Other Books You May Enjoy
📜 SIMILAR VOLUMES
Use Qt 5 to design and build functional, appealing, and user-friendly graphical user interfaces (GUIs) for your applications. Key Features Learn to use Qt 5 to design and customize the look and feel of your application Improve the visual quality of an application by using graphics rendering and
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, inter
<p><b>Use Qt 5 to design and build functional, appealing, and user-friendly graphical user interfaces (GUIs) for your applications.</b></p> <h4>Key Features</h4> <ul><li>Learn to use Qt 5 to design and customize the look and feel of your application </li> <li>Improve the visual quality of an applica
Use Qt 6 to design and build functional, appealing, and user-friendly graphical user interfaces (GUIs) for your applications Key Features Learn to use Qt 6 to design and customize the look and feel of your applications Improve the visual quality of an application by using graphics rendering and
Over 60 recipes to help you design interactive, smart, and cross-platform GUI applications Key Features Get succinct QT solutions to pressing GUI programming problems in Python Learn how to effectively implement reactive programming Build customized applications that are robust and reliable