Dragging from my QTreeWidget to my custom QWidget works, except I noticed that there is a delay of a couple of seconds when I start my first drag. It's as if Qt is going through some kind of initialization, because there is no delay on subsequent drags.

I tried changing the code in my event handlers, but I could not get rid of the delay. I tried the Draggable Icons and Draggable Text examples in Qt Creator and found that they behave in the same way - a delay on the first drag, then no delay on subsequent drags. The problem seems to be within the Qt framework.

Perhaps the authors of Qt thought the delay would not be noticeable - but it is. I would like to find a way to force Qt to do the time-consuming drag initialization before the user does his first drag, so the delay will not be so noticeable.

Does anyone know the cause of the delay and a way to circumvent it?

I'm using Qt 5.5 on Windows 7.