Tabs can be added to a QTabWidget
. The QTabWidget
can be added to a layout and the layout to the window.
There can be any amount of tabs. The example below shows tabs added ta qt window.
image: tabs showing in a pyqt window.
Related Course: Create GUI Apps with Python PyQt5
Tab example
PyQt tabs example
Run the code below to see a tab widget in a pyqt window. Navigating between the tabs shows the widgets added to the tab.
To add a tab to a QTabWidget
, call the method .addTab()
.
1 | from PyQt5.QtCore import * |