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 widget based UI rendering slow on qt5 when ported from qt4
Forum Updated to NodeBB v4.3 + New Features

QT widget based UI rendering slow on qt5 when ported from qt4

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
26 Posts 3 Posters 6.8k Views 2 Watching
  • 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.
  • L Offline
    L Offline
    linuxsnail
    wrote on 23 Aug 2018, 08:49 last edited by
    #1

    Hi, I have recently migrated from qt4 to qt5 for ARM based target device.
    Am able to acheive similar configuration and the qt4 based applications are working after porting to qt5.

    However, qt widget based gui when compiled with qt5 is rendering very slow compared to when compiled with qt4.

    We are using linuxfb as other graphics platform are not supported by hardware

    qt5 configuration is as below:

    PACKAGECONFIG_append = "accessibility linuxfb tslib no-opengl openssl"

    PACKAGECONFIG_remove = "dbus fontconfig qml-debug sm tools directfb tests examples xinput2 xcb xkb xkbcommon-evdev eglfs gl gles2 xcb sql-ibase sql-mysql sql-psql sql-odbc sql-oci sql-tds sql-db2 sql-sqlite2 sql-sqlite journald"

    PACKAGECONFIG_DEFAULT_remove = "dbus tools tests udev"

    any idea what could be the reason?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 23 Aug 2018, 21:59 last edited by
      #2

      Hi and welcome to devnet,

      Can you explain what your application does ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply 24 Aug 2018, 10:18
      0
      • S SGaist
        23 Aug 2018, 21:59

        Hi and welcome to devnet,

        Can you explain what your application does ?

        L Offline
        L Offline
        linuxsnail
        wrote on 24 Aug 2018, 10:18 last edited by
        #3

        @SGaist Its a simple widget based gui menu with few tabs to set configurations, user settings, starting-stopping of the device, displaying the device working status and some pop up alerts messages and notifications. nothing fancy!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 24 Aug 2018, 21:13 last edited by
          #4

          What is your hardware ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply 30 Aug 2018, 04:12
          0
          • S SGaist
            24 Aug 2018, 21:13

            What is your hardware ?

            L Offline
            L Offline
            linuxsnail
            wrote on 30 Aug 2018, 04:12 last edited by
            #5

            @SGaist its i.MX35

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on 30 Aug 2018, 05:31 last edited by kuzulis
              #6

              Hi.

              I have similar issue with iMX6 && Qt5 && QtWidgets app. In my case I have created a simple test app, with an one widget which fills own rect 1280x800 every 50 msec with two colors 'red' and 'green'. In result I got the CPU loading ~50% on iMX6 against 0% on Desktop. But when I try to use the Qwt library, this loading increases to 100% on iMX6 against of 5% on a Desktop. I tried as 'linuxfb' and as 'eglfs' backends - result same.

              I was sadly surprised in this, because, seems that Qt5 use the software QtWidgets rendering in any cases. So, now, I don't know what to do with this situation.

              So, seems, you need to re-write your app to QtQuick... Or try to re-build your RootFS to use X11 with 'xcb' backend.

              PS: It's easier for you to do this, because you do not use a real-time plotting.

              L 1 Reply Last reply 30 Aug 2018, 08:34
              0
              • K kuzulis
                30 Aug 2018, 05:31

                Hi.

                I have similar issue with iMX6 && Qt5 && QtWidgets app. In my case I have created a simple test app, with an one widget which fills own rect 1280x800 every 50 msec with two colors 'red' and 'green'. In result I got the CPU loading ~50% on iMX6 against 0% on Desktop. But when I try to use the Qwt library, this loading increases to 100% on iMX6 against of 5% on a Desktop. I tried as 'linuxfb' and as 'eglfs' backends - result same.

                I was sadly surprised in this, because, seems that Qt5 use the software QtWidgets rendering in any cases. So, now, I don't know what to do with this situation.

                So, seems, you need to re-write your app to QtQuick... Or try to re-build your RootFS to use X11 with 'xcb' backend.

                PS: It's easier for you to do this, because you do not use a real-time plotting.

                L Offline
                L Offline
                linuxsnail
                wrote on 30 Aug 2018, 08:34 last edited by
                #7

                @kuzulis For porting an app from QtWidget to QtQuick will attract lot of development and testing time I believe so! My hardware does not support X11. I have heard we can build X11 free xcb is it?

                The thing is everything works fine with QT4 (no X11 only Linux FB) but only with same image & hardware rendering is slow with QT5? I dont know the reason.

                Is it because the way QT draws to buffer has changed? any solution or idea?

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kuzulis
                  Qt Champions 2020
                  wrote on 30 Aug 2018, 08:47 last edited by kuzulis
                  #8

                  I am not an expert. So, IMHO, just continue stays on Qt4. Qt5 does not given any advantages then for QtWidgets.

                  UPD:

                  I have found documentation mention about 'linuxfb' && 'eglfs' backends here. Where says that for QtWidgets used the software rendering.

                  Also I have found mention about X11 && 'xcb' backend here. Where it is unclear what of render is used for QtWidgets (I hope that sometihng hardware/accelerated 2D).

                  And I have not found any mention about 'directfb' backend on Qt5 && Linux.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 30 Aug 2018, 20:17 last edited by
                    #9

                    Widgets are using the rasteriser backend, so if you are thinking GPU, no they are not hardware accelerated.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    L 2 Replies Last reply 5 Sept 2018, 05:00
                    0
                    • S SGaist
                      30 Aug 2018, 20:17

                      Widgets are using the rasteriser backend, so if you are thinking GPU, no they are not hardware accelerated.

                      L Offline
                      L Offline
                      linuxsnail
                      wrote on 5 Sept 2018, 05:00 last edited by
                      #10

                      @SGaist Not looking for any acceleration. Im still trying to figure out how come qt5 renders slow the same gui which is rendred fast with qt4 on same device?

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kuzulis
                        Qt Champions 2020
                        wrote on 5 Sept 2018, 08:37 last edited by
                        #11

                        Please watch for current discussion in mailing-list.

                        L 1 Reply Last reply 5 Sept 2018, 11:12
                        0
                        • K kuzulis
                          5 Sept 2018, 08:37

                          Please watch for current discussion in mailing-list.

                          L Offline
                          L Offline
                          linuxsnail
                          wrote on 5 Sept 2018, 11:12 last edited by linuxsnail 9 May 2018, 11:13
                          #12

                          @kuzulis I have read the mailing list chain. I am interested in learning what is it that was in QT4 which is not in QT5 anymore from rendering perspective. With QT4 I used to run my app with -qws. ofcourse QT5 does not have qws. Is there anyway we can patch QT5 to enable similar features which were provided with qws in QT4.

                          If there is no workaround options with me would be either to migrate the app to qtquick which is huge effort or rollback to QT4. Is there any other option?

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            kuzulis
                            Qt Champions 2020
                            wrote on 5 Sept 2018, 15:22 last edited by
                            #13

                            Please read that mailing chain up to end (to today). There says that to the Qt5 are added one feature to enable the acceleration with QtWidgets && X11, using the QT_XCB_NATIVE_PAINTING env. variable. You can try it.

                            L 1 Reply Last reply 7 Sept 2018, 05:38
                            0
                            • K kuzulis
                              5 Sept 2018, 15:22

                              Please read that mailing chain up to end (to today). There says that to the Qt5 are added one feature to enable the acceleration with QtWidgets && X11, using the QT_XCB_NATIVE_PAINTING env. variable. You can try it.

                              L Offline
                              L Offline
                              linuxsnail
                              wrote on 7 Sept 2018, 05:38 last edited by
                              #14

                              @kuzulis Are you talking about hardware acceleration? if yes I can't use it as my hardware does not have GPU! Hope you are following my query from the beginning!

                              1 Reply Last reply
                              0
                              • S SGaist
                                30 Aug 2018, 20:17

                                Widgets are using the rasteriser backend, so if you are thinking GPU, no they are not hardware accelerated.

                                L Offline
                                L Offline
                                linuxsnail
                                wrote on 18 Sept 2018, 05:02 last edited by
                                #15

                                @SGaist 0_1537246791995_QT_Graphics_Framework.png

                                I came across one slide recently about QT presemtation. Does this mean that Qwidget can be accelerated as well?

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  kuzulis
                                  Qt Champions 2020
                                  wrote on 18 Sept 2018, 06:39 last edited by
                                  #16

                                  @linuxsnail said in QT widget based UI rendering slow on qt5 when ported from qt4:

                                  Does this mean that Qwidget can be accelerated as well?

                                  Seems no.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 18 Sept 2018, 06:48 last edited by
                                    #17

                                    IIRC, DirectFB provided some hardware acceleration depending on the graphic chip you have at your disposal but don't expect NVIDIA Titan X acceleration performances.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    L 2 Replies Last reply 19 Sept 2018, 06:18
                                    0
                                    • S SGaist
                                      18 Sept 2018, 06:48

                                      IIRC, DirectFB provided some hardware acceleration depending on the graphic chip you have at your disposal but don't expect NVIDIA Titan X acceleration performances.

                                      L Offline
                                      L Offline
                                      linuxsnail
                                      wrote on 19 Sept 2018, 06:18 last edited by
                                      #18

                                      @SGaist Can I use EGLFS for QWidgets without GPU support? Do you think it can have better performance over LinuxFB?

                                      1 Reply Last reply
                                      0
                                      • S SGaist
                                        18 Sept 2018, 06:48

                                        IIRC, DirectFB provided some hardware acceleration depending on the graphic chip you have at your disposal but don't expect NVIDIA Titan X acceleration performances.

                                        L Offline
                                        L Offline
                                        linuxsnail
                                        wrote on 7 Dec 2018, 15:35 last edited by
                                        #19

                                        @SGaist I am still struggling with this topic, is there any possibility of adding software acceleration for qwidgets ? I'm just wondering what made it render faster on qt 4.8.1? even when we use qt4.8.7 it seems slow like qt5.

                                        For qt4.8.1 and 4.8.7 my compile configurations are similar.

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on 7 Dec 2018, 15:37 last edited by
                                          #20

                                          If you are seeing a slowdown between Qt 4.8.1 and Qt 4.8.7, you should compare the code of both backend to see what's going on.

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          L 1 Reply Last reply 7 Dec 2018, 16:49
                                          0

                                          • Login

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