Qt5 C++ GUI Programming Cookbook

Book description

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

About This Book

  • Learn to make use of Qt5 to design and customize the look-and-feel of your application
  • Improve the visual quality of your application by utilizing the graphic rendering system and animation system provided by Qt5
  • A good balance of visual presentation and its contents will make an application appealing yet functional

Who This Book Is For

This book intended for those who want to develop software using Qt5. If you want to improve the visual quality and content presentation of your software application, this book is best suited to you.

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

In Detail

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.

Style and approach

This book focuses on customizing the look and feel and utilizing the graphical features provided by Qt5. It takes a step-by-step approach, providing tons of screenshots and sample code for you to follow and learn. Each topic is explained sequentially and placed in context.

Table of contents

  1. Qt5 C++ GUI Programming Cookbook
    1. Table of Contents
    2. Qt5 C++ GUI Programming Cookbook
    3. Credits
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why Subscribe?
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Sections
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
        5. See also
      5. Conventions
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Look and Feel Customization
      1. Introduction
      2. Use style sheets with Qt Designer
        1. How to do it…
        2. How it works...
        3. There's more…
      3. Basic style sheet customization
        1. How to do it…
        2. How it works...
      4. Creating a login screen using style sheets
        1. How to do it…
        2. How it works...
      5. Using resources in style sheets
        1. How to do it
        2. How it works...
      6. Customizing properties and sub-controls
        1. How to do it…
        2. How it works...
      7. Styling in QML
        1. How to do it…
        2. How it works...
      8. Exposing QML object pointer to C++
        1. How to do it…
        2. How it works...
    9. 2. States and Animations
      1. Introduction
      2. Property animation in Qt
        1. How to do it…
        2. How it works...
        3. There's more…
      3. Using easing curves to control property animation
        1. How to do it…
        2. How it works...
        3. There's more…
      4. Creating an animation group
        1. How to do it…
        2. How it works...
        3. There's more…
      5. Creating a nested animation group
        1. How to do it…
        2. How it works...
      6. State machines in Qt
        1. How to do it…
        2. How it works...
        3. There's more…
      7. States, transitions, and animations in QML
        1. How to do it…
        2. How it works...
        3. There's more…
      8. Animating widget properties using animators
        1. How to do it…
        2. How it works...
      9. Sprite animation
        1. How to do it…
        2. How it works...
        3. There's more…
    10. 3. QPainter and 2D Graphics
      1. Introduction
      2. Drawing basic shapes on screen
        1. How to do it…
        2. How it works...
        3. There's more…
      3. Exporting shapes to SVG files
        1. How to do it…
        2. How it works...
        3. There's more…
      4. Coordinate transformation
        1. How to do it…
        2. How it works...
        3. There's more…
      5. Displaying images on screen
        1. How to do it…
        2. How it works...
        3. There's more…
      6. Applying image effects to graphics
        1. How to do it…
        2. How it works...
        3. There's more…
      7. Creating a basic paint program
        1. How to do it…
        2. How it works...
      8. 2D canvas in QML
        1. How to do it…
    11. 4. OpenGL Implementation
      1. Introduction
      2. Setting up OpenGL in Qt
        1. How to do it…
        2. How it works...
        3. There's more…
      3. Hello world!
        1. How to do it…
        2. How it works...
      4. Rendering 2D shapes
        1. How to do it…
        2. How it works...
      5. Render 3D shapes
        1. How to do it…
        2. How it works...
      6. Texturing in OpenGL
        1. How to do it…
        2. How it works...
      7. Lighting and texture filter in OpenGL
        1. How to do it…
        2. How it works...
        3. There's more…
      8. Moving an object using keyboard controls
        1. How to do it…
        2. How it works...
      9. 3D canvas in QML
        1. How to do it…
        2. How it works...
    12. 5. Building a Touch Screen Application with Qt5
      1. Introduction
      2. Setting up Qt for mobile applications
        1. How to do it…
        2. How it works…
      3. Designing a basic user interface with QML
        1. How to do it…
        2. How it works…
      4. Touch events
        1. How to do it…
        2. How it works…
        3. There's more…
      5. Animation in QML
        1. How to do it…
        2. How it works…
      6. Displaying information using Model View
        1. How to do it…
        2. How it works…
      7. Integrating QML and C++
        1. How to do it…
        2. How it works…
    13. 6. XML Parsing Made Easy
      1. Introduction
      2. Processing XML data using stream reader
        1. How to do it…
        2. How it works…
        3. There's more…
      3. Writing XML data using Stream Writer
        1. How to do it…
        2. How it works…
      4. Processing XML data using the QDomDocument class
        1. How to do it…
        2. How it works…
      5. Writing XML data using the QDomDocument class
        1. How to do it…
        2. How it works…
      6. Using Google's Geocoding API
        1. How to do it…
        2. How it works…
        3. There's more…
    14. 7. Conversion Library
      1. Introduction
      2. Data conversion
        1. How to do it…
        2. How it works...
        3. There's more…
      3. Image conversion
        1. How to do it…
        2. How it works...
        3. There's more…
      4. Video conversion
        1. How to do it…
        2. How it works...
        3. There's more…
      5. Currency conversion
        1. How to do it…
        2. How it works...
        3. There's more…
    15. 8. Accessing Databases
      1. Introduction
        1. How to do it…
        2. How it works…
      2. Connecting to a database
        1. How to do it…
        2. How it works…
      3. Writing basic SQL queries
        1. How to do it…
        2. How it works…
      4. Creating a login screen with Qt
        1. How to do it…
        2. How it works…
      5. Displaying information from a database on a model view
        1. How to do it…
        2. How it works…
      6. Advanced SQL queries
        1. How to do it…
        2. How it works…
        3. There's more…
    16. 9. Developing a Web Application Using Qt Web Engine
      1. Introduction
      2. Introduction to Qt WebEngine
        1. How to do it…
        2. How it works…
        3. There's more…
      3. WebView and web settings
        1. How to do it…
        2. How it works…
      4. Embedding Google Maps in your project
        1. How to do it…
        2. How it works…
      5. Calling C++ functions from JavaScript
        1. How to do it…
        2. How it works…
      6. Calling JavaScript functions from C++
        1. How to do it…
        2. How it works…
    17. Index

Product information

  • Title: Qt5 C++ GUI Programming Cookbook
  • Author(s): Lee Zhi Eng
  • Release date: July 2016
  • Publisher(s): Packt Publishing
  • ISBN: 9781783280278