qmenubar.sip 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // qmenubar.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 QMenuBar : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qmenubar.h>
  25. %End
  26. public:
  27. explicit QMenuBar(QWidget *parent /TransferThis/ = 0);
  28. virtual ~QMenuBar();
  29. %If (- Qt_6_3_0)
  30. void addAction(QAction *);
  31. %End
  32. %If (- Qt_6_3_0)
  33. QAction *addAction(const QString &text) /Transfer/;
  34. %End
  35. %If (- Qt_6_3_0)
  36. QAction *addAction(const QString &text, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /Transfer/;
  37. %MethodCode
  38. QObject *receiver;
  39. QByteArray slot_signature;
  40. if ((sipError = pyqt6_qtwidgets_get_connection_parts(a1, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
  41. {
  42. sipRes = sipCpp->addAction(*a0, receiver, slot_signature.constData());
  43. }
  44. else if (sipError == sipErrorContinue)
  45. {
  46. sipError = sipBadCallableArg(1, a1);
  47. }
  48. %End
  49. %End
  50. QAction *addMenu(QMenu *menu);
  51. QMenu *addMenu(const QString &title) /Transfer/;
  52. QMenu *addMenu(const QIcon &icon, const QString &title) /Transfer/;
  53. QAction *addSeparator() /Transfer/;
  54. QAction *insertMenu(QAction *before, QMenu *menu);
  55. QAction *insertSeparator(QAction *before) /Transfer/;
  56. void clear();
  57. QAction *activeAction() const;
  58. void setActiveAction(QAction *action);
  59. void setDefaultUp(bool);
  60. bool isDefaultUp() const;
  61. virtual QSize sizeHint() const;
  62. virtual QSize minimumSizeHint() const;
  63. virtual int heightForWidth(int) const;
  64. QRect actionGeometry(QAction *) const;
  65. QAction *actionAt(const QPoint &) const;
  66. void setCornerWidget(QWidget *widget /Transfer/, Qt::Corner corner = Qt::TopRightCorner);
  67. QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
  68. virtual void setVisible(bool visible);
  69. signals:
  70. void triggered(QAction *action);
  71. void hovered(QAction *action);
  72. protected:
  73. virtual void initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const;
  74. virtual void changeEvent(QEvent *);
  75. virtual void keyPressEvent(QKeyEvent *);
  76. virtual void mouseReleaseEvent(QMouseEvent *);
  77. virtual void mousePressEvent(QMouseEvent *);
  78. virtual void mouseMoveEvent(QMouseEvent *);
  79. virtual void leaveEvent(QEvent *);
  80. virtual void paintEvent(QPaintEvent *);
  81. virtual void resizeEvent(QResizeEvent *);
  82. virtual void actionEvent(QActionEvent *);
  83. virtual void focusOutEvent(QFocusEvent *);
  84. virtual void focusInEvent(QFocusEvent *);
  85. virtual bool eventFilter(QObject *, QEvent *);
  86. virtual bool event(QEvent *);
  87. virtual void timerEvent(QTimerEvent *);
  88. public:
  89. bool isNativeMenuBar() const;
  90. void setNativeMenuBar(bool nativeMenuBar);
  91. };