Solved Resizing of QQuickView very slow and flickering
-
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.
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
-
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);
-
@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.
-
@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?