Fix Visual Studio build

Use Qt's qsnprintf() wrapper around snprintf() which is missing
in VS 2010.