Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QT QML with OpenGL

    QML and Qt Quick
    3
    6
    2917
    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.
    • W
      wonderman last edited by

      Hi,

      I want to know wether my code use OpenGl or not? I am using QT 4.8.1 on iMAX53 board. Freescale GPU driver is loaded on BSP. I have configured QT with opengl ES option. my code is below:
      @
      class CApplication : public QMainWindow
      {
      Q_OBJECT
      public:
      QmlApplicationViewer m_ViewObj; /** Holds View object */
      }

      CApplication : CApplication ()
      {
      // Create GLWidget
      QGLFormat format = QGLFormat::defaultFormat();
      format.setAlpha(true);
      QGLWidget *glWidget = new QGLWidget(format);
      glWidget->setAutoFillBackground(true);
      m_ViewObj.setViewport(glWidget);

      m_ViewObj.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
      m_ViewObj.setSource(QUrl("qml/appmain.qml"));
      
      show();
      

      }
      @

      Now, my problem is when first time show function called in consturctor, QGLShader::link: "Link was successful" debug display on console and it will take around 2-3 seconds. which leads very bad performance on boot time. If i disable OpenGL in my program this debug is not displayed on console and show function execute within second.

      I had done profiling with opengl and without opengl. there is no change on CPU usage without OpenGL. currently I am using only 2D view. So, i want to know, wheter my QML is used OpenGL for rendering or not? if not, then what will be change require to use opengl gpu for performance and how can I reduce boot time by bypassing shader linking.

      Thanks in advance.
      Manoj

      Edit: please use @ tags around code sections; Andre

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Can you wrap your code in '@' tags? It's hard to read at the moment.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • W
          wonderman last edited by

          Code:

          @
          class CApplication : public QMainWindow
          {
          Q_OBJECT
          public: QmlApplicationViewer m_ViewObj; /** Holds View object */
          }

          CApplication : CApplication ()
          {
          // Create GLWidget
          QGLFormat format = QGLFormat::defaultFormat();
          format.setAlpha(true);
          QGLWidget *glWidget = new QGLWidget(format);
          glWidget->setAutoFillBackground(true);
          m_ViewObj.setViewport(glWidget);
          m_ViewObj.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
          m_ViewObj.setSource(QUrl(“qml/appmain.qml”));
          show();
          } @

          Edit: no need for an @ before every line, just put one before your code block and one after...; Andre

          1 Reply Last reply Reply Quote 0
          • W
            wonderman last edited by

            Is there any comments?

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

              you wrote;
              [quote]
              I had done profiling with opengl and without opengl. there is no change on CPU usage without OpenGL.
              [/quote]

              This indicates that you are not using your GPU.
              Check your drivers and try some test apps from your operating system that do GL (glgears is the simplest one).

              Edit: code tags are not quote tags :-) ; Andre

              1 Reply Last reply Reply Quote 0
              • W
                wonderman last edited by

                I find the solution of above problem. problem is related to continous intterupt received by CPU from SD card io driver which leads to poor perfromance of whole system.

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