Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Problems in Implementing Save Feature in Javascript app using Qt

Problems in Implementing Save Feature in Javascript app using Qt

Scheduled Pinned Locked Moved Qt WebKit
21 Posts 4 Posters 10.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rydik
    wrote on 24 Oct 2011, 05:55 last edited by
    #21

    I see this is a very old post but would have liked this solution shown for me when I found this post. JavaScript does has problems taking string with line breaks in it. In my case (read kml file stored on local hard drive, pass the string to JavaScript, and use the Google Earth extensions library to parse and display the kml file) the line breaks did not need to be conserved in a file load. To solve this I used:
    @
    QTextStream in(&file);
    QString wholeFile;
    QString line = in.readLine();
    wholeFile+=line;
    while (!line.isNull()) {
    line = in.readLine();
    wholeFile+=line;
    }
    @
    An alternative method:
    @
    QByteArray line = file.readAll();
    @
    does not play well with JavaScript.

    1 Reply Last reply
    0

    21/21

    24 Oct 2011, 05:55

    • Login

    • Login or register to search.
    21 out of 21
    • First post
      21/21
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved