Fix unresolved external symbols for -no-feature-shortcut

Change-Id: I3ddef9df6100b8837d1bdc81f3fd1dc7cf37babf
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
This commit is contained in:
Stephan Binner 2017-05-06 12:19:22 +02:00
parent 932d5f7829
commit 6276b14a73
1 changed files with 8 additions and 0 deletions

View File

@ -99,10 +99,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
@ -118,20 +120,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)