It was a vulgar expression of frustration and alarm, but not a "swear" because he was not making an oath. The modern use of the term "swearing" is only distantly connected with the practice of making oaths. Jesus spoke about this... He said "Let your yes be yes and your no be no; anything further than that is evil" (a paraphrase). There was a practice, and still is, where in order to convince someone of your truthfulness, you swear, perhaps "on a stack of Bibles"... that's making an oath. I have never been in court, but I've often wondered what I would do if told to put my hand on a Bible and swear to tell the truth. I would consider opening the Bible, reading that passage, and saying to the judge, "Yes, I will tell the truth". I might get a contempt warning with that though.
I recall discussing the issue of certain four-letter words with my Dad when I was a teen. I argued that sometimes, such words are the most precise and concise expressions of thought and feeling that you can muster. I'd say that Q in the movie clip did exactly that, even if some would be offended by it.