QT QML with OpenGL



  • 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


  • Moderators

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



  • 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



  • Is there any comments?



  • 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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.