diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-05-11 17:49:08 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-05-11 17:49:08 +0200 |
commit | 1fc2dfee7e0a0240d0823b5153be7491406518d9 (patch) | |
tree | ed3667e135bf16abe4001ef281903211faf4c6dd /src/imports/templates | |
parent | 52e578611c5d9dca43d967c833e23b7bbcb53079 (diff) | |
parent | 2d11f49ecd48fbf154cf5dc759526bf28fc732b7 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
.qmake.conf
Change-Id: I5c6398e4146e62109bef231fe358b7ed69fa9488
Diffstat (limited to 'src/imports/templates')
-rw-r--r-- | src/imports/templates/qtquicktemplates2plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp index 2782fa9a..aac7e8b7 100644 --- a/src/imports/templates/qtquicktemplates2plugin.cpp +++ b/src/imports/templates/qtquicktemplates2plugin.cpp @@ -102,10 +102,12 @@ static inline void initResources() #endif } +#if QT_CONFIG(shortcut) // qtdeclarative/src/quick/util/qquickshortcut.cpp typedef bool (*ShortcutContextMatcher)(QObject *, Qt::ShortcutContext); extern ShortcutContextMatcher qt_quick_shortcut_context_matcher(); extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher); +#endif QT_BEGIN_NAMESPACE @@ -121,20 +123,26 @@ public: void registerTypes(const char *uri); private: +#if QT_CONFIG(shortcut) ShortcutContextMatcher originalContextMatcher; +#endif }; QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensionPlugin(parent) { initResources(); +#if QT_CONFIG(shortcut) originalContextMatcher = qt_quick_shortcut_context_matcher(); qt_quick_set_shortcut_context_matcher(QQuickShortcutContext::matcher); +#endif } QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin() { +#if QT_CONFIG(shortcut) qt_quick_set_shortcut_context_matcher(originalContextMatcher); +#endif } void QtQuickTemplates2Plugin::registerTypes(const char *uri) |