Change from foreach to Q_FOREACH