May 2019
Intermediate to advanced
542 pages
13h 37m
English
QTabWidget, sometimes known as a notebook widget in other toolkits, allows us to have multiple pages selectable by tabs. They're very useful for breaking complex interfaces into smaller chunks that are easier for users to take in.
The workflow for using QTabWidget is as follows:
Let's try that; first, create the tab widget:
tab_widget = qtw.QTabWidget() layout.addWidget(tab_widget)
Next, let's move the grid_layout we built under the Placing and arranging widgets section to a container widget:
container = qtw.QWidget(self) grid_layout = qtw.QGridLayout() # comment out this line: ...
Read now
Unlock full access