问题
There is a signal which allows the user to know where a QDockWidget has been moved inside a QMainWindow :
void dockLocationChanged(Qt::DockWidgetArea area)
The problem is that this signal is not fired when a QDockWidget is moved out of the QMainWindow (either by dragging or by double-clicking the dockwidget's title bar).
Is there a way to detect that event, without reimplementing moveEvent()
?
回答1:
There is a floating
property exactly for that purpose, and a topLevelChanged
signal.
来源:https://stackoverflow.com/questions/38221768/how-to-detect-when-a-qdockwidget-is-moved-out-of-a-qmainwindow