In this article, you will learn how to add and work with a tab window in your PyQt5 application. Each tab has a different layout and page under a selected tab is displayed, while keeping the others hidden. To select a tab, you need to click the desired tab from the tab bar which is provided by this QTabWidget.
The below article describes the process of creating a sample application that has three tabs and each tab has a different layout.
If you want to add an icon on any tab. You just need to replace
self.tabs.addTab(self.tab1, QIcon("Location of the icon"), ('Geeks'))
and import the
QIcon library from
- PyQt5 QPushButton
- PyQt5 QToolButton
- PyQt5 - QDoubleSpinBox
- PyQt5 - QDateEdit
- PyQt5 - How to get value of Progress Bar ?
- PyQt5 QCheckBox
- Qt Alignment in PyQt5
- PyQt5 - QCalendarWidget
- PyQt5 - Name of Progress Bar
- PyQt5 - QDial
- PyQt5 | How to set value of Progress Bar ?
- PyQt5 - QComboBox
- PyQt5 - QDateTimeEdit
- PyQt5 QRadioButton
- PyQt5 - QTableWidget
- PyQt5 - QColorDialog
- PyQt5 - Skin in Check Box
- PyQt5 QCalendarWidget - Bit Depth
- PyQt5 - Padding in Progress Bar
- PyQt5 QCalendarWidget - Getting First Day of Week
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.