You are asking simply how to escape a C string. You'll need to use an online tool, such as http://www.digitalcoding.com/tools/addslashes-stripslashes.html, or a command line tool like echo '..' | sed -e 's-"-\"-g' > escaped.c, or any text editor's replace functionality - say NotePad++'s.
Using such a tool, your string becomes:
"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC- html40/strict.dtd\">rn
Just add a double quote at the beginning and at the end and you're all set:
auto foo = QStringLiteral(""-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC- html40/strict.dtd\">rn
");