Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Touchscreen not working with QLineEdit, but works correctly with QPushButtons and other widgets
Qt 6.11 is out! See what's new in the release blog

Touchscreen not working with QLineEdit, but works correctly with QPushButtons and other widgets

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 405 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeng22
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved