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. Qt 5 embedded screen rotation
QtWS25 Last Chance

Qt 5 embedded screen rotation

Scheduled Pinned Locked Moved Mobile and Embedded
23 Posts 19 Posters 39.1k 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.
  • B Offline
    B Offline
    blaroche
    wrote on last edited by
    #1

    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
    0
    • P Offline
      P Offline
      peterlin82
      wrote on last edited by
      #2

      Now,I have the same problem too.

      Someone can teach me?

      thanks a lot.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jgestevebbri.com
        wrote on last edited by
        #3

        Does anyone know how to rotate screens on QT5 embedded ?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Joe D
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JoelC
            wrote on last edited by
            #5

            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
            0
            • P Offline
              P Offline
              peterlin82
              wrote on last edited by
              #6

              Thanks for JoelC.

              But I use Qt Widgets Application.

              Any help would be appreciated!

              1 Reply Last reply
              0
              • T Offline
                T Offline
                tubbias
                wrote on last edited by
                #7

                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
                0
                • S Offline
                  S Offline
                  Sidii
                  wrote on last edited by
                  #8

                  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
                  0
                  • U Offline
                    U Offline
                    ufas
                    wrote on last edited by
                    #9

                    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
                    0
                    • A Offline
                      A Offline
                      agocs
                      wrote on last edited by
                      #10

                      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
                      0
                      • A Offline
                        A Offline
                        agocs
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kumars
                          wrote on last edited by
                          #12

                          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
                          0
                          • 0 Offline
                            0 Offline
                            0xFa81
                            wrote on last edited by 0xFa81
                            #13

                            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);
                            
                            matthew2011M 1 Reply Last reply
                            0
                            • A agocs

                              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 Offline
                              C Offline
                              Chad Barbe
                              wrote on last edited by
                              #14

                              @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
                              0
                              • R Offline
                                R Offline
                                ranshalit
                                wrote on last edited by
                                #15

                                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
                                0
                                • 0 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);
                                  
                                  matthew2011M Offline
                                  matthew2011M Offline
                                  matthew2011
                                  wrote on last edited by
                                  #16

                                  @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
                                  0
                                  • tsaGT Offline
                                    tsaGT Offline
                                    tsaG
                                    wrote on last edited by
                                    #17

                                    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
                                    0
                                    • A Offline
                                      A Offline
                                      Ajith_P_V
                                      wrote on last edited by Ajith_P_V
                                      #18

                                      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
                                      0
                                      • tsaGT Offline
                                        tsaGT Offline
                                        tsaG
                                        wrote on last edited by
                                        #19

                                        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.VD 2 Replies Last reply
                                        0
                                        • tsaGT tsaG

                                          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 Offline
                                          A Offline
                                          Ajith_P_V
                                          wrote on last edited by
                                          #20

                                          @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
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved