diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-10-18 09:07:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-10-25 12:12:39 +0200 |
commit | dff3843d98d52e2c32fea07371f91117de0667e9 (patch) | |
tree | 028199eebf8d92722de91412e32352c54cbd5183 /src/widgets/kernel | |
parent | 5d5a0842dc87645eab468389198750adc01b0618 (diff) |
QShortcut: Properly port to the new configure system
Move the feature to corelib so that the QMetaType enumeration
values can be properly excluded and there is no need for a
dummy class.
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.
Task-number: QTBUG-76493
Change-Id: I02499ebee1a3d6d9a1e5afd02517beed5f4536b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/kernel.pri | 9 | ||||
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qaction.h | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.h | 7 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.h | 4 |
6 files changed, 17 insertions, 13 deletions
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index 693af7eb80..8115741b6e 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -20,8 +20,7 @@ HEADERS += \ kernel/qlayout_p.h \ kernel/qlayoutengine_p.h \ kernel/qlayoutitem.h \ - kernel/qshortcut.h \ - kernel/qsizepolicy.h \ + kernel/qsizepolicy.h \ kernel/qstackedlayout.h \ kernel/qwidget.h \ kernel/qwidget_p.h \ @@ -47,7 +46,6 @@ SOURCES += \ kernel/qlayout.cpp \ kernel/qlayoutengine.cpp \ kernel/qlayoutitem.cpp \ - kernel/qshortcut.cpp \ kernel/qsizepolicy.cpp \ kernel/qstackedlayout.cpp \ kernel/qwidget.cpp \ @@ -77,6 +75,11 @@ qtConfig(formlayout) { SOURCES += kernel/qformlayout.cpp } +qtConfig(shortcut) { + HEADERS += kernel/qshortcut.h + SOURCES += kernel/qshortcut.cpp +} + qtConfig(tooltip) { HEADERS += kernel/qtooltip.h SOURCES += kernel/qtooltip.cpp diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 19ad65692b..e69474cc47 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -46,7 +46,9 @@ #include "qevent.h" #include "qlist.h" #include "qstylehints.h" -#include <private/qshortcutmap_p.h> +#if QT_CONFIG(shortcut) +# include <private/qshortcutmap_p.h> +#endif #include <private/qguiapplication_p.h> #if QT_CONFIG(menu) #include <private/qmenu_p.h> diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h index f7693f4dde..d232b8d205 100644 --- a/src/widgets/kernel/qaction.h +++ b/src/widgets/kernel/qaction.h @@ -41,7 +41,9 @@ #define QACTION_H #include <QtWidgets/qtwidgetsglobal.h> -#include <QtGui/qkeysequence.h> +#if QT_CONFIG(shortcut) +# include <QtGui/qkeysequence.h> +#endif #include <QtCore/qstring.h> #include <QtWidgets/qwidget.h> #include <QtCore/qvariant.h> diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index eec65c8625..49440ad383 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -40,7 +40,6 @@ #include "qshortcut.h" #include "private/qwidget_p.h" -#ifndef QT_NO_SHORTCUT #include <qevent.h> #if QT_CONFIG(whatsthis) #include <qwhatsthis.h> @@ -676,7 +675,6 @@ bool QShortcut::event(QEvent *e) } return QObject::event(e); } -#endif // QT_NO_SHORTCUT QT_END_NAMESPACE diff --git a/src/widgets/kernel/qshortcut.h b/src/widgets/kernel/qshortcut.h index 6dcf4971b2..6334788bce 100644 --- a/src/widgets/kernel/qshortcut.h +++ b/src/widgets/kernel/qshortcut.h @@ -44,10 +44,9 @@ #include <QtWidgets/qwidget.h> #include <QtGui/qkeysequence.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(shortcut); -#ifndef QT_NO_SHORTCUT +QT_BEGIN_NAMESPACE class QShortcutPrivate; class Q_WIDGETS_EXPORT QShortcut : public QObject @@ -94,8 +93,6 @@ protected: bool event(QEvent *e) override; }; -#endif // QT_NO_SHORTCUT - QT_END_NAMESPACE #endif // QSHORTCUT_H diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 83a6e6d4b3..86f937c4c6 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -53,7 +53,9 @@ #include <QtGui/qregion.h> #include <QtGui/qbrush.h> #include <QtGui/qcursor.h> -#include <QtGui/qkeysequence.h> +#if QT_CONFIG(shortcut) +# include <QtGui/qkeysequence.h> +#endif #ifdef QT_INCLUDE_COMPAT #include <QtGui/qevent.h> |