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
Arrow up icon
GO TO TOP
Hands-On Mobile and Embedded Development with Qt 5

You're reading from   Hands-On Mobile and Embedded Development with Qt 5 Build apps for Android, iOS, and Raspberry Pi with C++ and Qt

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789614817
Length 368 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Lorn Potter Lorn Potter
Author Profile Icon Lorn Potter
Lorn Potter
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Making Great UIs
2. Standard Qt Widgets FREE CHAPTER 3. Fluid UI with Qt Quick 4. Graphical and Special Effects 5. Input and Touch 6. Section 2: Networking, Connectivity, Sensors, and Automation
7. Qt Network for Communication 8. Connectivity with Qt Bluetooth LE 9. Machines Talking 10. Where Am I? Location and Positioning 11. Section 3: Other APIs Qt SQL, Qt Multimedia, and Qt Purchasing
12. Sounds and Visions - Qt Multimedia 13. Remote Databases with Qt SQL 14. Enabling In-App Purchases with Qt Purchasing 15. Section 4: Mobile Deployment and Device Creation
16. Cross Compiling and Remote Debugging 17. Deploying to Mobile and Embedded 18. Universal Platform for Mobiles and Embedded Devices 19. Building a Linux System 20. Other Books You May Enjoy

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...

You have been reading a chapter from
Hands-On Mobile and Embedded Development with Qt 5
Published in: Apr 2019
Publisher: Packt
ISBN-13: 9781789614817
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.
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 $19.99/month. Cancel anytime
Banner background image