{"id":5071,"date":"2022-09-23T03:27:52","date_gmt":"2022-09-23T03:27:52","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=5071"},"modified":"2022-10-29T08:02:18","modified_gmt":"2022-10-29T08:02:18","slug":"pyqt-qtabwidget","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/pyqt\/pyqt-qtabwidget\/","title":{"rendered":"PyQt QTabWidget"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the PyQt <code>QTabWidget<\/code> to create a tab widget.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-pyqt-qtabwidget'>Introduction to the PyQt QTabWidget <a href=\"#introduction-to-the-pyqt-qtabwidget\" class=\"anchor\" id=\"introduction-to-the-pyqt-qtabwidget\" title=\"Anchor for Introduction to the PyQt QTabWidget\">#<\/a><\/h2>\n\n\n\n<p>Tabs allow you to display related information on separate labeled pages. Tabs are useful for dividing complex interfaces into smaller pages that are easier for users to digest.<\/p>\n\n\n\n<p>To create a tab widget, you use the <code><code>QTabWidget<\/code><\/code> class. The steps for using the <code><code>QTabWidget<\/code><\/code> is as follows:<\/p>\n\n\n\n<p>First, create the <code>QTabWidget<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget()\nlayout.addWidget(tab)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, create a page by using the <code><code>QWidget<\/code><\/code> object as the container and add child widgets to the <code><code><a href=\"https:\/\/www.pythontutorial.net\/pyqt\/pyqt-qwidget\/\">QWidget<\/a><\/code><\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">page = QWidget(tab)\npage_layout = QGridLayout()\npage.setLayout(page_layout)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, add a page to the tab widget using the <code>addTab()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.addTab(page,<span class=\"hljs-string\">'Tab title'<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, repeat the second and third steps to add more pages to the tab.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='pyqt-qtabwidget-example'>PyQt QTabWidget example <a href=\"#pyqt-qtabwidget-example\" class=\"anchor\" id=\"pyqt-qtabwidget-example\" title=\"Anchor for PyQt QTabWidget example\">#<\/a><\/h2>\n\n\n\n<p>The following example illustrates how to create a tab widget with two pages:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> sys\n<span class=\"hljs-keyword\">from<\/span> PyQt6.QtWidgets <span class=\"hljs-keyword\">import<\/span> QApplication, QWidget,  QFormLayout, QGridLayout, QTabWidget, QLineEdit, QDateEdit, QPushButton\n<span class=\"hljs-keyword\">from<\/span> PyQt6.QtCore <span class=\"hljs-keyword\">import<\/span> Qt\n\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MainWindow<\/span><span class=\"hljs-params\">(QWidget)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, *args, **kwargs)<\/span>:<\/span>\n        super().__init__(*args, **kwargs)\n\n        self.setWindowTitle(<span class=\"hljs-string\">'PyQt QTabWidget'<\/span>)\n\n        main_layout = QGridLayout(self)\n        self.setLayout(main_layout)\n\n        <span class=\"hljs-comment\"># create a tab widget<\/span>\n        tab = QTabWidget(self)\n\n        <span class=\"hljs-comment\"># personal page<\/span>\n        personal_page = QWidget(self)\n        layout = QFormLayout()\n        personal_page.setLayout(layout)\n        layout.addRow(<span class=\"hljs-string\">'First Name:'<\/span>, QLineEdit(self))\n        layout.addRow(<span class=\"hljs-string\">'Last Name:'<\/span>, QLineEdit(self))\n        layout.addRow(<span class=\"hljs-string\">'DOB:'<\/span>, QDateEdit(self))\n\n        <span class=\"hljs-comment\"># contact pane<\/span>\n        contact_page = QWidget(self)\n        layout = QFormLayout()\n        contact_page.setLayout(layout)\n        layout.addRow(<span class=\"hljs-string\">'Phone Number:'<\/span>, QLineEdit(self))\n        layout.addRow(<span class=\"hljs-string\">'Email Address:'<\/span>, QLineEdit(self))\n\n        <span class=\"hljs-comment\"># add pane to the tab widget<\/span>\n        tab.addTab(personal_page, <span class=\"hljs-string\">'Personal Info'<\/span>)\n        tab.addTab(contact_page, <span class=\"hljs-string\">'Contact Info'<\/span>)\n\n        main_layout.addWidget(tab, <span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">1<\/span>)\n        main_layout.addWidget(QPushButton(<span class=\"hljs-string\">'Save'<\/span>), <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">0<\/span>,\n                              alignment=Qt.AlignmentFlag.AlignLeft)\n        main_layout.addWidget(QPushButton(<span class=\"hljs-string\">'Cancel'<\/span>), <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">0<\/span>,\n                              alignment=Qt.AlignmentFlag.AlignRight)\n\n        self.show()\n\n\n<span class=\"hljs-keyword\">if<\/span> __name__ == <span class=\"hljs-string\">'__main__'<\/span>:\n    app = QApplication(sys.argv)\n    window = MainWindow()\n    sys.exit(app.exec())<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"402\" height=\"306\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQT-QTabWidget.png\" alt=\"\" class=\"wp-image-5073\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQT-QTabWidget.png 402w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQT-QTabWidget-300x228.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/figure>\n\n\n\n<p>How it works. (We&#8217;ll focus on the tab widget construction only)<\/p>\n\n\n\n<p>First, create a tab widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget(self)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Next, create a page using the <code>QWidget<\/code> and set its layout to a <code><a href=\"https:\/\/www.pythontutorial.net\/pyqt\/pyqt-qformlayout\/\">QFormLayout<\/a><\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">personal_page = QWidget(self)\nlayout = QFormLayout()\npersonal_page.setLayout(layout)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Then, add <code>QLineEdit<\/code> widgets to the <code>person_page<\/code> widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">layout.addRow(<span class=\"hljs-string\">'First Name:'<\/span>, QLineEdit(self))\nlayout.addRow(<span class=\"hljs-string\">'Last Name:'<\/span>, QLineEdit(self))\nlayout.addRow(<span class=\"hljs-string\">'DOB:'<\/span>, QDateEdit(self))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>After that, create a new page that holds the fields for contact information:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">contact_page = QWidget(self)\nlayout = QFormLayout()\ncontact_page.setLayout(layout)\nlayout.addRow(<span class=\"hljs-string\">'Phone Number:'<\/span>, QLineEdit(self))\nlayout.addRow(<span class=\"hljs-string\">'Email Address:'<\/span>, QLineEdit(self))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, add pages to the tab using the <code>add_tab()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.addTab(personal_page, <span class=\"hljs-string\">'Personal Info'<\/span>)\ntab.addTab(contact_page, <span class=\"hljs-string\">'Contact Info'<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='qtabwidget-options'>QTabWidget options <a href=\"#qtabwidget-options\" class=\"anchor\" id=\"qtabwidget-options\" title=\"Anchor for QTabWidget options\">#<\/a><\/h2>\n\n\n\n<p>The <code>QTabWidget<\/code> has some notable options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='movable'>Movable <a href=\"#movable\" class=\"anchor\" id=\"movable\" title=\"Anchor for Movable\">#<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"303\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWiget-Movable-Option.gif\" alt=\"\" class=\"wp-image-5074\"\/><\/figure>\n\n\n\n<p>To make the tab movable, you set the <code>movable<\/code> property to <code>True<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget(self,movable=<span class=\"hljs-literal\">True<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that you can initialize the movable property when creating the tab widget.<\/p>\n\n\n\n<p>Or you can use the <code>setMovable()<\/code> method of the tab widget object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.setMovable(<span class=\"hljs-literal\">True<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='tabsclosable'>tabsClosable <a href=\"#tabsclosable\" class=\"anchor\" id=\"tabsclosable\" title=\"Anchor for tabsClosable\">#<\/a><\/h3>\n\n\n\n<p>If the <code>tabsClosble<\/code> is true, the tabs will display a close button on tabs.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget(self,tabsClosable=<span class=\"hljs-literal\">True<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"402\" height=\"307\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWiget-Close-Button.png\" alt=\"\" class=\"wp-image-5075\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWiget-Close-Button.png 402w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWiget-Close-Button-300x229.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/figure>\n\n\n\n<p>Or you can use the <code>setTabsClosable()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.setTabsClosable(<span class=\"hljs-literal\">True<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When the close button is clicked, the <code>QTabWidget<\/code> emits the <code>tabCloseRequested<\/code> signal. If you want to close the tab, you need to connect to this signal and implement the code to close the corresponding tab.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='tab-shape'>Tab shape <a href=\"#tab-shape\" class=\"anchor\" id=\"tab-shape\" title=\"Anchor for Tab shape\">#<\/a><\/h3>\n\n\n\n<p>The tab has two shapes rounded &amp; triangular. The rounded is the default. <\/p>\n\n\n\n<p>To set the tab shape, you can use the <code>tabShape<\/code> argument when creating a new tab widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget(self, tabShape=QTabWidget.TabShape.Triangular)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Or you can use the <code>setTabShape()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.setTabShape(QTabWidget.TabShape.Triangular)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"298\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWidget-TabShape.png\" alt=\"PyQt QTabWidget TabShape\" class=\"wp-image-5076\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWidget-TabShape.png 404w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/09\/PyQt-QTabWidget-TabShape-300x221.png 300w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='tab-positions'>Tab positions <a href=\"#tab-positions\" class=\"anchor\" id=\"tab-positions\" title=\"Anchor for Tab positions\">#<\/a><\/h3>\n\n\n\n<p>Tabs can have four positions determined by the <code>TabPosition<\/code> enum:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>North<\/li><li>South<\/li><li>West<\/li><li>East <\/li><\/ul>\n\n\n\n<p>To set the tab position, you can use the <code>tabPosition<\/code> argument when creating the tab widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab = QTabWidget(self, tabPosition=QTabWidget.TabPosition.West)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Or you can use the <code>setTabPosition()<\/code> method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">tab.setTabPosition(QTabWidget.TabPosition.West)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use the <code>QTabWidget<\/code> to create a tab widget.<\/li><li>Tabs can be movable, closable, and have different positions.<\/li><\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"5071\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/pyqt\/pyqt-qtabwidget\/\"\n\t\t\t\tdata-post-title=\"PyQt QTabWidget\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"5071\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/pyqt\/pyqt-qtabwidget\/\"\n\t\t\t\tdata-post-title=\"PyQt QTabWidget\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to use the PyQt QTabWidget to create a tab widget<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":4862,"menu_order":18,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5071","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=5071"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5071\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/4862"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=5071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}