QtQuick.VirtualKeyboard, slow language change
-
I wrote my application in QML using QtQuick.VirtualKeyboard. Assembled and launched on the desktop. The app is working.
I have rebuilt the application for imx6q. Launched - it works. I use eglfs. The app works great. The built-in GPU does a great job with graphics.I customized the keyboard using Quick.VirtualKeyboard.Styles.
On the desktop, switching the keyboard layout takes less than a second. Noticeable, but not critical.
On the imx6q, the language switch takes a few seconds. It feels like QML is recompiling a new layout at the time of the language change. You can see it here https://disk.yandex.ru/i/us5GXxnEYaUPwQ
(Sorry for the inverted picture, but the essence of the problem is clear.)How can I speed up the language change on a virtual keyboard?
-
I wrote my application in QML using QtQuick.VirtualKeyboard. Assembled and launched on the desktop. The app is working.
I have rebuilt the application for imx6q. Launched - it works. I use eglfs. The app works great. The built-in GPU does a great job with graphics.I customized the keyboard using Quick.VirtualKeyboard.Styles.
On the desktop, switching the keyboard layout takes less than a second. Noticeable, but not critical.
On the imx6q, the language switch takes a few seconds. It feels like QML is recompiling a new layout at the time of the language change. You can see it here https://disk.yandex.ru/i/us5GXxnEYaUPwQ
(Sorry for the inverted picture, but the essence of the problem is clear.)How can I speed up the language change on a virtual keyboard?
@juvf said in QtQuick.VirtualKeyboard, slow language change:
How can I speed up the language change on a virtual keyboard?
If you know screen size and it is fixed: you can simplify the style to use less layouts, less computation and bindings etc. That could help.
-
It feels like when changing the language, QML compiles a new keyboard. And why? Why can't QML compile during the build of the application and then just show one widget, then another? I have included CONFIG += qtquickcompiler in the *.pro file, but there is no effect in speed.
-
Sorry I don't have experience in virtual keyboard myself. But on I project I was part of others were able to optimize the keyboard, with layout switching to run smoothly on a 300 MHz, single-core CPU. So I don't know exactly how, but I know it is possible to speed it all up.
I think you can replace the layouts, and even provide custom keyboard screens that would use fixed positioning, fewer bindings etc.
Why can't QML compile during the build of the application and then just show one widget, then another?
I'm pretty sure the delay is not compilation of QML but setting up of bindings and objects. The keyboard has a ton of buttons, states, layouts that need to be set up and calculated on startup.
-
Sorry I don't have experience in virtual keyboard myself. But on I project I was part of others were able to optimize the keyboard, with layout switching to run smoothly on a 300 MHz, single-core CPU. So I don't know exactly how, but I know it is possible to speed it all up.
I think you can replace the layouts, and even provide custom keyboard screens that would use fixed positioning, fewer bindings etc.
Why can't QML compile during the build of the application and then just show one widget, then another?
I'm pretty sure the delay is not compilation of QML but setting up of bindings and objects. The keyboard has a ton of buttons, states, layouts that need to be set up and calculated on startup.
@sierdzio said in QtQuick.VirtualKeyboard, slow language change:
The keyboard has a ton of buttons, states, layouts that need to be set up and calculated on startup.
I agree with you and I say the same thing: "... need to be set up and calculated on STARTUP." Let the application startup for 1 minute. To hell with it, let the application startup for 1 hour. ))
But after the application has started, I call the keyboard for the first time and the keyboard appears very quickly. Almost instantly.
The startup passed!!!
I'm typing, the keyboard works fine.
I change the layout from Cyrillic to English and the keyboard freezes for a few seconds. Why? The startup passed a long time ago.
Then, I change the layout from English to Cyrillic and again the keyboard freezes for a few seconds. What's it? Is this some kind of new "startup"?
Every time I switch the keyboard layout, a "startup" occurs. Why? Why is it (startup) needed?Can you show this topic to your colleagues or share the code where colleagues defeated the keyboard hang?
Thank you in advance!
-
@sierdzio said in QtQuick.VirtualKeyboard, slow language change:
The keyboard has a ton of buttons, states, layouts that need to be set up and calculated on startup.
I agree with you and I say the same thing: "... need to be set up and calculated on STARTUP." Let the application startup for 1 minute. To hell with it, let the application startup for 1 hour. ))
But after the application has started, I call the keyboard for the first time and the keyboard appears very quickly. Almost instantly.
The startup passed!!!
I'm typing, the keyboard works fine.
I change the layout from Cyrillic to English and the keyboard freezes for a few seconds. Why? The startup passed a long time ago.
Then, I change the layout from English to Cyrillic and again the keyboard freezes for a few seconds. What's it? Is this some kind of new "startup"?
Every time I switch the keyboard layout, a "startup" occurs. Why? Why is it (startup) needed?Can you show this topic to your colleagues or share the code where colleagues defeated the keyboard hang?
Thank you in advance!
@juvf said in QtQuick.VirtualKeyboard, slow language change:
Why? The startup passed a long time ago.
I guess layouts are loaded via a Loader element. So when it's sourceComponent is changed (to another layout), the data is loaded fresh.
So this implies you could create a custom layout, make it small and fast and it will load fast. Or make it lazy-load and it will also look faster than it is (here I mean: initially load just empty rectangle, then fill in all the keys).
A lot of the details are described here: https://doc.qt.io/qt-6/technical-guide.html