1// qtabwidget.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QTabWidget : QWidget 24{ 25%TypeHeaderCode 26#include <qtabwidget.h> 27%End 28 29public: 30 explicit QTabWidget(QWidget *parent /TransferThis/ = 0); 31 virtual ~QTabWidget(); 32 void clear(); 33 int addTab(QWidget *widget /Transfer/, const QString &); 34 int addTab(QWidget *widget /Transfer/, const QIcon &icon, const QString &label); 35 int insertTab(int index, QWidget *widget /Transfer/, const QString &); 36 int insertTab(int index, QWidget *widget /Transfer/, const QIcon &icon, const QString &label); 37 void removeTab(int index); 38 bool isTabEnabled(int index) const; 39 void setTabEnabled(int index, bool); 40 QString tabText(int index) const; 41 void setTabText(int index, const QString &); 42 QIcon tabIcon(int index) const; 43 void setTabIcon(int index, const QIcon &icon); 44 void setTabToolTip(int index, const QString &tip); 45 QString tabToolTip(int index) const; 46 void setTabWhatsThis(int index, const QString &text); 47 QString tabWhatsThis(int index) const; 48 int currentIndex() const; 49 QWidget *currentWidget() const; 50 QWidget *widget(int index) const; 51 int indexOf(QWidget *widget) const; 52 int count() const /__len__/; 53 54 enum TabPosition 55 { 56 North, 57 South, 58 West, 59 East, 60 }; 61 62 QTabWidget::TabPosition tabPosition() const; 63 void setTabPosition(QTabWidget::TabPosition); 64 65 enum TabShape 66 { 67 Rounded, 68 Triangular, 69 }; 70 71 QTabWidget::TabShape tabShape() const; 72 void setTabShape(QTabWidget::TabShape s); 73 virtual QSize sizeHint() const; 74 virtual QSize minimumSizeHint() const; 75 void setCornerWidget(QWidget *widget /Transfer/, Qt::Corner corner = Qt::TopRightCorner); 76 QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const; 77 78public slots: 79 void setCurrentIndex(int index); 80 void setCurrentWidget(QWidget *widget); 81 82signals: 83 void currentChanged(int index); 84 85protected: 86 void initStyleOption(QStyleOptionTabWidgetFrame *option) const; 87 virtual void tabInserted(int index); 88 virtual void tabRemoved(int index); 89 virtual bool event(QEvent *); 90 virtual void showEvent(QShowEvent *); 91 virtual void resizeEvent(QResizeEvent *); 92 virtual void keyPressEvent(QKeyEvent *); 93 virtual void paintEvent(QPaintEvent *); 94 void setTabBar(QTabBar * /Transfer/); 95 96public: 97 QTabBar *tabBar() const; 98 99protected: 100 virtual void changeEvent(QEvent *); 101 102public: 103 Qt::TextElideMode elideMode() const; 104 void setElideMode(Qt::TextElideMode); 105 QSize iconSize() const; 106 void setIconSize(const QSize &size); 107 bool usesScrollButtons() const; 108 void setUsesScrollButtons(bool useButtons); 109 bool tabsClosable() const; 110 void setTabsClosable(bool closeable); 111 bool isMovable() const; 112 void setMovable(bool movable); 113 bool documentMode() const; 114 void setDocumentMode(bool set); 115 116signals: 117 void tabCloseRequested(int index); 118 119public: 120 virtual int heightForWidth(int width) const; 121 virtual bool hasHeightForWidth() const; 122 123signals: 124%If (Qt_5_2_0 -) 125 void tabBarClicked(int index); 126%End 127%If (Qt_5_2_0 -) 128 void tabBarDoubleClicked(int index); 129%End 130 131public: 132%If (Qt_5_4_0 -) 133 bool tabBarAutoHide() const; 134%End 135%If (Qt_5_4_0 -) 136 void setTabBarAutoHide(bool enabled); 137%End 138%If (Qt_5_15_0 -) 139 bool isTabVisible(int index) const; 140%End 141%If (Qt_5_15_0 -) 142 void setTabVisible(int index, bool visible); 143%End 144}; 145