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. QQuickWidget is not repainting even when calling update

QQuickWidget is not repainting even when calling update

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 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.
  • K Offline
    K Offline
    karyon
    wrote on last edited by karyon
    #1

    I have integrated a QQuickWidget into a fairly large and old QWidget-based application.

    m_quickWidget = new QQuickWidget();
    m_quickWidget->setSource(..."foo.qml");
    m_quickWidget->setResizeMode(QQuickWidget::ResizeMode::SizeRootObjectToView);
    
    mainWindow->centralWidget()->layout()->addWidget(m_quickWidget);
    

    The problem is, this QQuickWidget does not repaint itself e.g. on animations or hover effects or when calling update(). For testing, I subclassed QQuickWidget and verified that paintEvent(QPaintEvent) is indeed not called in these cases. I also stepped into an update()-call, it does not take an early out and reaches the tlwExtra->backingStoreTracker->markDirty(clipped, q); line.

    The widget is visible, not hidden, visibleRegion is something sensible, updatesEnabled is true, click events work, calling repaint() works, and it repaints on resizes. I removed all instances of installEventFilter from the application, it still does not get any paint events. Putting the QQuickWidget into a separate window makes the repainting work.

    Using a QQuickView in a window container instead of the QQuickWidget does not show this problem, but introduces others, which is why we are trying to make the QQuickWidget work. We could also call repaint() in a timer set to 16 milliseconds and leave it at that, but that's a rather gross hack in my opinion.

    FWIW, the window, the central widget and one of its children is a native widgets, and we've set Qt::AA_DontCreateNativeWidgetSiblings for the QQuickWidget to render at all.

    Any suggestions how I can debug this would be welcome :)

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

      Hi and welcome to devnet,

      What version of Qt are you using ?
      On what platform ?
      Can you provide a minimal compilable example that shows that behaviour ?

      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
      • K Offline
        K Offline
        karyon
        wrote on last edited by
        #3

        Sorry. I tested with Qt 5.11.0 and 5.12.0, and newest Windows 10 x64. I have built a small application with roughly the same setup, but there the repaints work fine. Reducing our application to something minimal would take days, it is a rather large application. I know you folks can't debug my problem this way :) Nevertheless i hoped for pointers where i might look.

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

          In that case, I would start by re-building the UI adding one piece after the other so you don't go from scratch but check each item until it breaks.

          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
          1

          • Login

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