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
4#ifndef QWIDGETACTION_H
5#define QWIDGETACTION_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtGui/qaction.h>
9
11
12QT_BEGIN_NAMESPACE
13
14class QWidgetActionPrivate;
15
16class Q_WIDGETS_EXPORT QWidgetAction : public QAction
17{
18 Q_OBJECT
19 Q_DECLARE_PRIVATE(QWidgetAction)
20
21public:
22 explicit QWidgetAction(QObject *parent);
23 virtual ~QWidgetAction();
24
25 void setDefaultWidget(QWidget *w);
26 QWidget *defaultWidget() const;
27
28 QWidget *requestWidget(QWidget *parent);
29 void releaseWidget(QWidget *widget);
30
31protected:
32 virtual bool event(QEvent *) override;
33 virtual bool eventFilter(QObject *, QEvent *) override;
34 virtual QWidget *createWidget(QWidget *parent);
35 virtual void deleteWidget(QWidget *widget);
36 QList<QWidget *> createdWidgets() const;
37
38private:
39 Q_DISABLE_COPY(QWidgetAction)
40 friend class QToolBar;
41};
42
43QT_END_NAMESPACE
44
45#endif // QWIDGETACTION_H
The QWidgetAction class extends QAction by an interface for inserting custom widgets into action base...
QT_REQUIRE_CONFIG(action)
Combined button and popup list for selecting options.