What is the meaning of the expression Q.E.D.? Is it similar to ■ appearing at the end of a theorem? I am curious about the meaning of the word Q.E.D. that is often written after a proof of a theorem (some math books use this convention). 
Edit: Is it similar to the box being placed after a proof of a theorem? Also, what is the history of the development from Q.E.D. to ■ ?
 A: It's an abbreviation of quod erat demonstrandum, which is the Latin translation of a Greek phrase meaning "which had to be proven".  To the ancient Greeks, a proof wasn't complete unless the last sentence in your proof was basically the statement of the theorem. Putting QED after that sentence was their way of saying, "and that's what I was trying to prove, so there, I've proved it".
We aren't so strict about proofs anymore, but as a practical matter it's very useful to have a definitive mark that indicates the proof is over.  Some authors use Q.E.D. as that mark, some authors use the box.  There is no difference in meaning, which one is used is just a stylistic choice of the author.
Per your edit: The box $\Box$ is actually called a tombstone.  It had long been used in magazines to indicate the end of an article.  Paul Halmos was the first mathematician to start using it to indicate the end of a proof.
A: From A Comprehensive Dictionary of Mathematics by Roger Thompson: "quod erat demonstrandum" (Latin) -- This stems from medieval translators' habitual tendency of translating the Greek for "this was to be demonstrated" to the Latin phrase above. This appeared originally at the end of many of Euclid's propositions, signifying that he had proved what he set out to prove. 
Nowadays, many people do not end their proofs with quod erat demonstrandum or Q.E.D. but with $\Box$ or $\blacksquare$; there are other variants too, of course, but the overall meaning is to ultimately signify the end of a proof. 

From Encyclopedia of Mathematics by James Tanton [supplemental]: The initials QEF, for quod erat faciendum (which was to be done), are sometimes added after the completion of a geometrical construction, and QEI, for quod erat inveniendum (which was to be found), after the completion of a calculation. 

From Origins of Mathematical Words - A Comprehensive Dictionary of Latin, Greek, and Arabic Roots by Anthony Lo Bello:

A: The meaning of the expresson Q.E.D is express quod erat demonstrandum.
