Results 1 to 5 of 5

Thread: not able to save form data to json file

  1. #1
    Join Date
    Mar 2016
    Posts
    5
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Question not able to save form data to json file

    Hello friends,

    I'm new to QT and i am facing problem with the use of json file in QT.
    I want to save the "Form data " on click on pushbutton (such as multiple student information) to json file and again load the respective student data.

    Can anybody suggest me how to do that?

    Thanks in advance.

    Regards,
    Shoeb

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: not able to save form data to json file

    What do you have so far?

    Did you create a QJsonDocument containing your data?

    Cheers,
    _

  3. #3
    Join Date
    Mar 2016
    Posts
    5
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: not able to save form data to json file

    Hi,

    No.. i'm not understanding that how to create QJsonDocument.

    I have saved that data in QJsonObject.

    -Shoeb

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: not able to save form data to json file


  5. The following user says thank you to anda_skoa for this useful post:

    shoeb (5th April 2016)

  6. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: not able to save form data to json file

    Or just construct it from the QJsonObject using QJsonDocument::QJsonDocument()
    Qt Code:
    1. QJSonObject object;
    2. // build JSON object
    3. QJsonDocument doc(object);
    To copy to clipboard, switch view to plain text mode 

  7. The following user says thank you to ChrisW67 for this useful post:

    shoeb (5th April 2016)

Similar Threads

  1. Save/Load JSON using QML
    By aIsmail in forum Newbie
    Replies: 1
    Last Post: 16th November 2015, 08:51
  2. Save binary data into XML file
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2013, 11:16
  3. Replies: 1
    Last Post: 30th November 2012, 17:54
  4. present data in tabular form reading from a file
    By sachinmcajnu in forum Qt Programming
    Replies: 1
    Last Post: 2nd April 2011, 14:53
  5. Problem with save data from model to file
    By matulik in forum Newbie
    Replies: 0
    Last Post: 24th May 2010, 15:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.