Using QtVirtualKeyboard
-
Hello StGaist,
One note: at the current state, the platform plugins that I can use are EGLFS or LinuxFB. Are X11 or Wayland required for qtVirtualKeyboard module?
Currently I'm googling how to include C++11 in my image recipe.I didn't take any steps different from the ones that I usually do.
I just download the code from https://github.com/qt/qtvirtualkeyboard.git, and choose the basic project. Then I select the kit, compile the code and run it.
In theory I have qtvirtualkeyboard plugin available in my sysroots, but since I didn't know how to include it in a project from scratch, I've prefered to download a demo.Qt packages that I've got in my image are the following:
QT5_PKGS = "
qt3d
qt3d-dev
qt3d-mkspecs
qtcharts
qtcharts-dev
qtcharts-mkspecs
qtconnectivity-dev
qtconnectivity-mkspecs
qtdeclarative
qtdeclarative-dev
qtdeclarative-mkspecs
qtdeclarative-plugins
qtdeclarative-qmlplugins
qtgraphicaleffects
qtgraphicaleffects-dev
qtlocation-dev
qtlocation-mkspecs
qtlocation-plugins
qtmultimedia
qtmultimedia-dev
qtmultimedia-mkspecs
qtquickcontrols2
qtquickcontrols2-dev
qtquickcontrols2-mkspecs
qtsensors-dev
qtsensors-mkspecs
qtsensors-plugins
qtserialbus
qtserialbus-dev
qtserialbus-mkspecs
qtsvg
qtsvg-dev
qtsvg-mkspecs
qtwebsockets-dev
qtwebsockets-mkspecs
qtwebsockets-qmlplugins
qtvirtualkeyboard
qtvirtualkeyboard-dev
qtxmlpatterns
qtxmlpatterns-dev
qtxmlpatterns-mkspecs
"
Thank you again. -
AFAIK, no it's doesn't have such needs. IIRC, it's QtQuick based.
What demo ? There's already an example with the module.
Note that the official repos are at https://code.qt.io Github is just a mirror.
-
Hello St Gaist, thank you for your response.
-
Regarding the examples that should come with the module, probably, because the sdk is compiled through yocto recipes, I haven't got any qt examples installed, That's why I have to download them. Indeed I still need to learn a lot!
What I have inside sdk concerning VirtualKeyboard are qmldir, plugins.qmltypes and the folder Styles (contained in the path: /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/lib/qt5/qml/QtQuick/VirtualKeyboard). -
Regarding the project, incuding CONFIG += c++11 and calling make via console, the c++1 error has disappeared.
compiling main.cpp
In file included from /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtQuick/qquickwindow.h:45:0,
from /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtQuick/qquickview.h:43,
from /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtQuick/QQuickView:1,
from main.cpp:30:
/opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/qt5/QtGui/qopengl.h:106:26: fatal error: GLES2/gl2.h: File o directory non esistente
compilation terminated.
Makefile:627: set di istruzioni per l'obiettivo ".obj/main.o" non riuscito
make: *** [.obj/main.o] Errore 1
However I've got that file but it's store in the following path /opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/GLES2. Don't know why it's looking at a diffrent path. -
If I try to make and deploy the program with QtCreator, the program starts but, when I try to click on a text field, the program crashes and I get "EGLFS: OpenGL windows cannot be mixed with others".
Maybe it did the same from the beginning.
What do you think?
Thank you. -
-
So which project are you building ?
-
Well, actually the project that I started with, qtVirtualKeyboard version 5.1.0, is the same found in https://code.qt.io.
The fact is that I get different results building and running the same program inside qtCreator, or accomplishing these steps via console.
In qtCreator, the program starts correctly, but it crashes when I press a text line ("EGLFS: OpenGL windows cannot be mixed with others".)
With the console, I cannot carry out the make process (error: GLES2/gl2.h: file or directory not found).
I'm confused about this difference... -
Qt Creator sets everything up for the Qt version you are using to build your project.
On the command line, it's up to you to ensure that you are using the correct stuff e.g. the correct
qmake
, -
Hello StGaist, thank you a lot for your answer.
I found out what was wrong with different qmake output issue. Basically calling qmake from console, I forgot to add -spec linux-oe-g++, as I do in QtCreator. Now both the makefiles generated are the same.
The problem "EGLFS: OpenGL windows cannot be mixed with others" that makes crash the application, when I try to write in an edit field, remains.
On internet I still didn't find a suitable solution, but I have been still looking for it... -
Which demo is it ?
-
Hello StGaist,
thank you for your answer. The demo is git://code.qt.io/qt/qtvirtualkeyboard.git.The problem is similar to the one described int the following thread regarding combo boxes: https://bugreports.qt.io/browse/QTBUG-38405.
From a comment of this "bug".
"Qt Quick Controls 2 is designed for Embedded platforms, unlike Qt Quick Controls 1 which was designed for desktop and mobile first. In Qt Quick Controls 2 Combo boxes work because they don't try to create new native window surfaces on platforms that don't support doing so."I think that the problem is that qtvirtualkeyboard demo is designed with QtQuick1, so it cannot work with eglfs as it tries to create a new window. In other words, the demo should be written using Qt Quick Controls 2 for working correctly.
What do you think about that?
Thank you for your support. -
It's not a demo, it's a module
Which version are you using exactly ?
-
That demo seems to use QtQuick 2 which IIRC should not suffer the troubles you have.
-
Hello StGaist, thank you for your message.
I tried to download again the module, compile the demo and I get the same problem.
I cannot find anything useful on internet, but I'll keep looking at.
Maybe in the future I'll use x11 or wayland, and the problem shouldn't show up. -
Hello to all,
as far as I can understand, for those people which are using Yocto and want to use QtVirtualKeyboard, they have to install Boot2Qt, which contains recipes for installing the required software and making custom images.
See below:
http://doc.qt.io/QtForDeviceCreation/qtee-about-b2qt.html