'Q' was a document used as source material by the authors of Matthew and Luke. It does not appear to have been known to the author of Mark's Gospel.
Q was a document containing sayings attributed to Jesus, and is believed to have been written in four distinct layers over time.