Could you use `contents.indexOf(QLatin1String("\n{"))` for this?