Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QT QML Application slower compared to Widget Application in Python
Forum Updated to NodeBB v4.3 + New Features

QT QML Application slower compared to Widget Application in Python

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 1.1k Views 1 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.
  • A Offline
    A Offline
    Anouk
    wrote on last edited by Anouk
    #1

    Hello everyone,

    I am trying to create a graphical user interface which will run on a QT container on Torizon.

    I have tried two different methods to create the graphical user interface. For method 1 I generated the GUI using a QML file and for method 2 I used the QWidgets. I found out that generating a GUI with QWidgets is much faster. Am I doing something wrong with loading the QML file or is a GUI with Widgets just faster compared to a GUI with a QML file?

    For both applications, I have used python 3.10.9 together with PySide2. I am running the application on Torizon on a Toradex IMX8 module.

    The code which I use to load the QML file in Python is written down below. This code is the same code as the sample code which Torizon provides when you select in Visual Studio Code that you want to create a QT Python Application with QML.

    import sys
    import os
    import PySide2
    from PySide2.QtWidgets import QApplication
    from PySide2.QtCore import QUrl, QObject
    from PySide2.QtQuick import QQuickView
    
    if __name__ == "__main__":
        print("Hello world!")
    
        app = QApplication(sys.argv)
    
        view = QQuickView()
    
        qml = QUrl("mainwindow.qml")
    
        view.setSource(qml)
        view.show()
    
        sys.exit(app.exec_())
    

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you check that your hardware has hardware acceleration for QtQuick to take advantage from ?

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

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Did you check that your hardware has hardware acceleration for QtQuick to take advantage from ?

        A Offline
        A Offline
        Anouk
        wrote on last edited by
        #3

        @SGaist

        The IMX8 chips have a Vivante GC7000Lite as graphics controller.
        And I use the qt weston container with vivante, so that it uses the vivante controller, but it is still much slower compared to the program with QWidgets and the Vivante controller.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          friedemannkleint
          wrote on last edited by
          #4

          Have you tried Qt 6?

          A 1 Reply Last reply
          0
          • F friedemannkleint

            Have you tried Qt 6?

            A Offline
            A Offline
            Anouk
            wrote on last edited by
            #5

            @friedemannkleint

            I am using pyside 2 (so qt5) since that is what Torizon supports according to their website. I could not find whether I could use Pyside6. I have tried it, but I could not get it running. For some reason, the container kept on building with pyside2, even though I had adapted everything to pyside6.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              My gut feeling would be that somehow your application uses the software OpenGL pipeline rather than the hardware accelerated one. Do you seen any error printed on the console with regard to that ?

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

              A 1 Reply Last reply
              0
              • SGaistS SGaist

                My gut feeling would be that somehow your application uses the software OpenGL pipeline rather than the hardware accelerated one. Do you seen any error printed on the console with regard to that ?

                A Offline
                A Offline
                Anouk
                wrote on last edited by
                #7

                @SGaist I do get this warning:

                libEGL warning: MESA-LOADER: failed to open vivante: /usr/lib/dri/vivante_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  So I would say my hunch was correct, you do not get hardware acceleration since the direct rendering library for your GPU cannot be found.

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

                  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