Greetings.

I develop drag-and-drop tabs, like in chrome or Visual Studio (with the ability to become a window and back tab, the logic is completely the same). Implemented the function of converting a tab to a window (at the mouseMoveEvent event mouseMoveEvent it is assigned setParent(nullptr); ), the window can also be moved by pulling the tab.

Actually the question :

Suppose we dragged the tab, and it became a separate window. How now when dragging this window to determine that we are above the tab bar of another window (at this point the window should turn back into a tab)? Everything is complicated by the fact that the tab bar may not be one, but several: we can create an unlimited number of windows and create an unlimited number of tabs inside these windows, and no matter what tab bar we bring our window to, it should turn into a tab inside that tab bar we hovering over.

Hence the idea that it is more convenient to track the movement of tabs (windows) on the side of the tab bar, rather than calculate the coordinates of all available tab panels. Those. the tab bar somehow has to find out that the mouse cursor is over it, the left mouse button is pressed and the cursor is dragging the tab behind it, and then somehow add this window to itself in the tabs.

How can this be done?

  • Qt has Drag and Drop doc.qt.io/qt-5/dnd.html - Wanket
  • @Wanket no, Drag and Drop is not that. What we can observe in chrome or studio is not DnD, but the dragging of real windows. - LNK

0