Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwidgetaction.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWIDGETACTION_H
6#define QWIDGETACTION_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtGui/qaction.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QWidgetActionPrivate;
16
17class Q_WIDGETS_EXPORT QWidgetAction : public QAction
18{
19 Q_OBJECT
20 Q_DECLARE_PRIVATE(QWidgetAction)
21
22public:
23 explicit QWidgetAction(QObject *parent);
24 virtual ~QWidgetAction();
25
26 void setDefaultWidget(QWidget *w);
27 QWidget *defaultWidget() const;
28
29 QWidget *requestWidget(QWidget *parent);
30 void releaseWidget(QWidget *widget);
31
32protected:
33 virtual bool event(QEvent *) override;
34 virtual bool eventFilter(QObject *, QEvent *) override;
35 virtual QWidget *createWidget(QWidget *parent);
36 virtual void deleteWidget(QWidget *widget);
37 QList<QWidget *> createdWidgets() const;
38
39private:
40 Q_DISABLE_COPY(QWidgetAction)
41 friend class QToolBar;
42};
43
44QT_END_NAMESPACE
45
46#endif // QWIDGETACTION_H
The QWidgetAction class extends QAction by an interface for inserting custom widgets into action base...
QT_REQUIRE_CONFIG(action)