My understanding of halacha:
"Quality of life" has no meaning. All life is of value. An aged Rabbi, a newborn, a IV drug abuser with AIDS.
When a person's underlying disease will, in natural circumstances, kill him shortly and medicine has no know cure, a person does not have to be treated - but may be treated if he wants.
Family has no say in when to stop treatment - only the patient. He will know when the pain is too great and the bother too much. (Sometimes family is tired out from the ordeal and/or can't bear to see their loved one in such pain.)
Treatment includes medical interventions such as putting on a respirator or doing a procedure. It does NOT include giving fluid and nutrition - these are to be continued to the end. Antibiotics and other medication has varied pesaks - depending on th eRav and circumstance.