Important: Please read the Qt Code of Conduct -

Landscape and portrait mode RPi 3

  • Hi,
    I'm developping an application for the Raspberry Pi 3B+ using Qt 5.11.1, cross compiled from a Linux Host. It's working great, but I'm facing a problem :
    How can I have a portrait and a landscape mode ?

    For now, I've set the rotation of the screen to portrait (270°) and developped a ui form in portrait. What I would like is that you can change the orientation of the application. It's not a problem if the user need to restart the application for that.
    I thought of having two ui files and using QtUiLoader, but the package QtUiTools is not found... Do you have any idea ?

    Thanks, Victor

  • Lifetime Qt Champion

    @MrEliptik You just need to use layouts:
    Then your app will automatically adapt to any resolution and display orientation.

  • Ok I'll give it a try then. And for the actual screen rotation, is there a better way than using
    "export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=DISPLAY= :0 :rotate=90". This is what I'm doing for now.

Log in to reply