Qt embedded dispaly and touch rotation on RPi3



  • Hi,
    I've succesfully installed and tested QT5 on my RPi3 with QWidget apps. I originally wanted to rotate the screen 270°. To do that, I added : display_rotate=3 in /boot/config.txt. That rotates the display but not the touch inputs. That's fine because using environment variable tells Qt that my screen is rotated.
    I've used the following and it was working fine :

    export QT_QPA_EGLFS_PHYSICAL_WIDTH=86
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=154
    export QT_QPA_EGLFS_HEIGHT=800
    export QT_QPA_EGLFS_ WIDTH=480
    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=DISPLAY=:0:rotate=90

    With that configuration, the screen works fine at 270°, with the touch inputs correctly mapped.

    Now, the thing is I would like to be able to launch my application either in portrait or landscape mode. I've used layouts to desgin my application so it will render fine either way.

    Is there a way to change those parameters on the fly, or as arguments when running the app ? Because right now, it seems I need to edit /etc/environment and then restart the Pi. And even with that, the touchscreen inputs don't change anymore... Do you have any idea on how to do that ?


Log in to reply
 

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