I had some question about the Q: tempo line in ABC. Here's the official word, from ABC Standard V1.6
Q - tempo; can be used to specify the notes per minute, e.g. if the default note length is an eighth note then Q:120 or Q:C=120 is 120 eighth notes per minute. Similarly Q:C3=40 would be 40 dotted quarter notes per minute. An absolute tempo may also be set, e.g. Q:1/8=120 is also 120 eighth notes per minute, irrespective of the default note length.
Note that there are no spaces after the Q:.
The recommended order is: X: T: M: L: K:
If you use Q: to set the tempo it is best between L: and K:
Q: is optional, and the only required headings are X:(tune no), T:(title), M:(meter), and K:(key).