Btw you shouldn't be using sprintf(). What's wrong with QString str = QString("Foo %1").arg(QString::number(param)) or QString str = "Foo " + QString::number(param)?
Also, I recommend you use C++ reinterpret_cast, etc as C style casting will not warn you and you will have trouble finding the problem in the end.
Bookmarks