diff options
author | Elena Zaretskaya <sweetiebrier@yandex.ru> | 2019-01-11 10:11:03 -0500 |
---|---|---|
committer | Elena Zaretskaya <sweetiebrier@yandex.ru> | 2019-01-25 15:00:07 +0000 |
commit | c9b9a0ea2f274688da26af20102d349336fdb2a0 (patch) | |
tree | 53168ab420947b6ac5388e87c0e601b8f590f5e5 /src/platformheaders/eglfsfunctions | |
parent | c4e7f3ab6555c87fb41c5f341524445283720e6a (diff) |
Ability to switch language under platform eglfs/linuxfb
I need to change keymap under platforms eglfs and linuxfb (without wayland).
I use the function QEglFSFunctions::loadKeymap(const QString&), but there's
no way to switch between english and another language than to press AltGr as
a modifier. I added the function that allows to change the language. And also
added the ability to switch the keymap and language for the platform linuxfb
and also added the ability to switch the keymap and language for the platform linuxfb
Task-number: QTBUG-72452
Change-Id: I37432cf60d375555bea2bf668ec1387322b4964f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/platformheaders/eglfsfunctions')
-rw-r--r-- | src/platformheaders/eglfsfunctions/qeglfsfunctions.h | 9 | ||||
-rw-r--r-- | src/platformheaders/eglfsfunctions/qeglfsfunctions.qdoc | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/platformheaders/eglfsfunctions/qeglfsfunctions.h b/src/platformheaders/eglfsfunctions/qeglfsfunctions.h index 7165c3cff4..869fe7ce3f 100644 --- a/src/platformheaders/eglfsfunctions/qeglfsfunctions.h +++ b/src/platformheaders/eglfsfunctions/qeglfsfunctions.h @@ -49,7 +49,9 @@ class QEglFSFunctions { public: typedef void (*LoadKeymapType)(const QString &filename); + typedef void (*SwitchLangType)(); static QByteArray loadKeymapTypeIdentifier() { return QByteArrayLiteral("EglFSLoadKeymap"); } + static QByteArray switchLangTypeIdentifier() { return QByteArrayLiteral("EglFSSwitchLang"); } static void loadKeymap(const QString &filename) { @@ -58,6 +60,13 @@ public: func(filename); } + static void switchLang() + { + SwitchLangType func = reinterpret_cast<SwitchLangType>(QGuiApplication::platformFunction(switchLangTypeIdentifier())); + if (func) + func(); + } + typedef int (*Vsp2AddLayerType)(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine); static QByteArray vsp2AddLayerTypeIdentifier() { return QByteArrayLiteral("EglFSVsp2AddLayer"); } diff --git a/src/platformheaders/eglfsfunctions/qeglfsfunctions.qdoc b/src/platformheaders/eglfsfunctions/qeglfsfunctions.qdoc index 0bee9190cf..a5f37f8377 100644 --- a/src/platformheaders/eglfsfunctions/qeglfsfunctions.qdoc +++ b/src/platformheaders/eglfsfunctions/qeglfsfunctions.qdoc @@ -67,6 +67,21 @@ */ /*! + \fn void QEglFSFunctions::switchLang() + + Switches between English and other language when the keymap is loaded. + Usually the keymap contains two languages: English and national. When + you load the keymap, English is selected by default. This function allows + to switch between these languages. + + \note This is functional only when the evdev keyboard support code is + compiled in to the platform plugin. When using external generic plugins via + the \c{-plugin} argument, or when the environment variable + \c{QT_QPA_EGLFS_DISABLE_INPUT} is set or when building Qt without evdev + support, this function will have no effect. +*/ + +/*! \fn int QEglFSFunctions::vsp2AddLayer(const QScreen *screen, int dmabufFd, const QSize &size, const QPoint &position, uint drmPixelFormat, uint bytesPerLine) \internal \preliminary |