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
Forum Updated to NodeBB v4.3 + New Features

Problems in Implementing Save Feature in Javascript app using Qt

Scheduled Pinned Locked Moved Qt WebKit
21 Posts 4 Posters 11.9k Views 1 Watching
  • 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 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

    • Login

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