Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Layout

Before we add another widget, we must learn about the concept of layout. We will use two layouts, which are QHBoxLayout and QVBoxLayout. These two layouts are enough to create a GUI application. There are other layouts, such as QGridLayout and QFormLayout, among many others, but we do not need them. QHBoxLayout and QVBoxLayout are like flexbox in CSS. You place widgets in a container that uses QHBoxLayout, and then all widgets will be put in a horizontal line. Let's take a look at an example. Name this script hello_horizontal_layout.py:

import sysfrom PySide2.QtWidgets import QApplication, QWidget, QHBoxLayout, QPushButton, QLabelapp = QApplication(sys.argv)hello_button = QPushButton('Hello')very_label = QLabel('Very Very')beautiful_button ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content