qtoolbutton.sip 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // qtoolbutton.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 QToolButton : public QAbstractButton
  22. {
  23. %TypeHeaderCode
  24. #include <qtoolbutton.h>
  25. %End
  26. public:
  27. enum ToolButtonPopupMode
  28. {
  29. DelayedPopup,
  30. MenuButtonPopup,
  31. InstantPopup,
  32. };
  33. explicit QToolButton(QWidget *parent /TransferThis/ = 0);
  34. virtual ~QToolButton();
  35. virtual QSize sizeHint() const;
  36. virtual QSize minimumSizeHint() const;
  37. Qt::ToolButtonStyle toolButtonStyle() const;
  38. Qt::ArrowType arrowType() const;
  39. void setArrowType(Qt::ArrowType type);
  40. void setMenu(QMenu *menu /KeepReference/);
  41. QMenu *menu() const;
  42. void setPopupMode(QToolButton::ToolButtonPopupMode mode);
  43. QToolButton::ToolButtonPopupMode popupMode() const;
  44. QAction *defaultAction() const;
  45. void setAutoRaise(bool enable);
  46. bool autoRaise() const;
  47. public slots:
  48. void showMenu();
  49. void setToolButtonStyle(Qt::ToolButtonStyle style);
  50. void setDefaultAction(QAction * /KeepReference/);
  51. signals:
  52. void triggered(QAction *);
  53. protected:
  54. virtual void initStyleOption(QStyleOptionToolButton *option) const;
  55. virtual bool event(QEvent *e);
  56. virtual void mousePressEvent(QMouseEvent *);
  57. virtual void paintEvent(QPaintEvent *);
  58. virtual void actionEvent(QActionEvent *);
  59. virtual void enterEvent(QEnterEvent *);
  60. virtual void leaveEvent(QEvent *);
  61. virtual void timerEvent(QTimerEvent *);
  62. virtual void changeEvent(QEvent *);
  63. virtual void mouseReleaseEvent(QMouseEvent *);
  64. virtual void nextCheckState();
  65. virtual bool hitButton(const QPoint &pos) const;
  66. %If (Qt_6_2_0 -)
  67. virtual void checkStateSet();
  68. %End
  69. };