To mind you P's and Q's refers to the old days of moveable type, where a lowercase q and lowercase p look similar, and some apprentices would mix them up.

That's what I've heard at least.