Earlier quoted context omitted.
I think it was just short for Quartermaster so it might make sense aside from the Bond reference.
Yeah, has to be the abbreviation for Quartermaster. Even the exasperation of the character in the movies is obviously based on the demeanour of every ageing CQMS in the British Army (he doesn't appear in the Fleming books, where there's only the Q Branch responsible for supply).
A Quartermaster in the British Army is generally a commissioned officer, usually nowadays a Late Entry Officer (a soldier who has achieved the rank of at least Staff Sergeant I think, and then received a commission). Quartermasters are most often the rank of Major, but sometimes I've known them to be Lt Col (Pirbright Army Training Centre has a Lt Col for Quartermaster when I was there).
A Quartermaster is generally in charge of G4 (or J4 in the modern parlance) which is the Logistics staff branch[0].
CQMS (Company Quartermaster Sergeant) is universally a Non-commissioned Officer role. I have only ever seen CQMS of Warrant Officer Class 2 rank. CQMS are responsible for the G4 branch in a company or squadron sized unit.
At a Regimental level you'll often also have an RQMS, universally Warrant Officer Class 1 in my experience but sometimes filled temporarily by a senior WO2. That role was always a bit of a mystery to me, but generally seemed to keep the CQMS's in check and filter a lot of the faff from the QM.
Getting to the point - names...
You'd never call the Quartermaster Q. I'm not sure what would have happened if you did, but I imagine it wouldn't have been pleasant.
You'd always call the CQMS Q, especially if you were Commissioned or SSgt or above. A bold Sgt would get away with it if followed up with a swift sir/ma'am.
The RQMS was RQ, or sir/ma'am to anyone junior.
Add to the mix is the tradition of using "Salutation Surname" (i.e. Mr Brown, Mrs Red) to all Warrant Officers and you have a heady mix of options.
Edging closer to the point - the moniker Q in the books/movie would likely have come about from the abbreviation of CQMS. Which makes sense as Bond, as a 'front line' individual, would almost never actually see the actual Quartermaster, but would interact with his unit's CQMS who would be the one dealing with issuing and accounting for kit.
I believe Bond also had the rank of Commander. It would be customary for that rank to address a CQMS as Q, but never a Quartermaster with that letter.