3

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()?

IAmInPLS
  • 4,051
  • 4
  • 24
  • 57

1 Answers1

2

There is a floating property exactly for that purpose, and a topLevelChanged signal.

majk
  • 827
  • 5
  • 12
  • That's interesting. The docs don't say when `topLevelChanged` was added, but I remember wondering exactly what the OP asked back before Qt5. – jonspaceharper Jul 06 '16 at 11:26
  • Oh you're right, my question is not complete. I'll accept it anyway, but unfortunately, this signal is not emitted when you tabify a dock widget with another one already out of the main window... (neither is the signal `dockLocationChanged()`) – IAmInPLS Jul 06 '16 at 12:10
  • Changing `floating` property using `setFloating()` method, is not emitting `topLevelChanged()` signal. Is that expected? – harihardik Mar 05 '18 at 10:01