Qt 6 C++ GUI Programming Cookbook [3 ed.] 9781805122630

With the growing need to develop GUIs for multiple targets and multiple screens, improving the visual quality of your ap

262 95 22MB

English Pages 529 Year 2024

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
Qt 6 C++ GUI Programming Cookbook
Contributors
About the author
About the reviewer
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
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…
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…
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…
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…
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...
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...
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…
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…
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…
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…
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…
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…
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…
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
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
Download a free PDF copy of this book

Qt 6 C++ GUI Programming Cookbook [3 ed.]
 9781805122630

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers