Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QT QML with OpenGL
Forum Updated to NodeBB v4.3 + New Features

QT QML with OpenGL

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 3.3k 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.
  • W Offline
    W Offline
    wonderman
    wrote on 12 Feb 2013, 09:40 last edited by
    #1

    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
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 12 Feb 2013, 09:58 last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wonderman
        wrote on 12 Feb 2013, 10:28 last edited by
        #3

        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
        0
        • W Offline
          W Offline
          wonderman
          wrote on 14 Feb 2013, 05:55 last edited by
          #4

          Is there any comments?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tzander
            wrote on 14 Feb 2013, 06:15 last edited by
            #5

            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
            0
            • W Offline
              W Offline
              wonderman
              wrote on 8 Apr 2013, 07:18 last edited by
              #6

              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
              0

              • Login

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