Reader small image

You're reading from  Application Development with Qt Creator - Third Edition

Product typeBook
Published inJan 2020
Reading LevelBeginner
Publisher
ISBN-139781789951752
Edition3rd Edition
Languages
Right arrow
Author (1)
Lee Zhi Eng
Lee Zhi Eng
author image
Lee Zhi Eng

Lee Zhi Eng is a self-taught programmer who worked as an artist and programmer at several game studios before becoming a part-time lecturer for 2 years at a university, teaching game development subjects related to Unity and Unreal Engine. He has not only taken part in various projects related to games, interactive apps, and virtual reality but has also participated in multiple projects that are more oriented toward software and system development. When he is not writing code, he enjoys traveling, photography, and exploring new technologies.
Read more about Lee Zhi Eng

Right arrow

Preface

This latest version of this Qt Creator book provides an in-depth understanding of Qt's massive library and its functionality. Qt is a powerful development framework that serves as a complete toolset for building cross-platform applications, helping you to reduce development time and improve productivity.

This Qt programming book takes you through Qt Creator's latest features, such as Qt Quick Controls 2, enhanced CMake support, a new graphical editor for SCXML, and a model editor. You'll start by designing a user interface, work with multimedia and sensors using Qt Quick, and finally develop applications for mobile, IoT, and embedded devices using Qt Creator. After reading through, you will be able to build a solid foundation in Qt by learning about its core features and create your own cross-platform applications from scratch using Qt Creator and the C++ programming language.

Who this book is for

This book is for beginners and experienced programmers alike who want to dive into GUI programming using the powerful Qt development tools and libraries. This book is suitable for hardcore programmers who are used to object-oriented programming in the C++ language, as well as those who are design-oriented and just trying to learn how to create beautiful and intuitive GUI using Qt Quick.

What this book covers

Chapter 1, Getting Started with Qt Creator, covers everything you need in order to get started downloading Qt Creator for Linux, macOS X, and Windows. We will also see how to ensure that your basic configuration is running and take a quick look at a simple QtGui application as well as a Qt Quick application.

Chapter 2, Building Applications with Qt Creator, explains how to add files to a project, how to create libraries in a project, and how to use the debugger and the console logger.

Chapter 3, Designing Your Application with Qt Designer, covers Qt's notion of signals and slots, explaining how to create user interfaces with Qt Designer. We will also see how to instantiate forms, messages, and dialogs.

Chapter 4, Qt Foundations, discusses some of Qt's core classes that you will find especially handy while writing your applications. We will begin with useful data classes and look at Qt's support for multithreading, a key tool in ensuring applications feel responsive. We will look at file and HTTP I/O, an important component in many applications. We will also learn how to use Qt's XML parser to create networked applications and to load XML data from the filesystem.

Chapter 5, Developing Applications with Qt Widgets, introduces GUI programming using Qt Widgets. You will learn basic application management, how to create dialogs and error popups, and other major GUI elements. We will also have a look at Qt's flexible layout system, the Model-View-Controller paradigm, and how to use it in Qt for complex controls such as lists and tree views. We will also have a quick look at Qt's support for WebKit.

Chapter 6, Drawing with Qt, explains how to do a general drawing in Qt. We will implement concrete examples of offscreen drawings for bitmaps, as well as creating custom widgets that interoperate with Qt Widgets. We will also discuss a newer and lower level of abstraction that Qt provides for graphics management – the graphics view/graphics scene architecture.

Chapter 7, Doing More with Qt Quick, looks at Qt Quick in more detail. We will look at fundamental Qt Quick constructs to display shapes, images, and text, as well as how to manage user events. You will also be introduced to the Qt Quick Transition Framework and New Graphical Editor for SCXML. You will also learn how to integrate C++ with Qt Quick.

Chapter 8, Implementing Multimedia with Qt Quick, examines Qt Quick's support for multimedia. We will look at various QT Quick components that provide access to audio and video playbacks, and how to access the camera.

Chapter 9, Sensors and Qt Quick, looks at Qt's sensor and positioning frameworks as they're supported in QML. You will learn how to determine a device's position on the surface of the earth and how to measure the other characteristics of its environment, as reported by its onboard sensors.

Chapter 10, Localizing Your Application with Qt Linguist, explains the task of localization and discusses various tools that QT provides for localization.

Chapter 11, Optimizing Performance with Qt Creator, covers how to perform the runtime profiling of QML applications using the QML performance analyzer and explains how to read the reports it generates.

Chapter 12, Developing Mobile Applications with Qt Creator, explains how to write a mobile application and how Qt offers better support for iOS and Android applications.

Chapter 13, Embedded and IoT development with QT Creator, describes how to create optimized Qt applications specifically designed for embedded devices.

Chapter 14, Qt Tips and Tricks, introduces a collection of tips and tricks that you should be familiar with when using Qt Creator and Qt.

To get the most out of this book

Although no prior knowledge of Qt and Qt Creator is required, it would be beneficial to have basic knowledge of C++ programming.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit https://www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Application-Development-with-Qt-Creator-Third-Edition. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Set the event attribute of the send executable content of red as goGreen and set its delay as 2s."

A block of code is set as follows:

Window {
visible: true
width: 360
height: 360
Rectangle {

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

#include <QQmlContext> 
#include "nativeobject.h"

int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);

Any command-line input or output is written as follows:

qmake -project

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The following screenshot shows you where to set the values on the Attributes window."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit https://www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Application Development with Qt Creator - Third Edition
Published in: Jan 2020Publisher: ISBN-13: 9781789951752
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Lee Zhi Eng

Lee Zhi Eng is a self-taught programmer who worked as an artist and programmer at several game studios before becoming a part-time lecturer for 2 years at a university, teaching game development subjects related to Unity and Unreal Engine. He has not only taken part in various projects related to games, interactive apps, and virtual reality but has also participated in multiple projects that are more oriented toward software and system development. When he is not writing code, he enjoys traveling, photography, and exploring new technologies.
Read more about Lee Zhi Eng