Iron Man and Spider-Man broke into the Q-Ship to rescue Doctor Strange and stop his captor, Ebony Maw, from retrieving the Time Stone. They killed Ebony Maw by ejecting him into space and stayed with Strange in the ship, which was en route to Titan, so that they could defeat Thanos. Iron Man and Spider-Man crashed the vessel on Titan, where it was soon stormed by the Guardians of the Galaxy. The two groups had a brief scuffle until they realized that they were all on the same side against Thanos.
The meaning behind the name "Q-Ship", first revealed by Entertainment Weekly, has not yet been clarified; the ship was never referred to by that name in Avengers: Infinity War. However, the side view of the ship does visually resemble the letter "Q", suggesting that "Q-Ship" is a colloquialism for the vehicle.