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 /examples | |
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 'examples')
6 files changed, 6 insertions, 3 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp index 5662518ddc..a7e73debb6 100644 --- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp +++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp @@ -50,7 +50,7 @@ #include "colorswatch.h" -#include <QAction> +#include <QActionGroup> #include <QtEvents> #include <QFrame> #include <QMainWindow> diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp index 4ba180f312..a43adfceac 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp @@ -52,7 +52,7 @@ #include "colorswatch.h" #include "toolbar.h" -#include <QAction> +#include <QActionGroup> #include <QLayout> #include <QMenu> #include <QMenuBar> diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp index 36d4108b1e..6a5faf248f 100644 --- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp +++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp @@ -52,6 +52,7 @@ #include <QRandomGenerator> +#include <QActionGroup> #include <QMainWindow> #include <QMenu> #include <QPainter> diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp index 7cfe3f6c05..eccc29d26d 100644 --- a/examples/widgets/richtext/textedit/textedit.cpp +++ b/examples/widgets/richtext/textedit/textedit.cpp @@ -48,7 +48,7 @@ ** ****************************************************************************/ -#include <QAction> +#include <QActionGroup> #include <QApplication> #include <QClipboard> #include <QColorDialog> diff --git a/examples/widgets/widgets/icons/mainwindow.cpp b/examples/widgets/widgets/icons/mainwindow.cpp index be92f83c75..aa5ed852fd 100644 --- a/examples/widgets/widgets/icons/mainwindow.cpp +++ b/examples/widgets/widgets/icons/mainwindow.cpp @@ -53,6 +53,7 @@ #include "iconsizespinbox.h" #include "imagedelegate.h" +#include <QActionGroup> #include <QApplication> #include <QButtonGroup> #include <QCheckBox> diff --git a/examples/widgets/widgets/tablet/mainwindow.cpp b/examples/widgets/widgets/tablet/mainwindow.cpp index c5b631ee44..102fb813b8 100644 --- a/examples/widgets/widgets/tablet/mainwindow.cpp +++ b/examples/widgets/widgets/tablet/mainwindow.cpp @@ -51,6 +51,7 @@ #include "mainwindow.h" #include "tabletcanvas.h" +#include <QActionGroup> #include <QApplication> #include <QColorDialog> #include <QDir> |