A secretly armed vessel
disguised as a unarmed merchantment, used as a decoy to provoke an attack from a hidden enemy, (usually a submarine).
In the early days of submarine warfare, subs were very vulnerable, and restricted their attacks to weak targets, avoiding contact with warships or convoys with armed escorts. The Q-ships looked like lonely and helpless cargo vessels, luring submarines to the surface to sink them with deckgun fire and conserve torpedoes. When the sub moved in for the easy kill, the Q-ship bared its hidden teeth and blew it away.
