From cff492fed1d98f45c4c1f4011f1451120c0d1c23 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Jun 2019 13:00:11 +0200 Subject: Extract QGuiAction(Group) from QAction(Group) into QtGui Simply moving QAction to QtGui was not deemed possible since it operates on a set of controls of some kind. The approach to extract a base class was taken instead, named QGuiAction following the QGuiApplication scheme. QAction remains in widgets, but changes base class. For QActionGroup, the functions addAction(text/icon), which create an action, cannot be implemented in QtGui, hence a base class is needed, too (unless they are deprecated and removed). - Extract base classes providing functionality not based on QtWidgets, using virtuals in QGuiActionPrivate to provide customization points - Change QActionEvent to take QGuiAction, removing the need to forward declare QAction in QtGui [ChangeLog][QtGui] Added QGuiAction(Group) and made the equivalent existing classes in Qt Widgets derive from them. This provides basic functionality for implementing actions in QML. Task-number: QTBUG-69478 Change-Id: Ic490a5e3470939ee8af612d46ff41d4c8c91fbdf Reviewed-by: Lars Knoll Reviewed-by: Mitch Curtis Reviewed-by: Oliver Wolff Reviewed-by: Allan Sandfeld Jensen --- src/widgets/widgets/qlineedit_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qlineedit_p.h') diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h index a11fea6bbe..5b4936667e 100644 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@ -239,7 +239,7 @@ public: QString placeholderText; QWidget *addAction(QAction *newAction, QAction *before, QLineEdit::ActionPosition, int flags = 0); - void removeAction(QAction *action); + void removeAction(QGuiAction *action); SideWidgetParameters sideWidgetParameters() const; QIcon clearButtonIcon() const; void setClearButtonEnabled(bool enabled); @@ -261,7 +261,7 @@ private: }; friend class QTypeInfo; - SideWidgetLocation findSideWidget(const QAction *a) const; + SideWidgetLocation findSideWidget(const QGuiAction *a) const; SideWidgetEntryList leadingSideWidgets; SideWidgetEntryList trailingSideWidgets; -- cgit v1.2.3 From 5367f76e1755aecf9527660d1c00e4e6d29d7c78 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 18 Oct 2019 15:03:08 +0200 Subject: QAction: Properly port to the new configure system Use QT_REQUIRE_CONFIG in the headers of classes to be disabled. Add headers/source files in the .pro file depending on the configure feature in libraries and tests. Add the necessary exclusions and use QT_CONFIG. Only the widgets/kernel tests were made to compile since also the buttons depend on the action feature and it would become too involved. Task-number: QTBUG-69478 Change-Id: Id5bf88bc108f2bbb14dce8625bfdcb7eb0deb8e3 Reviewed-by: Oliver Wolff Reviewed-by: Volker Hilsheimer --- src/widgets/widgets/qlineedit_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/widgets/widgets/qlineedit_p.h') diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h index 5b4936667e..bb2a0530f1 100644 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@ -238,8 +238,10 @@ public: QString placeholderText; +#if QT_CONFIG(action) QWidget *addAction(QAction *newAction, QAction *before, QLineEdit::ActionPosition, int flags = 0); void removeAction(QGuiAction *action); +#endif SideWidgetParameters sideWidgetParameters() const; QIcon clearButtonIcon() const; void setClearButtonEnabled(bool enabled); @@ -261,7 +263,9 @@ private: }; friend class QTypeInfo; +#if QT_CONFIG(action) SideWidgetLocation findSideWidget(const QGuiAction *a) const; +#endif SideWidgetEntryList leadingSideWidgets; SideWidgetEntryList trailingSideWidgets; -- cgit v1.2.3