[Interest] QML Mouse Event Transfer to Another QQuickWindow

Furkan Üzümcü furkanuzumcu at gmail.com
Thu Aug 22 23:27:55 CEST 2019


I'm working on a custom window docking solution with QM. One of the
requirements is that I would be able to drag a docked window and as soon as
it leaves a certain area, it un-docks itself and moves itself to a
After that point, I need to be able to continue the drag that I started in
a different window and keep dragging the new window that I just created.

As an example, I have a main window *MW *and an external QQuickWindow *EW.
EW *has a custom title bar. I start dragging *EW* and when I drop it over a
docking hot spot, the contentItem (*CI)* of *EW *is parented to a
All is good so far. Then, I press on the title in *CI *and start dragging
it. As soon as the drag reaches a certain threshold, *CI *is parented back
into *EW *and *EW *becomes visible. Now, when I change the parent of *CI*,
the initial mouse event that I started with the press gets canceled. So, I
send a custom mouse press event to *CI, *which is now in *EW. *Now, I
expect that the title bar would receive the following mouse move events and
I would be able to drag *EW. *Please note that I have not yet released the

Now, when I move the mouse around without releasing the press, the mouse
move events get delivered to *MW* and not *EW.* I installed an *eventFilter
*to log the events and all the mouse move events get delivered to *EW. *Now,
as soon as I release the mouse press and hover over *EW, *it starts
receiving the mouse move events.

You can see a minimal example here:

Furkan Üzümcü
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190822/0a280ac7/attachment.html>

More information about the Interest mailing list