Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt5 Display Orientation
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?
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?
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?
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.
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.
"[...] 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.
ranshalit last edited by
Is there any software rotation that Qt can do , when framebuffer driver does not support rotation ?