Q is a fictional male Human engineer/quartermaster in the James Bond, 007 series. The character was portrayed on screen by Desmond Llewelyn, John Cleese, Ben Whishaw. Q or Quartermaster makes gadgets for the Worlds Number 1 spy, James Bond. Without his gadgets, James Bond would be unable to save the world from terrorists such as Hugo Drax in Moonraker. In Dr. No, Q is referred to as Major Boothroyd not as 'Q' but in subsequent films, Boothroyd known as 'Q'. Q should not be confused with M who is the head of M.I.6..
In The World is Not Enough, we are introduced to 'R' who will move down the letters when the current 'Q' retires as the end of the film.
Q appears in most of the Bond films with the exceptions being Live and Let Die, Casino Royale and Quantum of Solace. Q makes a return as more youthful Quartermaster in Skyfall played by Ben Whishall. The original 'Q' had an admiration for Bond even if James Bond did seem to not be bothered by what Q was saying.
Q has been seen out in the field, he meets and greets James Bond when he arrives in Germany to hand over the keys to James new car and show how to drive the vehicle. In Licence to Kill, Q helps out with causing a diversion for James Bond with the help of C.I.A. agent Pam Bouvier.
Desmond Llewelyn got the job because the person who had played Q in the Dr. No was unable at the time to reprise his role and as they say, the rest is history. Desmond played the part of 'Q' from 1963 right up to and including 1999 where his character then retired. Sadly after the film came out, Desmond Llewelyn died in a car accident.
Some of the gadgets that got created by Q Branch got a little silly, for example, in Die Another Day, the Q branch come up with an invisible car, something that stretched the plausibility a little too much, not to say a mad man with a nuclear missile is plausible. Nuclear weapons are heavily guarded and someone could not just walk out with a ready made nuclear weapon. Although security is tight around Uranium Mines, trading in radioactive materials still occurs and it terrifies the jeebies out of international intelligence and law enforcement agencies.
When Daniel Craig became Bond, both Q and Miss Moneypenny characters were omitted from the stories because they wanted a break from the past and the stupidity of the gadgets. Both Moneypenny and Q were reintroduced in Skyfall and the gadgets such as a radio transmitter and a watch that also tells the time were introduced. James Bond and Q first meet in a museum and James Bond can't believe who the person the Quartermaster is because he's so young but in the end, he accept Q and takes the gadgets that have been given to him.
In Spectre, Q gets out from behind his desk and go out into the field to try to reign James Bond back but to little avail in Austria. In Austria, James Bond calls upon Q's skills to try and work out who is behind the terrorist attacks and see if there's a link between everything.
In reality, M.I.6. has a real life 'Q' branch which makes all the gadgets that the spies need including fake rocks. Ref: BBC. Whilst the latest 'Q' has been played by a man, in reality, the current real-life 'Q' is a female as the current M.I.6. head, Sir Alex Younger said in Jan 2017. Ref: The Guardian
In Dr. No, Q is introduced as Major Boothroyd when James Bond is told that his current weapon of choice a Baretta is highly unreliable and is replaced with the more familiar Walther PPK. Ian Fleming choose the name Boothroyd as a character when a firearms expert named Geoffrey Boothroyd wrote to Ian Fleming to criticise his choice of weapons and recommend a different one. Ian accepted Boothroyds advice and the character's real name became Boothroyd.
In Dr. No, Major Boothroyd was played by Peter Burton a British actor. When Burton was not available for From Russia With Love, Boothroyd became the more familiar Q and was now played by Desmond Llewelyn. Desmond would go on to play Q right up to 1999 when he passed the mantle to John Cleese who had portrayed 'R' in the The World is Not Enough.
Ben Wilshaw took on the role of Q when the producers decided to bring the Q branch back for Skyfall. They had decided to go for a younger actor rather than an older gentlemen which the previous Quartermaster had been in the previous films.