HQ you are right but we are not talking about the same thing. Allied Q-ships were used as protection against military vessels (subs...). This was perfectly legal. Of course, Germany never depended on atlantic see lane for its survival. Consequently the allied had no reason to use Q-ships against merchant ship but who care.
The German ships, however, were commerce raiders and they were intended to chase and capture merchant vessels. That is privateering and this was banned in 1856 at the congress on maritime law in Paris.
Despite that congress, Germany, France and England used privateer ships during WWI. As a result, Germany was never charged for that after the end of the conflict. Such charges would have had to be brought against Britain and France as well, and that would have been silly, don't you think?
On the other hand, during WWII, Germany was the only country to use merchant raiders and, therefore, it was the only country to be charged with it. Military Vessels attacking merchant ships is an entirely different thing. That is perfectly legal (and still is) as long as you don't attack neutral ships. Actually, you can attack and sunk neutral ships as well: "Oops sorry we made a mistake". That stand as long as you are the winner. If you lose the war that quickly becomes a crime again.

Donitz had been charged with war crime because he ordered the German U-boot to leave no surivors. Several allied subs had the same type of habits (where would you put the survivors anyway?) but the allies won! Moreover, the Nazi crimes were so important that nobody was really paying attention to the ones comited by the allies.
As a conclusion, you can't use civilian motor boats armed with Cal.50 to attack a cargo (that's a crime!!) but you can gladly use a nuke to wipe out an ennemy merchant convoy (that's a perfectly legitimate act of war).