Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Cross-Platform Development with Qt 6 and Modern C++
Cross-Platform Development with Qt 6 and Modern C++

Cross-Platform Development with Qt 6 and Modern C++: Design and build applications with modern graphical user interfaces without worrying about platform dependency

eBook
€20.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Cross-Platform Development with Qt 6 and Modern C++

Chapter 1: Introduction to Qt 6

Qt (pronounced cute, not que-tee) is a cross-platform application development framework designed to create great software applications with uniform user interfaces (UIs) for desktop, embedded, and mobile platforms. It provides developers with a great set of tools to design and build great applications without worrying about platform dependency. In this chapter, you will learn the basics about the framework, its history, and how to install Qt on different platforms. You will learn what Qt is and why it is beneficial to use it. By the end of the chapter, you will be able to install Qt and get started on your platform of choice.

In this chapter, we're going to cover the following main topics:

  • Introducing Qt
  • Reasons for using Qt
  • Downloading and installing Qt
  • Building Qt 6 from source

Technical requirements

To get started, you should have a desktop or laptop running on Windows, Linux, or macOS. Please use the updated Windows 10 or Ubuntu 20.04 long-term support (LTS). Alternatively, use the latest version of macOS (newer than macOS 10.14), such as macOS Catalina.

For your integrated development environment (IDE) to run smoothly, your system should have at least an Intel Core i5 processor along with a minimum of 4 gigabytes (GB) of random-access memory (RAM).

You will need an active internet connection to download and install Qt. As a prerequisite, you should also be familiar with C++ as Qt requires C++ programming knowledge.

Introducing Qt

Qt is a cross-platform software development framework for desktop, embedded, and mobile platforms. It follows the philosophy of code less, create more, and deploy everywhere. It supports platforms such as Windows, Linux, macOS, VxWorks, QNX, Android, iOS, and so on. The software also supports several microcontroller units (MCUs) from NXP, Renesas, and STMicroelectronics running on bare metal or FreeRTOS.

Qt was born as an attempt to provide a uniform graphical user interface (GUI) with the same look, feel, and functionality across different platforms. Qt accomplishes that by providing a framework to write code once and ensure that it runs on other platforms with minimal or no modifications. It is not a programming language, but rather a framework written in C++. The Qt framework and tools are dual-licensed under open source and commercial licenses.

Qt uses a modular approach to group related functionalities together. Qt Essentials are the foundation of Qt on all platforms. These modules are general and useful for most Qt-based applications. Essential modules are available for open source usage. Examples of Qt Essentials modules are Qt Core, Qt GUI, Qt QML, Qt Widgets, and so on. There are also special-purpose add-on modules that provide specific functionalities and come with certain license obligations. Examples of add-on modules are Qt 3D, Qt Bluetooth, Qt Charts, Qt Data Visualization, and more. As well as this, there are value-added modules such as Qt Automotive Suite, Qt for Device Creation, and Qt for MCUs, among others available under the commercial license.

To find out more about different Qt modules, visit https://doc.qt.io/qt-6/qtmodules.html.

Qt was released for public use in 1995. Since then, there have been many improvements and major changes. Qt 6 is the new major version of Qt. Its main goals are to remain prepared for the requirements coming in 2020 and beyond, remove obsolete modules, and be more maintainable. With this focus, there are architectural changes in Qt 6 that may break some level of backward compatibility with earlier versions.

Some essential modifications in Qt 6 are outlined here:

  • Introduction of strong typing
  • JavaScript as an optional feature of Qt Modeling Language (QML)
  • Removal of QML versioning
  • Removal of the duplicate data structures between QObject and QML
  • Avoidance of the creation of runtime data structures
  • Compilation of QML into efficient C++ and native code
  • Support for hiding implementation details
  • Better integration of tools

Now that we've covered the basics, let's look at the main reasons for using Qt…

Reasons for using Qt

Qt is a modular, cross-platform application development framework. The biggest misunderstanding about Qt is that many people consider it as a GUI framework. However, Qt is much more than a GUI framework. It not only comprises a GUI module, but also a set of modules to make application development faster and easier to scale on various platforms. The biggest benefit of using Qt is its ability to provide portability to various platforms. Here are some advantages of using Qt for developers:

  • You can create incredible user experiences for your customers and boost your company brand using Qt.
  • Cross-platform development saves both time and money. You can target multiple platforms with the same code base.
  • Qt is known for making C++ easy and accessible. With Qt, developers can easily create high-performance, scalable applications with a fluid UI.
  • Due to the open source model, the framework is future-proof, along with a great ecosystem.
  • It further supports different programming languages and is a very flexible and reliable framework. Consequently, there are great companies such as Adobe, Microsoft, Samsung, AMD, HP, Philips, and MathWorks using Qt for their applications. Many open source projects such as VLC (previously known as VideoLAN Client), Open Broadcaster Software (OBS), and WPS Office (where WPS stands for Writer, Presentation, and Spreadsheets) are also built on Qt.

The core values of Qt are outlined as follows:

  • Cross-platform nature
  • Highly scalable
  • Very easy to use
  • Built-in with world-class application programming interfaces (APIs), tools, and documentation
  • Maintainable, stable, and compatible
  • A large community of users

Whether you are a hobbyist, a student, or working for a company, Qt provides great flexibility to use its modules as per your requirement. Many universities are using Qt as one of their coursework subjects. So, Qt is a great choice for programmers to start building new applications with ready-made features. Let's start by downloading and installing Qt 6 on your machine.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Leverage Qt and C++ capabilities to create modern, cross-platform applications that can run on a wide variety of software applications
  • Explore what’s new in Qt 6 and understand core concepts in depth
  • Build professional customized GUI applications with the help of Qt Creator

Description

Qt is a cross-platform application development framework widely used for developing applications that can run on a wide range of hardware platforms with little to no change in the underlying codebase. If you have basic knowledge of C++ and want to build desktop or mobile applications with a modern graphical user interface (GUI), Qt is the right choice for you. Cross-Platform Development with Qt 6 and Modern C++ helps you understand why Qt is one of the favorite GUI frameworks adopted by industries worldwide, covering the essentials of programming GUI apps across a multitude of platforms using the standard C++17 and Qt 6 features. Starting with the fundamentals of the Qt framework, including the features offered by Qt Creator, this practical guide will show you how to create classic user interfaces using Qt Widgets and touch-friendly user interfaces using Qt Quick. As you advance, you'll explore the Qt Creator IDE for developing applications for multiple desktops as well as for embedded and mobile platforms. You will also learn advanced concepts about signals and slots. Finally, the book takes you through debugging and testing your app with Qt Creator IDE. By the end of this book, you'll be able to build cross-platform applications with a modern GUI along with the speed and power of native apps.

Who is this book for?

This book is for application developers who want to use C++ and Qt to create modern, responsive applications that can be deployed to multiple operating systems such as Microsoft Windows, Apple macOS, and Linux desktop platforms. Although no prior knowledge of Qt is expected, beginner-level knowledge of the C++ programming language and object-oriented programming system (OOPs) concepts will be helpful.

What you will learn

  • Write cross-platform code using the Qt framework to create interactive applications
  • Build a desktop application using Qt Widgets
  • Create a touch-friendly user interface with Qt Quick
  • Develop a mobile application using Qt and deploy it on different platforms
  • Get to grips with Model/View programming with Qt Widgets and Qt Quick
  • Discover Qt's graphics framework and add animations to your user interface
  • Write test cases using the Qt Test framework and debug code
  • Build a translation-aware application
  • Follow best practices in Qt to write high-performance code

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 25, 2021
Length: 442 pages
Edition : 1st
Language : English
ISBN-13 : 9781800208858
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Jun 25, 2021
Length: 442 pages
Edition : 1st
Language : English
ISBN-13 : 9781800208858
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 124.97
C++ High Performance
€44.99
Cross-Platform Development with Qt 6 and Modern C++
€37.99
Software Architecture with C++
€41.99
Total 124.97 Stars icon

Table of Contents

16 Chapters
Section 1: The Basics Chevron down icon Chevron up icon
Chapter 1: Introduction to Qt 6 Chevron down icon Chevron up icon
Chapter 2: Introduction to Qt Creator Chevron down icon Chevron up icon
Chapter 3: GUI Design Using Qt Widgets Chevron down icon Chevron up icon
Chapter 4: Qt Quick and QML Chevron down icon Chevron up icon
Section 2: Cross-Platform Development Chevron down icon Chevron up icon
Chapter 5: Cross-Platform Development Chevron down icon Chevron up icon
Section 3: Advanced Programming, Debugging, and Deployment Chevron down icon Chevron up icon
Chapter 6: Signals and Slots Chevron down icon Chevron up icon
Chapter 7: Model View Programming Chevron down icon Chevron up icon
Chapter 8: Graphics and Animations Chevron down icon Chevron up icon
Chapter 9: Testing and Debugging Chevron down icon Chevron up icon
Chapter 10: Deploying Qt Applications Chevron down icon Chevron up icon
Chapter 11: Internationalization Chevron down icon Chevron up icon
Chapter 12: Performance Considerations Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(32 Ratings)
5 star 71.9%
4 star 3.1%
3 star 9.4%
2 star 6.3%
1 star 9.4%
Filter icon Filter
Top Reviews

Filter reviews by




shreeganesh Aug 14, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
First of all, the book is neatly written and is easy to follow through.The author has touched on many aspects of GUI application development, right from installation of Qt on different platforms and introduction to Qt Creator IDE to deployment of an application and performance considerations.Almost all key concepts such as important widgets, customization of widgets, GUI design with QML, graphics and animation, signals and slots, multithreaded programming, Qt project files, debugging, testing and deployment are included in the book.The things I like the most about this book are screenshots and examples used to convey the concepts which make it much easier to understand than just reading through the text. I think it is important to have multi-language support in any application we create and I was very happy to see a chapter dedicated to integrating translations into our applications.Overall this book is a must for any Qt enthusiast, beginner or otherwise.
Amazon Verified review Amazon
Sandip Jan 24, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I recently picked up Cross-Platform Development with Qt 6 and Modern C++ as a complete newbie to the Qt framework, and I have to say, it has been an incredibly helpful resource for me. The book does an excellent job of introducing the basics of the framework, starting with the architecture and widgets, and building up to more advanced topics such as threading and network programming. The author's explanations are clear and easy to understand, which is especially valuable for someone like me who is still learning the ropes.One of the things I appreciate most about this book is the way it integrates modern C++ concepts. Additionally, the book provides a variety of examples that are easy to follow, which has helped me to gain a better understanding of how the framework works in practice.Overall, I would highly recommend this book to anyone who is new to Qt and looking for a comprehensive introduction to the framework and its capabilities. It's a great resource for learning the basics and more advanced concepts, and the author does a fantastic job of making the material approachable and easy to understand.
Amazon Verified review Amazon
Amazon Customer Aug 01, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book for software developers who are new to Qt and wants to get started quickly on basics of GUI development. Kudos to author for keeping it simple and easy to learn.
Amazon Verified review Amazon
Neha Srivastava Jul 02, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A very good book if you want to start developing UI in Qt.All major topics required for developing and deploying app are covered.Clearly explained topics with images in easy to understand language.Definitely recommended.
Amazon Verified review Amazon
vishal kaushik Sep 27, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Hello everyone,I am writing this review to review this great book which I just finished reading. Having more than 7 years of Qt programming experience, I can confidently say , this is one of the best book, I have read on Qt programming.I was trying to move to Qt6 for a while and this book really came very handy. Having gone through this book end to end , I can say this book is a good resource for somebody who is new to Qt programming or Like me who has several years of Qt programming experience.Examples are very detailed and provide a cleaner usage of the framework.I would highly recommend this book to Qt programmers and non Qt programmers who are thinking of diving into Qt programming.I appreciate the detailed examples written by the author.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.