Touchscreen not working with QLineEdit, but works correctly with QPushButtons and other widgets
-
Hello,
I am working with a touchscreen on a Toradex Apalis-TK1 with the angstrom-qt5-x11-image build with Yocto in oe-core. I did not modify much in terms of the local.conf file.
My Qt application has normal QPushbuttons for navigation and some line edits to eventually perform some login sequence. Upon clicking a line edit field, a custom keyboard widget should appear, and upon losing focus of the line edit, the keyboard hides itself.
On running the application on Desktop version, this line edit/keyboard functionality works as expected. Navigation buttons work as well.Upon running this on the hardware, the touchscreen is registering correctly because I am able to move the pointer and click on the QPushButtons to change pages in my application. The weird issue is tapping on a line edit will move the pointer there, but will not give the line edit focus (therefore my keyboard widget does not display).
I then tried to plug in a mouse to operate the application, and that works correctly, the same as the Desktop version.So I tried another test, where upon starting the application, I click once on the mouse plugged into the hardware, and then unplug it. This caused the touchscreen to start working correctly with the line edits, and I no longer need the mouse.
I am using event filters to grab the focus events to display/hide my keyboard widget. I tried adding QEvent::TouchUpdate and QEvent::Enter after seeing QEvent::FocusIn did not solve my problem, but this was not the solution.
Any advice or ideas to what I should look into? I am guessing that this could be a touchscreen driver issue over a Qt code issue since the application is working as expected on the Desktop version, and works correctly with a mouse.
Let me know if you have any questions and thanks in advance for any help.
Thanks,
Josh