Qt5 C++ GUI Programming Cookbook

Use Qt5 to design and build a graphical user interface that is functional, appealing, and user-friendly for your software application

Qt5 C++ GUI Programming Cookbook

This ebook is included in a Mapt subscription
Lee Zhi Eng

9 customer reviews
Use Qt5 to design and build a graphical user interface that is functional, appealing, and user-friendly for your software application
$35.99
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781783280278
Paperback300 pages

Book Description

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

Chapter 1: Look and Feel Customization
Introduction
Use style sheets with Qt Designer
Basic style sheet customization
Creating a login screen using style sheets
Using resources in style sheets
Customizing properties and sub-controls
Styling in QML
Exposing QML object pointer to C++
Chapter 2: States and Animations
Introduction
Property animation in Qt
Using easing curves to control property animation
Creating an animation group
Creating a nested animation group
State machines in Qt
States, transitions, and animations in QML
Animating widget properties using animators
Sprite animation
Chapter 3: QPainter and 2D Graphics
Introduction
Drawing basic shapes on screen
Exporting shapes to SVG files
Coordinate transformation
Displaying images on screen
Applying image effects to graphics
Creating a basic paint program
2D canvas in QML
Chapter 4: OpenGL Implementation
Introduction
Setting up OpenGL in Qt
Hello world!
Rendering 2D shapes
Render 3D shapes
Texturing in OpenGL
Lighting and texture filter in OpenGL
Moving an object using keyboard controls
3D canvas in QML
Chapter 5: Building a Touch Screen Application with Qt5
Introduction
Setting up Qt for mobile applications
Designing a basic user interface with QML
Touch events
Animation in QML
Displaying information using Model View
Integrating QML and C++
Chapter 6: XML Parsing Made Easy
Introduction
Processing XML data using stream reader
Writing XML data using Stream Writer
Processing XML data using the QDomDocument class
Writing XML data using the QDomDocument class
Using Google's Geocoding API
Chapter 7: Conversion Library
Introduction
Data conversion
Image conversion
Video conversion
Currency conversion
Chapter 8: Accessing Databases
Introduction
Connecting to a database
Writing basic SQL queries
Creating a login screen with Qt
Displaying information from a database on a model view
Advanced SQL queries
Chapter 9: Developing a Web Application Using Qt Web Engine
Introduction
Introduction to Qt WebEngine
WebView and web settings
Embedding Google Maps in your project
Calling C++ functions from JavaScript
Calling JavaScript functions from C++

What You Will Learn

  • Customize the look and feel of your application using the widget editor provided by Qt5
  • Change the states of the GUI elements to make them appear in a different form
  • Animating the GUI elements using the built-in animation system provided by Qt5
  • Draw shapes and 2D images in your application using Qt5’s powerful rendering system
  • Draw 3D graphics in your application by implementing OpenGL, an industry-standard graphical library to your project
  • Build a mobile app that supports touch events and export it to your device
  • Parse and extract data from an XML file, then present it on your software’s GUI
  • Display web content on your program and interact with it by calling JavaScript functions from C++, or calling C++ functions from the web content
  • Access to MySQL and SQLite databases to retrieve data and display it on your software’s GUI

Authors

Table of Contents

Chapter 1: Look and Feel Customization
Introduction
Use style sheets with Qt Designer
Basic style sheet customization
Creating a login screen using style sheets
Using resources in style sheets
Customizing properties and sub-controls
Styling in QML
Exposing QML object pointer to C++
Chapter 2: States and Animations
Introduction
Property animation in Qt
Using easing curves to control property animation
Creating an animation group
Creating a nested animation group
State machines in Qt
States, transitions, and animations in QML
Animating widget properties using animators
Sprite animation
Chapter 3: QPainter and 2D Graphics
Introduction
Drawing basic shapes on screen
Exporting shapes to SVG files
Coordinate transformation
Displaying images on screen
Applying image effects to graphics
Creating a basic paint program
2D canvas in QML
Chapter 4: OpenGL Implementation
Introduction
Setting up OpenGL in Qt
Hello world!
Rendering 2D shapes
Render 3D shapes
Texturing in OpenGL
Lighting and texture filter in OpenGL
Moving an object using keyboard controls
3D canvas in QML
Chapter 5: Building a Touch Screen Application with Qt5
Introduction
Setting up Qt for mobile applications
Designing a basic user interface with QML
Touch events
Animation in QML
Displaying information using Model View
Integrating QML and C++
Chapter 6: XML Parsing Made Easy
Introduction
Processing XML data using stream reader
Writing XML data using Stream Writer
Processing XML data using the QDomDocument class
Writing XML data using the QDomDocument class
Using Google's Geocoding API
Chapter 7: Conversion Library
Introduction
Data conversion
Image conversion
Video conversion
Currency conversion
Chapter 8: Accessing Databases
Introduction
Connecting to a database
Writing basic SQL queries
Creating a login screen with Qt
Displaying information from a database on a model view
Advanced SQL queries
Chapter 9: Developing a Web Application Using Qt Web Engine
Introduction
Introduction to Qt WebEngine
WebView and web settings
Embedding Google Maps in your project
Calling C++ functions from JavaScript
Calling JavaScript functions from C++

Book Details

ISBN 139781783280278
Paperback300 pages
Read More
From 9 reviews

Read More Reviews