nitpick: you use qobject_cast<> but never check the return value, so why not just static_cast?