Important: Please read the Qt Code of Conduct -

Where does Screen QML Type get screen info on linux ?

  • Hi All,

    In our project we're using Qt5.5 (will upgrade to 5.8 soon) running on embedded Linux, build from custom yokto variant, with freescale sabreSD BSP. We are using a custom display, which it seems is not yet properly integrated.
    We want to be able to change Landscape/Portrait orientation on our device, and it seems like the best way to do it is by rotating the display framebuffer (orientation change is triggered by button click, rather than accelerometer, and is not anticipated to happen often, so no reason to load and store extra screens for different orientations at runtime, as we may have some memory constraints in the near future)

    Ideally i want to just trigger the orientation change in hardware, (by using the display driver IOCTL or something like that probably) and then just reload the UI screens with new orientation. So the question is: where does the Screen type get the screen information from ? My guess would be whichever /dev/fb i'm using, so similar to fbset, is my understanding of this correct ?

    And more general question is, whether this approach is right ? Would the performance hit be actually noticeable if i
    perform rotation by rotating QML window and its elements ?

    Possibly some silly questions, but don't have much experience with qml, and linux graphics.

    Thanks for your time !

  • Did you get anywhere with this? It seems there isn't very much support (... any support?) for people asking linuxfb related questions.

    I'm also using QML on a linuxfb back end. I rotate the screen in QML. I did some measurements and the post rotation rendering overhead was negligible i.e. running an animation in portrait vs rotated landscape mode used the same cpu +/-1%.

    If I understand your question correctly, you'll want the UI reformatted (for different aspect ratio) after rotation so I'd definitely do it with QML.

    As to your original question, as far as I can see plugins/platforms/linuxfb/qlinuxfbscreen.cpp gets the screen information with calls to ioctl (as you mention). There's a patch here to add rotation as a Qt environment variable:

Log in to reply