On Windows 7 with a multi-monitor setup, monitors are identified with numbers starting at 1. If a window with a QDockWidget is on a monitor to the left of "monitor 1" then the QDockWidget will fail to move when dragged to a different dock area. QDockWidget will successfully float, however if docked again, no matter what dock area is chosen it will revert to the most recent dock it occupied.
See this video for a demonstration of what this looks like, where the first monitor shown (on the right) is identified to Windows as #1, and the second (immediately to the left) is #2:
By reordering the monitors in the Windows settings such that monitor #1 is the left-most, the problem appears to be averted even if the other monitors are not in numeric order. Also, this does not happen for projects built in Qt 5.6; or with 5.7 on Linux Mint no matter how the monitors are arranged.
Steps to reproduce:
- Create dual monitor setup with primary on the right
- Launch example widgets\mainwindows\dockwidget on right monitor
- Move example to left monitor
- Undock dock widget on the right, try to redock left:
- Expected: Widget docks to left area
- Actual: Widget snaps to right dock area