layout management in PySide2

Qt has Layout System. PySdie2 is wrapper of Qt5 for python. so that PySide2 supports Qt Layout System.

in this page, I will what is the layout system and why we should learn it. and I will introduce them shortly.

layout system is a simple and easy way to arrange child widgets automatically. Qt provide a few layout classes that layouts automatically position and resize width and height of widgets when the children are changed.

they are in charge of below tasks.


  • Positioning of child widgets
  • Sensible default sizes for windows
  • Sensible minimum sizes for windows
  • Resize handling
  • Automatic updates when contents change:
    • Font size, text or other contents of child widgets
    • Hiding or showing a child widget
    • Removal of child widgets

typically, there are 4 types of layout management classes.

QHBoxLayout
QVBoxLayout
GRidLayout
QFormLayout

they inherit QLayout class. if you need more complex layout, you can nest them inside each other.

I mainly focused what layout management is in this page.
after this, I will introduce how to use them one by one with example code.


Comments

Popular posts from this blog

making menubar and menu on QML

QSizePolicy Fixed example in pyside2