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