Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT Application development with 2 touch screen displays



  • Hi All,

    I am trying to develop an application for an embeded device that has 2 touch enabled LCD screens. The kernel exposes the 2 touch screens with 2 frame buffer drivers (/dev/fb0 and /dev/fb1) and 2 touch devices (/dev/input/even0 and /dev/input/event1). I am able to run the QT application either of the LCD screens using scripts below:

    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_TSDEVICE=/dev/input/event0
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/lib/ts
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CONSOLEDEVICE=none
    export TSTS_INFO_FILE=/sys/devices/virtual/input/mice/uevent
    export QWS_MOUSE_PROTO=tslib:/dev/input/event0

    or

    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_TSDEVICE=/dev/input/event1
    export TSLIB_CALIBFILE=/etc/pointercal_1
    export TSLIB_CONFFILE=/etc/ts.conf
    export TSLIB_PLUGINDIR=/lib/ts
    export TSLIB_FBDEVICE=/dev/fb1
    export TSLIB_CONSOLEDEVICE=none
    export TSTS_INFO_FILE=/sys/devices/virtual/input/mice/uevent
    export QWS_MOUSE_PROTO=tslib:/dev/input/event1

    While starting the QT Application I pass the appropriate LinuxFb so that the application is started on that specific framebuffer
    I now have 2 questions:

    1. How do I allow the user to dynamically switch the application from one screen to other (i.e. how to switch the frame buffer device that the qt application is painting to without respawning the application)

    2. How do we pass appropriate environment variables to QT App so that it uses the appropriate touch screen? For e.g. QT App running on screen 1 should use event0 and the one running on screen 2 should use even1

    Thanks in advance for any help.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are you using ?



  • @SGaist said in QT Application development with 2 touch screen displays:

    What version of Qt are you using ?

    It's 4.8.7.


  • Lifetime Qt Champion

    See the Qt Embedded Running chapter in Qt 4 documentation. You'll see how you can manage multiple displays.



  • Thanks much for the input. This was exactly what I was looking for. The link talks about handling multiple displays. How do we handle multiple touch drivers? Any document for the same?


  • Lifetime Qt Champion

    I am don't remember such a document. There is Qt for Embedded Linux Pointer Handling, but I don't think it will answer your question.

    You can have multiple type of inputs used at the same time but I don't remember if you can have multiple device of the same type at the same time. However, I do remember that you may have one device that output all the outputs generated by the other input devices. Do you have something like that in your /dev ?


Log in to reply