Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Hands-On Mobile and Embedded Development with Qt 5
Hands-On Mobile and Embedded Development with Qt 5

Hands-On Mobile and Embedded Development with Qt 5: Build apps for Android, iOS, and Raspberry Pi with C++ and Qt

eBook
€17.99 €26.99
Paperback
€32.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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Hands-On Mobile and Embedded Development with Qt 5

Standard Qt Widgets

Qt Widgets are not the new kid on the block, but they still do have their place in applications that target mobile and embedded devices. They are well formed, predictable and have standard UI elements.

Recognizable UI elements are found in Qt Widgets and work great on laptops, which are simply mobile desktops. In this chapter, you will learn to design standard looking applications. Basic widgets such as menus, icons, and lists will be discussed with an emphasis on how to constrain the user interface to medium and small-sized displays. Topics we will discuss include how to use Qt's dynamic layouts to handle orientation changes. Classes such as QGraphicsScene, QGraphicsView, and QGraphicsItem will be used. Layout API such as QVBoxLayout, QGridLayout, and QStackedLayout will be discussed.

In this chapter we will cover:

  • Using Qt Creator and...

Hello mobile!

So you want to develop apps for mobile and embedded devices using Qt. Excellent choice, as Qt was made for cross-platform development. To get you started, we will run through the basic procedure of using Qt Creator to create, build and run an application. We will briefly examine different aspects to consider when creating mobile and embedded apps, such as how to use Qt Creator to add a menu. Adding a QWidget in the designer is not that difficult, and I will show you how.

Qt has a long history of running on mobile devices, starting with Qt Embedded, which was initially released in 2000. Qt Embedded was the base framework for the UI Qtopia, which was initially released on the Sharp Zaurus on the SL-5000D developer edition.

These days, you can develop an application using Qt and sell it in the iOS App Store, Android Google Play store, or other Linux mobile phones. Qt...

Going smaller, handling screen sizes

Porting applications which were developed for the desktop to run on smaller mobile devices can be a daunting task, depending on the application. Even creating new apps for mobiles, a few considerations need to be made, such as differences in screen resolution, memory constraints, and handling orientation changes. Touch screens add another fantastic way to offer touch gestures and can be challenging due to the differences in the size of a finger as point compared to a mouse pointer. Then there are sensors, GPS and networking to contemplate! 

Screen resolution

As you can see in the previous images in the Add QListView section, the application paradigms are fairly different...

Dynamic layouts

Considering that mobile phones come in all shapes and sizes, it would be ridiculous to need to provide a different package for every different screen resolution. Hence we will use dynamic layouts.

The source code can be found on the Git repository under the Chapter01-layouts directory, in the cp1 branch.

Qt Widgets have support for this using classes such as QVBoxLayout and QGridLayout.

Qt Creator's designer is the easiest way to develop dynamic layouts. Let's go through how we can do that.

To set up a layout, we position a widget on the application form, and press Command or Control on the keyboard while selecting the widgets that we want to put in a layout. Here are two QPushButtons selected for use:

Next, click on the Horizontal Layout icon highlighted here:

You will then see the two widgets enclosed by a thin...

Graphics view

QGraphicsView, QGraphicScene and QGraphicsItem provide a way for applications based on Qt Widgets to show 2D graphics.

The source code can be found on the Git repository under the Chapter01-graphicsview directory, in the cp1 branch.

Every QGraphicsView needs a QGraphicsScene. Every QGraphicsScene needs one or more QGraphicsItem.

QGraphicsItem can be any of the following: 

  • QGraphicsEllipseItem
  • QGraphicsLineItem
  • QGraphicsLineItem
  • QGraphicsPathItem
  • QGraphicsPixmapItem
  • QGraphicsPolygonItem
  • QGraphicsRectItem
  • QGraphicsSimpleTextItem
  • QGraphicsTextItem

Qt Designer has support for adding QGraphicsView . You can follow these steps to do so:

  1. Drag the QGraphicsView to a new application form and fill the form with a QGridLayout like we did before.

  1. Implement a QGraphicsScene in the source code and add it to the QGraphicsView
QGraphicsScene...

Summary

In this chapter we covered some of the issues facing mobile and embedded developers when trying to develop for smaller display devices, and how  QStyleSheets can be used to change the interface at runtime to adapt itself for using touchscreen inputs.

We discussed storage and memory space requirements, and the need to configure unneeded features out of Qt to make it have a smaller footprint.

We went through handling orientation changes and discussed using screen gestures such as Pinch and Swipe.

We learning how to use Qt Designer to add QLayouts to create dynamically resizing applications.

Finally, we discussed how to use QGraphicsView to utilize graphical elements such as graphical text and images.

Next, we will go through the next best thing since sliced bread for mobile and embedded development—Qt Quick and QML. Then we&apos...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Build cross-platform applications and deploy them across mobile and connected devices
  • Design 2D and 3D UIs for embedded systems using Yocto and Qt Creator
  • Build machine to machine automation solution using QtSensors, QtMQTT, and QtWebSockets

Description

Qt is a world-class framework, helping you to develop rich graphical user interfaces (GUIs) and multi-platform applications that run on all major desktop platforms and most mobile or embedded platforms. The framework helps you connect the dots across platforms and between online and physical experience. This book will help you leverage the fully-featured Qt framework and its modular cross-platform library classes and intuitive APIs to develop applications for mobile, IoT, and industrial embedded systems. Considerations such as screen size, device orientation changes, and small memory will be discussed. We will focus on various core aspects of embedded and mobile systems, such as connectivity, networking, and sensors; there is no IoT without sensors. You will learn how to quickly design a flexible, fast, and responsive UI that looks great. Going further, you will implement different elements in a matter of minutes and synchronize the UI elements with the 3D assets with high precision. You will learn how to create high-performance embedded systems with 3D/2D user interfaces, and deploy and test on your target hardware. The book will explore several new features, including Qt for WebAssembly. At the end of this book, you will learn about creating a full software stack for embedded Linux systems using Yocto and Boot to Qt for Device Creation.

Who is this book for?

The book is ideal for mobile developers, embedded systems engineers and enthusiasts who are interested in building cross-platform applications with Qt. Prior knowledge of C++ is required.

What you will learn

  • Explore the latest features of Qt, such as preview for Qt for Python and Qt for WebAssembly
  • Create fluid UIs with a dynamic layout for different sized screens
  • Deploy embedded applications on Linux systems using Yocto
  • Design Qt APIs for building applications for embedded and mobile devices
  • Utilize connectivity for networked and machine automated applications
  • Discover effective techniques to apply graphical effects using Qt Quick apps

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 30, 2019
Length: 368 pages
Edition : 1st
Language : English
ISBN-13 : 9781789618488
Category :
Languages :
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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 30, 2019
Length: 368 pages
Edition : 1st
Language : English
ISBN-13 : 9781789618488
Category :
Languages :
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 98.97
Hands-On Embedded Programming with Qt
€32.99
Hands-On Mobile and Embedded Development with Qt 5
€32.99
Qt5 C++ GUI Programming Cookbook
€32.99
Total 98.97 Stars icon
Banner background image

Table of Contents

20 Chapters
Section 1: Making Great UIs Chevron down icon Chevron up icon
Standard Qt Widgets Chevron down icon Chevron up icon
Fluid UI with Qt Quick Chevron down icon Chevron up icon
Graphical and Special Effects Chevron down icon Chevron up icon
Input and Touch Chevron down icon Chevron up icon
Section 2: Networking, Connectivity, Sensors, and Automation Chevron down icon Chevron up icon
Qt Network for Communication Chevron down icon Chevron up icon
Connectivity with Qt Bluetooth LE Chevron down icon Chevron up icon
Machines Talking Chevron down icon Chevron up icon
Where Am I? Location and Positioning Chevron down icon Chevron up icon
Section 3: Other APIs Qt SQL, Qt Multimedia, and Qt Purchasing Chevron down icon Chevron up icon
Sounds and Visions - Qt Multimedia Chevron down icon Chevron up icon
Remote Databases with Qt SQL Chevron down icon Chevron up icon
Enabling In-App Purchases with Qt Purchasing Chevron down icon Chevron up icon
Section 4: Mobile Deployment and Device Creation Chevron down icon Chevron up icon
Cross Compiling and Remote Debugging Chevron down icon Chevron up icon
Deploying to Mobile and Embedded Chevron down icon Chevron up icon
Universal Platform for Mobiles and Embedded Devices Chevron down icon Chevron up icon
Building a Linux System Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Eduardo Hiroshi Nakamura Nov 03, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Interessante as plataformas que o QT roda.
Amazon Verified review Amazon
Maxim Rozhkov Nov 16, 2019
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The most important words in the title are «Hands-on», that means the book gives an opportunity to sneak peek a lot of the Qt 5 features. It covers the most brilliants laying on the basis of the Qt 5, from Qt Quick topics, through gesture control, REST API, Bluetooth and to the Qt for WebAssembly at the end. It can’t give you deep understanding of how Qt works, because of vastness of the Qt World, but after reading you will be much more aware of all those brilliants of the framework. I really loved the book. Only two things prevent the highest score of the book: there are a lot of errors in examples of code and the narrative is a little bit verbose sometimes.
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.