Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Qt 5 embedded screen rotation

    Mobile and Embedded
    19
    23
    34100
    Loading More Posts
    • 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.
    • B
      blaroche last edited by

      With Qt4 application rotation of 90, 180 and 270 degree was fairly easy with -qws -display transformed:Rot270.

      I've been trying to find the equivalent with Qt 5 with Ogles2/eglfs, starting the application with -platform eglfs command line.
      I'm starting to dig through the source and will post an answer if I find it. I'm hoping post the question here will result in a quicker and hopefully more correct solution.
      Anyone know the Qt5 equivalent to -qws -display transformed:Rot270?

      thanks

      1 Reply Last reply Reply Quote 0
      • P
        peterlin82 last edited by

        Now,I have the same problem too.

        Someone can teach me?

        thanks a lot.

        1 Reply Last reply Reply Quote 0
        • J
          jgestevebbri.com last edited by

          Does anyone know how to rotate screens on QT5 embedded ?

          1 Reply Last reply Reply Quote 0
          • J
            Joe D last edited by

            I am looking for this solution as well.
            Any help would be appreciated!

            1 Reply Last reply Reply Quote 0
            • J
              JoelC last edited by

              I would also be interested in a general solution.

              If you are using qml then you can rotate any root items just by inserting the following. This will rotate all children and even handle touch input correctly.
              @
              transform: Rotation {
              angle: 180
              origin.x: root.width / 2
              origin.y: root.height / 2
              }
              @

              1 Reply Last reply Reply Quote 0
              • P
                peterlin82 last edited by

                Thanks for JoelC.

                But I use Qt Widgets Application.

                Any help would be appreciated!

                1 Reply Last reply Reply Quote 0
                • T
                  tubbias last edited by

                  I also have this problem. We are porting a c++/qml application from qt4.8 to qt5. We have used transformed:Rot90 and it has worked fine without any performance issues. However if we perform the following in our qml code:

                  @
                  transform: Rotation {
                  angle: 90
                  }
                  @

                  the qml part becomes laggy.

                  Has someone come up with a solution to this?

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sidii last edited by

                    Dear All,

                    Just one more information that i want to add this is that if you don't want to pass

                    @-platform eglfs@

                    the above argument while running your app each time, you can simply store this information in the environment variable :

                    @export QT_QPA_PLATFORM=eglfs@

                    And now you can directly run your app without passing any argument.

                    Cheers!!

                    1 Reply Last reply Reply Quote 0
                    • U
                      ufas last edited by

                      Same problem here. Any information is welcome, even it is a statement that this is not possible.

                      Btw: is this the wrong use case? Should one use QML?

                      1 Reply Last reply Reply Quote 0
                      • A
                        agocs last edited by

                        There is no equivalent of QWS' transforms, neither in linuxfb nor eglfs.

                        Qt Quick applications are expected to do the transformations themselves.

                        For widget apps this is a bit unfortunate since they are left out in the cold for now. :/

                        C 1 Reply Last reply Reply Quote 0
                        • A
                          agocs last edited by

                          Created http://bugreports.qt-project.org/browse/QTBUG-39959

                          1 Reply Last reply Reply Quote 0
                          • K
                            kumars last edited by

                            Hello All,
                            I have same problem. App works fine on Qt4 with QML 1.1 version on both landscape and portrait mode... I use transformed:Rot270.

                            But in Qt5 if I try to rotate my app in QML rootitem by transform: Rotation {
                            angle: 180
                            origin.x: root.width / 2
                            origin.y: root.height / 2
                            }

                            it does not work properly...only part of the screen is rotated..Any known issues in that area ?
                            Thanks Kumars

                            1 Reply Last reply Reply Quote 0
                            • 0
                              0xFa81 last edited by 0xFa81

                              My solution was: (in mainwindow.cpp-constructor):

                              QGraphicsScene *scene = new QGraphicsScene();
                              QGraphicsView *view = new QGraphicsView(parent);
                              view->setGeometry(0,0,X,Y); // actual Display size
                              view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
                              view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
                              QGraphicsProxyWidget *proxy = scene->addWidget(this);
                              view->setScene(scene);
                              view->show();
                              view->rotate(90);
                              
                              matthew2011 1 Reply Last reply Reply Quote 0
                              • C
                                Chad Barbe @agocs last edited by

                                @agocs Does this mean that one cannot run a QWidget based application in portrait mode on a natively landscape display? For example, I have a 480x272 display that my hardware team wants to orient in a portrait orientation.

                                I have tried a number of things including the last suggestion on this thread from 0xFa81 but i end up with garbled text. That's the best way i can explain it. When I run the same code on my development box it works fine and the text is not garbled and show up sideways on my monitor. But if i run it on my embedded device i get text where the letters are switched around.

                                I started another thread about this here:

                                http://forum.qt.io/topic/55907/qwidget-based-application-in-non-native-orientation-on-embedded-linux-with-fbdev-platform

                                1 Reply Last reply Reply Quote 0
                                • R
                                  ranshalit last edited by

                                  Hi,

                                  Does Qt rotation is done as part of Qt library/application or as control to framebuffer (which in this case is expected to support rotation).
                                  I ask because in our HW/fbdev driver there is no support for rotation, so I wander if Qt can do this rotation in software...

                                  Thanks,
                                  Ran

                                  1 Reply Last reply Reply Quote 0
                                  • matthew2011
                                    matthew2011 @0xFa81 last edited by

                                    @0xFa81 I'm curious if this is the method you are still using.

                                    I'm using this on a product I'm helping with, and the performance is rather slow and is negatively impacting product design requirements (graphing updates per second).

                                    I've tried adjusting the QGraphicsView settings (optimization, etc), but no improvement.

                                    If anyone has found a better way to rotate a landscape LCD to portrait, on a platform using linuxFB (all software driven, no hardware graphics cores at all) help is appreciated.

                                    This platform was previously being developed in Qt4, and the QWS system rotated without any noticeable issues...

                                    Thank you!

                                    Matthew

                                    1 Reply Last reply Reply Quote 0
                                    • tsaG
                                      tsaG last edited by

                                      Are there any news about rotating the Display? I do have a Raspberry 7" Display which is landscape native. Using lcd_rotate in the boot config doesnt work (it only works for 180°) and display_rotate misses to rotate the touchscreen. So I need to either rotate the whole thing (touch and display) or just the touchscreen (then I would use the display_rotate). Is there a way to do this?

                                      export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=rotate=90

                                      somehow doesnt work for me (should it?)

                                      thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        Ajith_P_V last edited by Ajith_P_V

                                        Though it is a pretty old query, I think answering to this thread is still valid.
                                        The major difference between Qt4.8 and Qt5.x.x is that, they removed the Qt's own windowing system and let it open for user defined windowing system. That means, QWS (Qt Windowing System) is no more part of the Qt and we can use X11, Wayland or FB as the backend for the same.
                                        If someone want to rotate the screen, then basically that is doing with the help of the windowing system but not just with the Qt itself. As many other people stated, Qt4 rotation is done with the QWS.
                                        If you are using X11 windowing system along with Qt5, then X11 have rotation feature and one should make use of that for the Qt rotation.
                                        I hope this helps.

                                        Regards,
                                        Ajith P V

                                        1 Reply Last reply Reply Quote 0
                                        • tsaG
                                          tsaG last edited by

                                          Hi, Is this also valid for the QT embedded since it is using EGLFS? All I found was the workaround using setTransformation, but this (at least thats what it looks like) was removed in QT 5.

                                          A Dr.V 2 Replies Last reply Reply Quote 0
                                          • A
                                            Ajith_P_V @tsaG last edited by

                                            @tsaG Yes, you are right. "setTransformation" is part of QWSDisplay and in Qt5, they have removed the complete QWS windowing system itself. So as far as my knowledge, there is no equivalent for "setTransformation". However, instead of QWS windowing system, now Qt5 opens to any other popular windows systems such as x11 which can do this trick.
                                            PS: I'm afraid I can't help you with EGLFS since, my qt work is around the corner of X11 almost all time.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post