Important: Please read the Qt Code of Conduct -

Qt On Embedded Linux Command Line Options

  • To run the Qt application on embedded platform, we need to run it as a server application.

    ./MyApp -qws, will create QApplication object as server application.

    If in case that, I do not want to specify anything in the command line,


    Then in the program while creating QApplication, pass QApplication::GuiServer as an parameter.

    Having this information,

    I do not want to pass the other parameters as well.

    Example: -display Transformed:Rot90
    This is an option to rotate my UI in the LCD for 90 degrees.

    But I do not want to specify this in command line.

    Is there a way to set this programmatically in the code?


  • Lifetime Qt Champion


    IIRC there's the QWS_DISPLAY environment variable that you could use.

    Hope it helps

  • @SGaist Hi Sam, Thanks for the reply.

    This would work. But I want to do at run time. For example: Say in the mobile, when we rotate the mobile to landscape, the screen tilts. So, that looks like, screen rotation is done at runtime.

    How to achieve that?


  • Lifetime Qt Champion

    The thing is: with mobiles (I take you are talking about iOS/Android) the OS tells you about that kind of event and the rotation is done for you (you can lock it though) but at the OS level not in your application.

    What is you exact use case ?

  • @SGaist Now I understand.

    My use case, is not a mobile device. My device is an embedded device with touch screen and the device is not immovable.

    So the use case of runtime screen rotation is not really needed for applicable for my application.

    I can set the QWS_DISPLAY to rotate the display to make it viewable.

    My question was really around, Can I set this screen rotation in the application itself?

    As you mentioned iOs/Android Operating System can do the job. My hardware is AM335x.

  • Lifetime Qt Champion

    Right now, I don't remember if dynamic rotation is available (I don't say it's not)

    Do you have any notification from your board that it has rotated ?

  • @SGaist Nope. No notification or indication.

  • Lifetime Qt Champion

    Then what you can try is get the QScreen of your application, cast it to a QTransformedScreen and then set the transformation.

  • Hi
    Sorry if I posted this in a wrong place.
    I'm new in QT and QT community and I didn't know how can I create the new post.
    Please help me in these questions.
    1-how can I post new subject here ;)
    2-I'm trying to make a device who has a rich graphic let say something like "Nest thermostat" graphic or similar. Am I in a correct place? If I'm not what is the best tool(s) for this?
    3-I was make a Qt from source in QT version 4.8.2 for cross compiling with Beagle bone black. later on I found out I didn't install
    In this situation can I add only this library to my existing library or I have to redo my configure with adding that in the end.
    BTW my host and target machine work on Debian.
    Host is running Jessie Debian, and target is running Wheezy Debian.
    Thank you in advance.

  • Lifetime Qt Champion

    Hi @imanpakii,

    It's indeed the wrong place, please do not highjack the thread of other people with unrelated questions.

Log in to reply