As done for QtWidgets. Fixes a case where closing the dock widget wouldn't hide it. As reported by Roman