qtabbar.sip 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. // qtabbar.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 QTabBar : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qtabbar.h>
  25. %End
  26. public:
  27. explicit QTabBar(QWidget *parent /TransferThis/ = 0);
  28. virtual ~QTabBar();
  29. enum Shape
  30. {
  31. RoundedNorth,
  32. RoundedSouth,
  33. RoundedWest,
  34. RoundedEast,
  35. TriangularNorth,
  36. TriangularSouth,
  37. TriangularWest,
  38. TriangularEast,
  39. };
  40. QTabBar::Shape shape() const;
  41. void setShape(QTabBar::Shape shape);
  42. int addTab(const QString &text);
  43. int addTab(const QIcon &icon, const QString &text);
  44. int insertTab(int index, const QString &text);
  45. int insertTab(int index, const QIcon &icon, const QString &text);
  46. void removeTab(int index);
  47. bool isTabEnabled(int index) const;
  48. void setTabEnabled(int index, bool);
  49. QString tabText(int index) const;
  50. void setTabText(int index, const QString &text);
  51. QColor tabTextColor(int index) const;
  52. void setTabTextColor(int index, const QColor &color);
  53. QIcon tabIcon(int index) const;
  54. void setTabIcon(int index, const QIcon &icon);
  55. void setTabToolTip(int index, const QString &tip);
  56. QString tabToolTip(int index) const;
  57. void setTabWhatsThis(int index, const QString &text);
  58. QString tabWhatsThis(int index) const;
  59. void setTabData(int index, const QVariant &data);
  60. QVariant tabData(int index) const;
  61. int tabAt(const QPoint &pos) const;
  62. QRect tabRect(int index) const;
  63. int currentIndex() const;
  64. int count() const /__len__/;
  65. virtual QSize sizeHint() const;
  66. virtual QSize minimumSizeHint() const;
  67. void setDrawBase(bool drawTheBase);
  68. bool drawBase() const;
  69. QSize iconSize() const;
  70. void setIconSize(const QSize &size);
  71. Qt::TextElideMode elideMode() const;
  72. void setElideMode(Qt::TextElideMode);
  73. void setUsesScrollButtons(bool useButtons);
  74. bool usesScrollButtons() const;
  75. public slots:
  76. void setCurrentIndex(int index);
  77. signals:
  78. void currentChanged(int index);
  79. protected:
  80. virtual void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
  81. virtual QSize tabSizeHint(int index) const;
  82. virtual void tabInserted(int index);
  83. virtual void tabRemoved(int index);
  84. virtual void tabLayoutChange();
  85. virtual bool event(QEvent *);
  86. virtual void resizeEvent(QResizeEvent *);
  87. virtual void showEvent(QShowEvent *);
  88. virtual void paintEvent(QPaintEvent *);
  89. virtual void mousePressEvent(QMouseEvent *);
  90. virtual void mouseMoveEvent(QMouseEvent *);
  91. virtual void mouseReleaseEvent(QMouseEvent *);
  92. virtual void keyPressEvent(QKeyEvent *);
  93. virtual void changeEvent(QEvent *);
  94. public:
  95. enum ButtonPosition
  96. {
  97. LeftSide,
  98. RightSide,
  99. };
  100. enum SelectionBehavior
  101. {
  102. SelectLeftTab,
  103. SelectRightTab,
  104. SelectPreviousTab,
  105. };
  106. void moveTab(int from, int to);
  107. bool tabsClosable() const;
  108. void setTabsClosable(bool closable);
  109. void setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget /Transfer/);
  110. QWidget *tabButton(int index, QTabBar::ButtonPosition position) const;
  111. QTabBar::SelectionBehavior selectionBehaviorOnRemove() const;
  112. void setSelectionBehaviorOnRemove(QTabBar::SelectionBehavior behavior);
  113. bool expanding() const;
  114. void setExpanding(bool enabled);
  115. bool isMovable() const;
  116. void setMovable(bool movable);
  117. bool documentMode() const;
  118. void setDocumentMode(bool set);
  119. signals:
  120. void tabCloseRequested(int index);
  121. void tabMoved(int from, int to);
  122. protected:
  123. virtual void hideEvent(QHideEvent *);
  124. virtual void mouseDoubleClickEvent(QMouseEvent *);
  125. virtual void wheelEvent(QWheelEvent *event);
  126. virtual QSize minimumTabSizeHint(int index) const;
  127. signals:
  128. void tabBarClicked(int index);
  129. void tabBarDoubleClicked(int index);
  130. public:
  131. bool autoHide() const;
  132. void setAutoHide(bool hide);
  133. bool changeCurrentOnDrag() const;
  134. void setChangeCurrentOnDrag(bool change);
  135. protected:
  136. virtual void timerEvent(QTimerEvent *event);
  137. public:
  138. %If (PyQt_Accessibility)
  139. QString accessibleTabName(int index) const;
  140. %End
  141. %If (PyQt_Accessibility)
  142. void setAccessibleTabName(int index, const QString &name);
  143. %End
  144. bool isTabVisible(int index) const;
  145. void setTabVisible(int index, bool visible);
  146. };