I try to do my first development on Rapsberri PI 3 and Qt. I use Qt 5.15.10 with cross compilation for Raspberry 3 I have a 7" LCD with USB touchscreen. I have developped a shared library in C++, used by my Qt application, which polls an accelerometer to get the board position so that when the board is flipped the image on the LCD will get flipped to.
In order to do so, according to the position read from the accelerometer, I call one of the following shell commands:
"xrandr -display :0.0 --orientation inverted && export DISPLAY=:0 && xinput set-prop '" + display_name + "' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1"
"xrandr -display :0.0 --orientation normal && export DISPLAY=:0 && xinput set-prop '" + display_name + "' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1"
If i start my Qt application using -platform xcb option both image on LCD and touchscreen are rotated corectly. If i start my Qt application using -platform eglfs option image on LCD is rotated corectly but touchsreen coordinates are not.
Am I missing something ?
I have seen many other posts about touch screen rotation (using for example the env variable QT_QPA_EGLFS_ROTATION) but all apply to static configurations, while I need something to dynamically change my orientation. I am clueless.