diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-17 23:31:41 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-20 17:47:42 +0200 |
commit | 5b1befa31a9851397d56363f058568094d11f5f3 (patch) | |
tree | f1be4f68da64a59d6502e9e45488436417c68e5d /src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp | |
parent | 9166abcd997f57625c17db8e8734988ff303217e (diff) |
Add QEvdevKeyMapper platform interface
Task-number: QTBUG-84220
Change-Id: I4f3a54415c5509b4bde486b54c56b0e05976bac6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp index cea486db21..61c4fdf768 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp @@ -70,8 +70,6 @@ #include <QtInputSupport/private/qtslib_p.h> #endif -#include <QtPlatformHeaders/private/qlinuxfbfunctions_p.h> - QT_BEGIN_NAMESPACE QLinuxFbIntegration::QLinuxFbIntegration(const QStringList ¶mList) @@ -181,40 +179,26 @@ QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const QFunctionPointer QLinuxFbIntegration::platformFunction(const QByteArray &function) const { -#if QT_CONFIG(evdev) - if (function == QLinuxFbFunctions::loadKeymapTypeIdentifier()) - return QFunctionPointer(loadKeymapStatic); - else if (function == QLinuxFbFunctions::switchLangTypeIdentifier()) - return QFunctionPointer(switchLangStatic); -#else Q_UNUSED(function); -#endif - return 0; } -void QLinuxFbIntegration::loadKeymapStatic(const QString &filename) -{ #if QT_CONFIG(evdev) - QLinuxFbIntegration *self = static_cast<QLinuxFbIntegration *>(QGuiApplicationPrivate::platformIntegration()); - if (self->m_kbdMgr) - self->m_kbdMgr->loadKeymap(filename); +void QLinuxFbIntegration::loadKeymap(const QString &filename) +{ + if (m_kbdMgr) + m_kbdMgr->loadKeymap(filename); else qWarning("QLinuxFbIntegration: Cannot load keymap, no keyboard handler found"); -#else - Q_UNUSED(filename); -#endif } -void QLinuxFbIntegration::switchLangStatic() +void QLinuxFbIntegration::switchLang() { -#if QT_CONFIG(evdev) - QLinuxFbIntegration *self = static_cast<QLinuxFbIntegration *>(QGuiApplicationPrivate::platformIntegration()); - if (self->m_kbdMgr) - self->m_kbdMgr->switchLang(); + if (m_kbdMgr) + m_kbdMgr->switchLang(); else qWarning("QLinuxFbIntegration: Cannot switch language, no keyboard handler found"); -#endif } +#endif QT_END_NAMESPACE |