Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt5 Display Orientation

Qt5 Display Orientation

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 4.7k 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.
  • N Offline
    N Offline
    njozwiak
    wrote on last edited by
    #1

    Hi all,

    I am running Qt 5.3.2 on a BeagleBone Black and I'm trying to rotate the orientation to display my application in portrait mode. I've built the application with a geometry (defined in mainwindow.ui) of 480x640. That looks good when it's running on my x86 system... But I can't figure out how to display this correctly on the embedded screen.

    I've read through posts ( http://qt-project.org/forums/viewthread/30582 ) that appear to give rotation control using QWS display, but that isn't available in Qt5.

    How is screen rotation done in Qt5?

    Thanks

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      Screen orientation is something that the platform is expected to do, with the application learning about it via QScreen. QWS was different because it was the windowing system.

      In Qt 5, screen size and notification of orientation or size changes arrive via the QPA interface. What QPA (-platform switch) plugin are you using?

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0
      • N Offline
        N Offline
        njozwiak
        wrote on last edited by
        #3

        Oh interesting. I am currently using linuxfb (although will likely attempt to rebuild Qt for eglfs). I know that the screen can be rotated for the console using fbcon, but according to kernel.org that is exclusively console rotation and application rotation should be handled at the application level. How would I go about rotating my application?

        1 Reply Last reply
        0
        • jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #4

          Have you tried the fbcon rotation to see if it's visible to an application?

          I don't see anything in the linuxfb plugin (qtbase/src/plugins/platforms/linuxfb/, qlinuxfbscreen.cpp in particular) that handles a rotation explicitly. It uses the FBIOGET_FSCREENINFO and FBIOGET_VSCREENINFO ioctls to query the display, and has override parameters to specify the dimensions of the screen and to forgo attempting to switch to graphics mode. The parameters to the plugin are at the top of QLinuxFbScreen::initialize() in qlinuxfbscreen.cpp.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          1 Reply Last reply
          0
          • N Offline
            N Offline
            njozwiak
            wrote on last edited by
            #5

            I have used fbcon to rotate the console and then ran my application. The console rotated as expected, but the application still ran like it was in landscape. So I'm inclined to believe the kernel.org documentation that fbcon only affects the terminal.

            I suppose it is entirely possible then that linuxfb does not support rotation. My question then is: what does? I find it hard to believe that there is no support for portrait mode in Qt5.

            1 Reply Last reply
            0
            • jeremy_kJ Offline
              jeremy_kJ Offline
              jeremy_k
              wrote on last edited by
              #6

              "[...] the underlying fb driver is totally ignorant of console rotation"

              That doesn't sound encouraging.

              From what I can gather, this is probably only going to be resolvable for the Linux framebuffer interface in the video driver. The X.org fbdev driver has a Rotate option. Spending enough time chasing that down might lead to a useful answer, for a particular hardware + driver configuration.

              Another option is to rotate the contents of each window.

              Asking a question about code? http://eel.is/iso-c++/testcase/

              1 Reply Last reply
              0
              • R Offline
                R Offline
                ranshalit
                wrote on last edited by
                #7

                Hi,
                Is there any software rotation that Qt can do , when framebuffer driver does not support rotation ?

                thanks,
                Ran

                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