qml: off-screen render DragItem to prevent flickering
-
grabToImage()does not need an item to be visible. However,DragItemneeds to be visible for it to prepare itself to display. Normally, it should be ready after it is polished, but it has no support for that. -
x,yshould not be bound to the parent size because they are only necessary before it is set visible. (Unnecessary calculations) -
x,ycan be set before it is set to visible, but still it is hard to eliminate flickering becauseOverlaysize seems to be incorrect (which needs to be the window size), and directly accessing window size and settingx,ystill yields flickering in some conditions.
grabToImage() already creates a layer, so we can justify creating a layer here. And by setting effect to an empty Item, the item will not be rendered in the main window.
Edited by Fatih Uzunoğlu