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

[SOLVED]Saving Game Possibiliy in Qt question

Scheduled Pinned Locked Moved QML and Qt Quick
12 Posts 5 Posters 5.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.
  • EddyE Offline
    EddyE Offline
    Eddy
    wrote on last edited by
    #2

    Have a look at QSettings

    edit : oops, didn't see javascript

    Qt Certified Specialist
    www.edalsolutions.be

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #3

      It is not possible from JS AFAIK, but you always can use C++ backend.

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

        Hmmn.. so do i have to rewrite my codes in c++???

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

          Maybe this will help:
          http://doc.qt.nokia.com/4.7-snapshot/declarative-sqllocalstorage.html

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

            thank you loladiro.. I'll look at it :D thanks

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

              If you don't have any further questions, could you add [Solved] in front of the title (by editing the first post)?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DenisKormalev
                wrote on last edited by
                #8

                Not sure that sqlstorage is something needed for saving. In this case I'll add couple of methods in C++ part and will invoke them from QML. Not hard, really.

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

                  What do you exactly mean by that Sir Denis Kormalev?
                  Can you please tell me how to do it? or maybe a link will do..

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DenisKormalev
                    wrote on last edited by
                    #10

                    Look "here":http://doc.qt.nokia.com/4.7/qml-extending.html and maybe "here":http://doc.qt.nokia.com/4.7/qml-extending-tutorial-index.html .

                    In couple of words. The easiest solution for you will be to add QObject subclass to your project, add couple of slots (or Q_INVOKABLE methods) there and set its instance as context property for your declarative engine.

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

                      Is it fine if he make a XML file for saving his game? That's my plan for mine, by the way.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        DenisKormalev
                        wrote on last edited by
                        #12

                        Format choise is up to you :) If you need to store some tree data or you want to edit it in your text editor later or you just need non-binary format then xml is ok.

                        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
                        • Unsolved