The problem was not with qMax() etc but with your constant.
If you declare a class member (variable) as static, then you have to define it (outside of the class body). Otherwise the linker will complain.

In your second case, you did not define a static class member, so the linker was happy.