Learn Qt 5

Build modern, responsive cross-platform desktop applications with Qt, C++, and QML

Nicholas Sherriff


e-books shop
e-books shop
Purchase Now !
Just with Paypal



Book Details
 Price
 3.50 USD
 Pages
 337 p
 File Size
 4,324 KB
 File Type
 PDF format
 ISBN
 978-1-78847-885-4
 Copyright   
 2018 Packt Publishing 

About the Author
Nicholas Sherriff (Nick) spent the majority of his career at a major utility company in the
UK, working predominantly on the Microsoft Windows platform with C#, ASP.NET, and
SQL Server. While leading the native application development function there, he
experimented with C++ before eventually discovering Qt, utilizing it on a major greenfield
project serving several thousand users. He currently works for a communications recording
software house. At home, Nick enjoys music, video games, and half-hearted calisthenics.

About the reviewer
Marthala Vishnu Vardhan Reddy is an enthusiastic software engineer. He is a Qt software
developer and has been working in the automation industry since 2013. He completed his
master's in information technology from the University of Stuttgart, Germany. He is
currently working on the digitization of metal cutting tool data in the manufacturing
industry in the direction of Industry 4.0.

He has done his bachelor's thesis from Institut supérieur d’électronique de Paris, France,
where he published an IEEE publication on 5G networks as well.

Preface
Qt is a mature and powerful framework for delivering sophisticated applications across a
multitude of platforms. It is widely used in embedded devices, including TVs, satellite settop
boxes, medical equipment, car dashboards, and much more. It also has a rich history in
the Linux world, with KDE and Sailfish OS using it extensively and many apps in the stores
being developed using Qt. It has also made great strides in the mobile arena over the past
few years. However, in the Microsoft Windows and Apple macOS X worlds, the dominance
of C#/.NET and Objective-C/Cocoa means that Qt is often overlooked.

This book aims to demonstrate the power and flexibility of the Qt framework and show
how you can write your application once and deploy it to multiple operating system
desktops. The reader will build a complete real-world Line of Business (LOB) solution
from scratch, with distinct library, user interface, and unit test projects.

We will cover building a modern and responsive user interface with QML and wiring it up
to rich C++ classes. We will control every aspect of our project configuration and output
with QMake, including platform detection and conditional expressions. We will build “selfaware”
data entities that can serialize themselves to and from JSON. We will persist those
data entities in a database and learn how to find and update them. We will reach out to the
internet and consume an RSS feed. Finally, we will produce an installation package so that
we can deploy our application onto other machines.

This is a suite of essential techniques that cover the core requirements for most LOB
applications and will empower the reader to progress from blank page to shipped application.

Table of Contents
Preface 1
Chapter 1: Hello Qt 6
Installing Qt 7
Maintaining your installation 13
Qt Creator 13
Scratchpad project 17
qmake 19
Summary 25
Chapter 2: Project Structure 26
Projects, MVC, and unit testing 26
Project creation 28
cm-lib 33
cm-tests 34
cm-ui 34
Mastering MVC 37
QObject 40
QML 43
Project output 47
Summary 55
Chapter 3: User Interface 56
UX 56
Creating views 58
StackView 60
Anchors 62
Sizing 69
Navigation 76
Fixing conflicts 86
Summary 87
Chapter 4: Style 88
Style resource 89
Font Awesome 94
Components 100
Styling the navigation bar 104
Clicking 111
Commands 116
Command bar 122
Summary 128
Chapter 5: Data 129
JSON 129
Object hierarchy 131
DataDecorators 133
Entities 143
Entity collections 147
Data models 154
Custom TextBox 161
Summary 167
Chapter 6: Unit Testing 168
Unit testing 168
The default Qt approach 170
Custom approach 173
DataDecorator tests 181
Entity Tests 187
Mocking 193
Summary 199
Chapter 7: Persistence 201
SQLite 202
Primary keys 210
Creating clients 213
Panels 218
Finding clients 225
Editing clients 237
Deleting clients 241
Summary 245
Chapter 8: Web Requests 246
Network access 246
Web Requests 249
RSS View 255
RSS 259
Summary 277
Chapter 9: Wrapping Up 278
Object factory 278
UI scaling 281
Dashboard 283
Enumerator selectors 285
Contacts 294
Deployment preparation 300
OS X 302
Linux 307
Windows 313
Qt Installer framework 316
Installation 320
Summary 323
Other Books You May Enjoy 325
Index 328


Bookscreen
e-books shop

Who this book is for
This book targets application developers looking for a powerful and flexible framework for
creating modern and responsive applications on Microsoft Windows, Apple Mac OS X, and
Linux desktop platforms. Although focused on desktop application development, the
techniques discussed are largely applicable to mobile development also.
Previous Post Next Post