How to detect when a QDockWidget is moved out of a QMainWindow?

不羁的心 提交于 2019-12-10 17:49:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!