Use qMax() instead of checking with an if after setting the value