Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Qt 5

You're reading from   Getting Started with Qt 5 Introduction to programming Qt 5 for cross-platform application development

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789956030
Length 136 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Benjamin Baka Benjamin Baka
Author Profile Icon Benjamin Baka
Benjamin Baka
Arrow right icon
View More author details
Toc

Layouts

Up to this point, we have been creating applications that only have one widget serving as the main component and, by extension, a window too. However, GUI applications are usually made up of several widgets that come together to communicate a process to the user. One way in which we can make use of multiple widgets is to use layouts to serve as the canvas into which we insert our widgets.

Consider the following class inheritance diagram:

It is important to consider the classes used in laying out widgets. As usual, the top class from which the QLayout abstract class inherits is QObject. Also, QLayout makes use of multiple inheritances by inheriting from QLayoutItem. The concrete classes here are QBoxLayout, QFormLayout, QGridLayout, and QStackedLayout. QHBoxLayout and QVBoxLayout further refine what the QBoxLayout class is by adding orientation to how the widgets within...

lock icon The rest of the chapter is locked
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 €18.99/month. Cancel anytime