Thinking about it more, UA won't transit anybody since they have no other flights there except for their return flight. For QR it's a hub and people on the flight into DOH can be arriving or continuing onward. So probably UA would just drop you off at the arrivals terminal with no chance to go the transit terminal. Then you'd have to do the immigration and visa thing.