So what does vainglorious mean?
1. Boastful, unwarranted pride in one's accomplishments or qualities.
2. Vain, ostentatious display.
Notice the "unwarranted" pride. My examples are from the old TV series M*A*S*H.
So I would consider Frank Burns to be vainglorious.
Whereas Charles Emerson Winchester III (irritating as he could be) was not--because he really was as good as he thought he was . . . minus the bedside manner.
Have you ever known anyone in real life who was vainglorious?