Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set GUI to always run in landscape orientation
Forum Update on Monday, May 27th 2025

How to set GUI to always run in landscape orientation

Scheduled Pinned Locked Moved General and Desktop
qt4gui
3 Posts 2 Posters 874 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    admd91
    wrote on last edited by
    #1

    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:

    ui->centralWidget->setFixedSize(320,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?

    Thanks,

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What platform are you targeting ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        admd91
        wrote on last edited by
        #3

        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?

        Thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved