qtabwidget.sip 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // qtabwidget.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QTabWidget : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qtabwidget.h>
  25. %End
  26. public:
  27. explicit QTabWidget(QWidget *parent /TransferThis/ = 0);
  28. virtual ~QTabWidget();
  29. void clear();
  30. int addTab(QWidget *widget /Transfer/, const QString &);
  31. int addTab(QWidget *widget /Transfer/, const QIcon &icon, const QString &label);
  32. int insertTab(int index, QWidget *widget /Transfer/, const QString &);
  33. int insertTab(int index, QWidget *widget /Transfer/, const QIcon &icon, const QString &label);
  34. void removeTab(int index);
  35. bool isTabEnabled(int index) const;
  36. void setTabEnabled(int index, bool);
  37. QString tabText(int index) const;
  38. void setTabText(int index, const QString &);
  39. QIcon tabIcon(int index) const;
  40. void setTabIcon(int index, const QIcon &icon);
  41. void setTabToolTip(int index, const QString &tip);
  42. QString tabToolTip(int index) const;
  43. void setTabWhatsThis(int index, const QString &text);
  44. QString tabWhatsThis(int index) const;
  45. int currentIndex() const;
  46. QWidget *currentWidget() const;
  47. QWidget *widget(int index) const;
  48. int indexOf(const QWidget *widget) const;
  49. int count() const /__len__/;
  50. enum TabPosition
  51. {
  52. North,
  53. South,
  54. West,
  55. East,
  56. };
  57. QTabWidget::TabPosition tabPosition() const;
  58. void setTabPosition(QTabWidget::TabPosition);
  59. enum TabShape
  60. {
  61. Rounded,
  62. Triangular,
  63. };
  64. QTabWidget::TabShape tabShape() const;
  65. void setTabShape(QTabWidget::TabShape s);
  66. virtual QSize sizeHint() const;
  67. virtual QSize minimumSizeHint() const;
  68. void setCornerWidget(QWidget *widget /Transfer/, Qt::Corner corner = Qt::TopRightCorner);
  69. QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
  70. public slots:
  71. void setCurrentIndex(int index);
  72. void setCurrentWidget(QWidget *widget);
  73. signals:
  74. void currentChanged(int index);
  75. protected:
  76. virtual void initStyleOption(QStyleOptionTabWidgetFrame *option) const;
  77. virtual void tabInserted(int index);
  78. virtual void tabRemoved(int index);
  79. virtual bool event(QEvent *);
  80. virtual void showEvent(QShowEvent *);
  81. virtual void resizeEvent(QResizeEvent *);
  82. virtual void keyPressEvent(QKeyEvent *);
  83. virtual void paintEvent(QPaintEvent *);
  84. void setTabBar(QTabBar * /Transfer/);
  85. public:
  86. QTabBar *tabBar() const;
  87. protected:
  88. virtual void changeEvent(QEvent *);
  89. public:
  90. Qt::TextElideMode elideMode() const;
  91. void setElideMode(Qt::TextElideMode);
  92. QSize iconSize() const;
  93. void setIconSize(const QSize &size);
  94. bool usesScrollButtons() const;
  95. void setUsesScrollButtons(bool useButtons);
  96. bool tabsClosable() const;
  97. void setTabsClosable(bool closeable);
  98. bool isMovable() const;
  99. void setMovable(bool movable);
  100. bool documentMode() const;
  101. void setDocumentMode(bool set);
  102. signals:
  103. void tabCloseRequested(int index);
  104. public:
  105. virtual int heightForWidth(int width) const;
  106. virtual bool hasHeightForWidth() const;
  107. signals:
  108. void tabBarClicked(int index);
  109. void tabBarDoubleClicked(int index);
  110. public:
  111. bool tabBarAutoHide() const;
  112. void setTabBarAutoHide(bool enabled);
  113. bool isTabVisible(int index) const;
  114. void setTabVisible(int index, bool visible);
  115. };