Only reinterpret cast was needed for: reinterpret_cast<qptrdiff>(doc)
reinterpret_cast<qptrdiff>(doc)