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