diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-18 17:02:11 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-29 11:18:57 +0100 |
commit | bcaff2b06fc46fce8a3ae6d613c025c8d097229c (patch) | |
tree | fde5485241a96c5ea1222e8299b046fdea9084e6 /src/gui/kernel/qevent.h | |
parent | e3d01840656a07f17549864da163b67094c03c0e (diff) |
Remove QGuiAction again and split QAction implementation up instead
Duplicating the number of classes is a high price to pay to be able to
have some QAction functionality behave differently, or be only available
in widgets applications.
Instead, declare the entire API in QtGui in QAction* classes, and
delegate the implementation of QtWidgets specific functionality to
the private. The creation of the private is then delegated to the
Q(Gui)ApplicationPrivate instance through a virtual factory function.
Change some public APIs that are primarily useful for specialized tools
such as Designer to operate on QObject* rather than QWidget*. APIs that
depend on QtWidgets types have been turned into inline template
functions, so that they are instantiated only at the caller side, where
we can expect the respective types to be fully defined. This way, we
only need to forward declare a few classes in the header, and don't
need to generate any additional code for e.g. language bindings.
Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 7d2d6dbdcc..984deb54f5 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QFile; -class QGuiAction; +class QAction; class QScreen; class QTouchDevice; #if QT_CONFIG(gestures) @@ -728,13 +728,13 @@ private: #if QT_CONFIG(action) class Q_GUI_EXPORT QActionEvent : public QEvent { - QGuiAction *act, *bef; + QAction *act, *bef; public: - QActionEvent(int type, QGuiAction *action, QGuiAction *before = nullptr); + QActionEvent(int type, QAction *action, QAction *before = nullptr); ~QActionEvent(); - inline QGuiAction *action() const { return act; } - inline QGuiAction *before() const { return bef; } + inline QAction *action() const { return act; } + inline QAction *before() const { return bef; } }; #endif // QT_CONFIG(action) |