The Curious Case of Benjamin Y-axis Button

  • I came across a strange behavior of QT5 on raspberry.
    I'm using a TFT display with resistive touchscreen on a raspberry pi 2.
    The external display is configured as a frame buffer /dev/fb1 while, as usual, monitor is /dev/fb0.
    The touchscreen is /dev/input/touchscreen but is a link to /dev/input/event3.
    I made a stupid application with a few sliders, button etc but does absolutely nothing except exiting the application when quit is pressed.
    There are also two QLCDNumber indicating the x, y coordinates of the pointer.
    I start the application with -platform linuxfb: fb=/dev/fb1 -style fusion -plugin tslib
    Tslib is calibrated and with environment set correctly.
    When I launch, the application is displayed correctly but if I interact via touchpanel you'll immediately notice that something is wrong.
    In framebuffer coordinates 0.0 are top, left and in fact the graphics are correct.
    Unfortunately QtLcd 2 show that the coordinates 0,0 for the touch panel are bottom, left.
    I recalibrated the tslib and tried various tslib tools and is entirely correct, but always in Qt the y-axis still reversed.
    After 1 week of attempts I decided to try to use the framebuffer /dev/fb0 to see if the same happens and magically the application works with the y-axis in the right direction using the calibrated touchplanel.

    After another week of trial, while looking at the sources in QTBase, I have found a variable QT_QPA_FB_TSLIB and after setting it to 1 the y-axis is back in the right direction using properly tslib and now everything works even using /dev/fb1 (I obviously omitted -plugin tslib from the command line)

    I have the impression that there is a bug in Qt5.5 that makes "-plugin tslb" functions only on the framebuffer 0 or that, I do not know why, goes wrong for /dev/fb1.

    Does anyone have experience about this oddity ??

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Something strange for sure. The implementation of the Linux framebuffer integration has changed quite a bit in 5.5. You should take a look at the bug report system to see if it's something known.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.