Hello,

I need to send a string which contains newline to javascript function as an argument.

Qt Code:
  1. Example:
  2. QString sampleString = "first line \n second line.";
  3.  
  4. const char *kModifyString="\
  5. function modifyString(str)\
  6. {\
  7. return str;\
  8. }\
  9. modifyString(\"%1\");";
  10.  
  11. webFrame->evaluateJavaScript(QString(kModifyString).arg(sampleString ));
To copy to clipboard, switch view to plain text mode 
But %1 do not take QString with newline.

How can I handle this situation? I need to send sampleString to javascript function as argument.

Thanks,