new window cannot direct move
-
I want to drag and drop a new window in the main window. I have created a new window in the mouseMoveEvent of the main window, and I want to continue to drag and drop the new window to place it in the right place without stopping the dragging, but the response to mouseMoveEvent and mouseReleaseEvent after I setFocus() is still the previous main window, what should I do?
-
@0ices
Hello and welcome.I have not heard of making a window the subject of drag & drop. Nor of creating a new window in a
mouseMoveEvent
, that would create hundreds of them as the mouse is moved. If anything I would have thought duringmousePressEvent
.It sounds to me as though you are creating this new window while you are in the middle of a mouse drag event on the main window --- you already have the mouse pressed down and you are dragging it? In that situation I do not know that you can/it is easy to "change" the drag which is currently in progress over the main window so that now this new window is focused and receives mouse events.
The more usual way, it seems to me, would be: create whatever this new window is first, perhaps on main window mouse down, and then initiate a drag and drop event on it.