qtoolbar.sip 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // qtoolbar.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 QToolBar : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qtoolbar.h>
  25. %End
  26. public:
  27. QToolBar(const QString &title, QWidget *parent /TransferThis/ = 0);
  28. explicit QToolBar(QWidget *parent /TransferThis/ = 0);
  29. virtual ~QToolBar();
  30. void setMovable(bool movable);
  31. bool isMovable() const;
  32. void setAllowedAreas(Qt::ToolBarAreas areas);
  33. Qt::ToolBarAreas allowedAreas() const;
  34. bool isAreaAllowed(Qt::ToolBarArea area) const;
  35. void setOrientation(Qt::Orientation orientation);
  36. Qt::Orientation orientation() const;
  37. void clear();
  38. %If (- Qt_6_3_0)
  39. void addAction(QAction *);
  40. %End
  41. %If (- Qt_6_3_0)
  42. QAction *addAction(const QString &text) /Transfer/;
  43. %End
  44. %If (- Qt_6_3_0)
  45. QAction *addAction(const QIcon &icon, const QString &text) /Transfer/;
  46. %End
  47. %If (- Qt_6_3_0)
  48. QAction *addAction(const QString &text, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /Transfer/;
  49. %MethodCode
  50. QObject *receiver;
  51. QByteArray slot_signature;
  52. if ((sipError = pyqt6_qtwidgets_get_connection_parts(a1, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
  53. {
  54. sipRes = sipCpp->addAction(*a0, receiver, slot_signature.constData());
  55. }
  56. else if (sipError == sipErrorContinue)
  57. {
  58. sipError = sipBadCallableArg(1, a1);
  59. }
  60. %End
  61. %End
  62. %If (- Qt_6_3_0)
  63. QAction *addAction(const QIcon &icon, const QString &text, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /Transfer/;
  64. %MethodCode
  65. QObject *receiver;
  66. QByteArray slot_signature;
  67. if ((sipError = pyqt6_qtwidgets_get_connection_parts(a2, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
  68. {
  69. sipRes = sipCpp->addAction(*a0, *a1, receiver, slot_signature.constData());
  70. }
  71. else if (sipError == sipErrorContinue)
  72. {
  73. sipError = sipBadCallableArg(2, a2);
  74. }
  75. %End
  76. %End
  77. QAction *addSeparator() /Transfer/;
  78. QAction *insertSeparator(QAction *before) /Transfer/;
  79. QAction *addWidget(QWidget *widget /Transfer/) /Transfer/;
  80. QAction *insertWidget(QAction *before, QWidget *widget /Transfer/) /Transfer/;
  81. QRect actionGeometry(QAction *action) const;
  82. QAction *actionAt(const QPoint &p) const;
  83. QAction *actionAt(int ax, int ay) const;
  84. QAction *toggleViewAction() const;
  85. QSize iconSize() const;
  86. Qt::ToolButtonStyle toolButtonStyle() const;
  87. QWidget *widgetForAction(QAction *action) const;
  88. public slots:
  89. void setIconSize(const QSize &iconSize);
  90. void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
  91. signals:
  92. void actionTriggered(QAction *action);
  93. void movableChanged(bool movable);
  94. void allowedAreasChanged(Qt::ToolBarAreas allowedAreas);
  95. void orientationChanged(Qt::Orientation orientation);
  96. void iconSizeChanged(const QSize &iconSize);
  97. void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle);
  98. void topLevelChanged(bool topLevel);
  99. void visibilityChanged(bool visible);
  100. protected:
  101. virtual void initStyleOption(QStyleOptionToolBar *option) const;
  102. virtual void actionEvent(QActionEvent *event);
  103. virtual void changeEvent(QEvent *event);
  104. virtual void paintEvent(QPaintEvent *event);
  105. virtual bool event(QEvent *event);
  106. public:
  107. bool isFloatable() const;
  108. void setFloatable(bool floatable);
  109. bool isFloating() const;
  110. };