Important: Please read the Qt Code of Conduct -

How to set GUI to always run in landscape orientation

  • Hello,

    I have an app that fills the whole screen whenever I start it up, in spite of explicitly setting in my MainWindow constructor that the widget should have a width of 320 and height 240:


    I was hoping that this would set the app to run as landscape every time, with the specified width and height. But the window expands to occupy the whole screen, with the usable area of my app at the upper left corner of the window, and the rest is just blank.

    How do I set my app to run always in landscape orientation?


  • Lifetime Qt Champion


    What platform are you targeting ?

  • I am targeting a custom board with a 3.5 inch (320 x 240) display. I built the app using Qt 4.8.5, I was thinking that there might be some methods to lock the app orientation, or is screen orientation hardware specific?


Log in to reply