I have a lot of widgets in my application and I know I can drag them during runtime and place over another widget in order to merge them (both widgets are on same place and
If you want to layout two or more dock widgets as tabbed windows, you can either drag one dock widget over the other (as you properly described), or do that programaticaly using QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
function. As the function description says:
Moves second dock widget on top of first dock widget, creating a tabbed docked area in the main window.