Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Saving data to files
Qt 6.11 is out! See what's new in the release blog

Saving data to files

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I created a program in QML that calculates and keeps score in a game called marias (it is a popular cad game in Czech Republic). I would like to save the scores to an external text file. Can I do this in JavaScript in QML?

    I have absolutely no experiences in C++ programming, so I would like to avoid using C++ functions to save the file. I have experiences with PySide/QML but I would also like to avoid Python for this program.

    Btw. I plan to use the application mainly on my Windows 7 UMPC and Android phone. So I probably need to distinguish between these two platforms and choose the right folder to save the files.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hi,

      You can use SQL database. I think it would be the easies way. Take a look at "this example":http://doc.qt.nokia.com/4.7-snapshot/declarative-tutorials-samegame-samegame4.html#keeping-a-high-scores-table

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        It it doen not have to be text, I would go for the SQL stuff task_struct suggests. If you need to go with a text file, you have little choice but to use either C++ or Python.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Thank you for the advice to use SQL. I didn't think about storing the data in database, but it is the best solution for me. Btw. where is the database physically stored?

          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