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. [Solved] Touch screen coordinates are offset in Qt but not when using tslib utilities on Raspberry Pi B+.
Forum Updated to NodeBB v4.3 + New Features

[Solved] Touch screen coordinates are offset in Qt but not when using tslib utilities on Raspberry Pi B+.

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 2.2k Views 1 Watching
  • 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.
  • F Offline
    F Offline
    FreddeB
    wrote on last edited by
    #1

    Hi,

    The platform is a Raspberry Pi Model B+ with a resistive touch screen (using tslib) from eGalax which is connected through the USB controller.

    I have no problems to calibrate and test the touch screen with the ts_test and ts_calib utilities, but when I start the Qt 5.4 application the events are captured by Qt but the touch coordinates are offset appr. 50 pixels.. in both Y and X direction.

    Does anyone have any experiance and solution regarding this problem?

    Regards
    Fredrik

    Regards
    Fredrik

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Maybe a silly question but are you sure you are using the calibrated data of tslib ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FreddeB
        wrote on last edited by
        #3

        Thanks for Your comment.. it led me to check the environment variables once again.. I've discovered that Qt sees the HDMI resolution, which in my case is 1280x720 .. but the output from ts_calibrate says 1024x600 which actually is the maximum resolution for the touch screen I use.. and I suppose that tslib gets the resolution from the driver for the touch screen..

        I will try to fix this and I'll post the result here..

        Thanks again!

        Regards
        Fredrik

        1 Reply Last reply
        0
        • F Offline
          F Offline
          FreddeB
          wrote on last edited by
          #4

          I've finally managed to solve the problem :)

          The resistive touch driver expects the video output to be 1024x600 but the resolution on the Pi was set to a standard resolution of 1280x720

          I found a solution on how to force the Pi to set it's HDMI resolution to a nonstandard which is described at

          http://www.solcomputer.com/downloads/controller.pdf

          Thanks SGaist for pointing me to the right direction!

          Regards
          Fredrik

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Great and thanks for sharing the solution !

            Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solutions has been found :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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