One way to clean cloudy glassware involves soaking it in distilled white vinegar, rinsing and drying. If this method is not effective, it could be the result of calcium and magnesium from hard water.
Vinegar can also be used in the dishwasher to help keep glasses sparkling by pouring about a cup in the bottom of the dishwasher in addition to the regular dishwashing detergent and running the cycle as normal.
Water hardness also has an effect on cloudiness. In an area with soft water, using less than recommended of a detergent that is low in phosphates can avoid cloudiness. Hard water can leave spots on glasses when they are left to air dry. Wiping the glass with an acetone nail polish remover, then washing with a gentle dish detergent can remove these spots.