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. QDeclarativeView + QGLWidget . BackBuffer updating incorrectly.
Forum Updated to NodeBB v4.3 + New Features

QDeclarativeView + QGLWidget . BackBuffer updating incorrectly.

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 4.4k 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.
  • H Offline
    H Offline
    Hornsj2
    wrote on last edited by
    #1

    I'm QDeclarativeView and setting a QGLWidget as the viewport, which you can see the example of below.

    My problem is that the viewport is not being cleared before the next frame is drawn, thus each successive frame is drawn on top of the last (frames accumulate). Normally OpenGL would swap buffers, clear the buffer, and draw the new frame.

    Has anyone seen this problem?

    Also, if someone knows how to get the viewport to be completely transparent when using a QGLWidget as a background that would be great to know too.

    @//in the initializer list... creating a declarativeview called m_pathViewWidget
    //...
    m_pathViewWidget(new QDeclarativeView(QUrl::fromLocalFile("./files/pathview-example.qml"),this))
    {
    m_pathViewWidget->setObjectName("CentralWidget");
    QGLFormat fmt = QGLFormat::defaultFormat();
    QGLWidget* glWidget = new QGLWidget(fmt);

    m_pathViewWidget->setViewport(glWidget);@
    
    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Try adding a call to:

      @
      m_pathViewWidget->setViewportUpdateMode( QGraphicsView::FullViewportUpdate );
      @

      that tells the QGraphicsView (QDeclarativeView) that the viewport does not support partial updates and so should be cleared every frame.

      Does that fix it for you?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hornsj2
        wrote on last edited by
        #3

        Hi again.

        I'll have to double check my results. I ran across an example with that and tried it.

        With or without it I believe I was seeing the same behavior but only in the following instance:

        In my QML file I would specify the main rectangle with a color of "#00ffffff" (that is, transparent). This would work fine when not using a QGLWidget as a viewport.

        When I use a QGLWidget as a viewport the DeclarativeView background is entirely black (the widget), the rectangle (main QML item) background does, in fact, become transparent. However, anything which is rendered is accumulated on the screen as described above. It is almost as if it stops swapping buffers.

        I should also mention I'm not knowingly using any QGraphicsView objects, although I have tried that call as I said.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hornsj2
          wrote on last edited by
          #4

          I'm going to mark this as solved.

          The problem only surfaced on the ARM processor I'm working with. On the desktop the problem did not show itself.

          I moved to a QtQuick application from my QML / Qt hybrid and the screen is updated correctly in the embedded environment.

          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