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. Resizing of QQuickView very slow and flickering
Forum Update on Monday, May 27th 2025

Resizing of QQuickView very slow and flickering

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 4.3k Views
  • 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.
  • P Offline
    P Offline
    penpen
    wrote on last edited by
    #1

    Hi,

    I'm facing a problem when trying to resize Qml windows. It's very slow and flickering, which creates a very bad feedback for the user. Even with the most simple qml file (just a blue rectangle), I face the issue. Slow, flickering, with some black background showing up. A standard QWidget window doesn't have this issue.

    0_1501181787821_resize.gif

    I tried many things I've read on the internets, but none of these worked.

    Cpp

    int main(int argc, char *argv[])
    {
        QGuiApplication  app(argc, argv);
        QQuickView view;
        view.setResizeMode(QQuickView::SizeRootObjectToView);
        view.setSource(QUrl("qrc:/main.qml"));
        view.show();
        return app.exec();
    }
    

    QML

    import QtQuick 2.6
    
    Rectangle {
        visible: true
        color: "blue"
    }
    

    I'm using Qt 5.9 MSVC2017 64bit, on Windows 10 with a Geforce GTX 1060 6Gb.

    I guess there is nothing to do and it's related to the way Qml is rendered. But I find it very surprising that nobody seems to be concerned by this problem. How is it possible to make a "professional" application with this kind of behavior?

    Is there at least some workaround to repaint the widget only when we drop the cursor after a resize?

    Thanks for any help

    1 Reply Last reply
    2
    • P Offline
      P Offline
      penpen
      wrote on last edited by
      #2

      I've found some solution that is not perfect but muche better than default behavior

          QSurfaceFormat format;
          format.setSwapInterval(0);
          format.setRenderableType(QSurfaceFormat::OpenGL);
          view.setFormat(format);
      
      timdayT R 2 Replies Last reply
      1
      • P penpen

        I've found some solution that is not perfect but muche better than default behavior

            QSurfaceFormat format;
            format.setSwapInterval(0);
            format.setRenderableType(QSurfaceFormat::OpenGL);
            view.setFormat(format);
        
        timdayT Offline
        timdayT Offline
        timday
        wrote on last edited by
        #3

        @penpen Do you have any theory about why that works better? (Would love to see some video of it to compare with your original post).

        I used to worry about this sort of stuff (years ago now) quite a bit with the C++ widgets... problem was that window styling used to assume white-background apps, and if your app was anything else you'd have the same sort of horrid problems you show with resizing. I seem to remember that situation there could be improved by some tweaking of QStyle, but that was a widgets thing and would never help with new-world QQuickView apps. In any case the situation with OpenGL (at least on Windows and X11) always used to be pretty appalling, with resizing typically showing hideously scrambled former frames' content.

        1 Reply Last reply
        0
        • P penpen

          I've found some solution that is not perfect but muche better than default behavior

              QSurfaceFormat format;
              format.setSwapInterval(0);
              format.setRenderableType(QSurfaceFormat::OpenGL);
              view.setFormat(format);
          
          R Offline
          R Offline
          rec1978
          wrote on last edited by
          #4

          @penpen said in Resizing of QQuickView very slow and flickering:

          I've found some solution that is not perfect but muche better than default behavior

              QSurfaceFormat format;
              format.setSwapInterval(0);
              format.setRenderableType(QSurfaceFormat::OpenGL);
              view.setFormat(format);
          

          Ho, i have the same problem and the same GPU: 1060 6gb. Some solution?

          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