A groupbox and grid can be created with PyQt. It works like this:
A PyQt5 window can contain a grid.
A grid can contain any number of groups
groups can contain widgets (buttons, texts, images).
A grid can be created with the class QGridLayout. As you’d expect, the grid layout has to be added to the window. A groupbox is created with the class QGroupBox.
The code below creates a 2x2 groupbox in a window. We create a groupbox using QGridLayout. This in turn can have widgets. Widgets are added using the method addWidget(widget, x,y).
# https://pythonprogramminglanguage.com/pyqt5-groupbox/ import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QApplication, QCheckBox, QGridLayout, QGroupBox, QMenu, QPushButton, QRadioButton, QVBoxLayout, QWidget)