In this case use printf or qDebug for catch crash,and it will be helpful in fufture if all your dangers code blocks will be wrap in try...catch() blocks