QVariantMap in GroupDataModel - how to save and load

Hello

I have a GroupDataModel called _entries with QVariantMaps inside:

    QVariantMap entry;
    entry[key_1] = some_qstring;
    entry[key_2] = some_int;
    entry[key_3] = some_datetime;

    _entries->insert(entry);

My question is how to store this file?

Record appears to be simple:

QFile entriesFile(g_entriesFilePath);
QDataStream stream(&entriesFile); // Open a stream into the file.
stream << _entries;
entriesFile.close();

Is this correct? But how to load?

delete

QVariantMap entries = list.toMap();

and to do this

QVariantList list = jda.load(g_entriesFilePath).toList();

then scroll through the list

Tags: BlackBerry Developers

Similar Questions

  • Save and load the string table

    Hello

    is possible except an array of channel with multiple line of text file and load new file to table with the same size of array?

    Because when I use the code in the picture, initialized array is 3 x 3 but after save and load file is table 5 x 3.

    If is an option how to save this table in the file into 3 x 3 table and charge back of file as a 3 x 3 table?

    Thank your for any suggestion,.

    Petr

    Your code is loaded in 5 x 3 is because two of your cells have newline characters (\n). The reading of the worksheet VI use return or line break characters and your delimiter to figure out how to split the string into an array.

    A solution might be to replace all characters from end of line with something else, and then reinsert it after reading of the worksheet.

    It can do what you want, even if it's a bit bulky. It's a little confusing if you don't understand "------" string formatting, but it essntially replaces all '\r' and '\n' with '\\r' and '\\n', including the conversion of the worksheet does not read as an end of line character.

  • ActionScript 3 - Save and load for each level

    Can someone help me
    I create each level in different places.
    Stage 1 for level 1,
    Scene 2 to level 2... so now.

    I want when player push the home button on android hardware, it will save level or charge when the player wants to play the next time.

    I'm already searching the Internet and understand that I must use sharedObject to save and load. But I have found no code example appropriate for me to study.

    And now I don't know how to solve this problem.

    Create the SharedObject class and give it an instance in the first frame of the project:

    var mySO:SharedObject = SharedObject.getLocal ("myProjectID");

    var theScore:Number; It's the score of the player.

    if(!mySO.Data.myScore) / / check the shared object data if there is no data in the name myScore the value to 0, because the first round will not be any data in the shared object, we will write the data later.

    {

    theScore = 0;

    }

    on the other

    {

    theScore = mySO.data.myScore;

    }

    if(!mySO.Data.myFrameNumber) / / same thing here, we will check if there are data to the name myFrameNumber, if there is no, don't do anything.

    {

    fake;

    }

    else / / if there is

    {

    Stop (mySO.data.myFrameNumber, mySO.data.mySceneName);

    }

    All code above must be in the first image.

    NAW every time you want to update the data, for example when you go to the next level using:

    mySO.data.myFrameNumber = currentFrame; the current frame has been preserved in the name "myFrameNumber".

    mySO.data.mySceneName = currentScene.name; the current scene has been preserved in the name "mySceneName".

    mySO.data.myScore = theScore; the score was kept in the name "myScore.

    mySO.flush (); the new data has been written in the class of the shared object.

    You can write any value in the same way

    And if you want to delete the data for a use of reason:

    mySO.clear ();

  • Save and load curves

    I work with PS CS4 and can't figure out how to record and curves of load, which was in the curves dialog box.  The online Help menu indicates that I need to go to the «...» Option Save preset in the Panel menu. »

    For the life of me, I can't find an option "Save Preset" in the Panel menu.

    I hesitated to post this question, because the answer is bound to be easy stupifying, but I have been struggling with this for a while and just can not understand.

    Any help would be appreciated!

    Select the icon of curves (3rd from the top left side of the Panel settings) and use the Panel (top-right bar) menu to save and load. Your saved curves will also be second in the top of the list. Simply scroll to the top where the direction of the arrow and you will see.

  • I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    Trying to convert to the. WMV format:

    There are many converters available on the net... some
    free... some detail.

    The following freeware converter is just one example:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory (freeware)
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster download)
    (the file you want to download is: > FFSetup295.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the final screens)
    (Windows XP / Vista / 7)

    First, you will need to decompress the file or just open the
    Drag > FFSetup295.exe< out="" of="" the="">
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • I know not how to save and attachment to my Icoud player, but how to save the body of an email?

    I don't know how to save an attachment to an e-mail to Icloud drive but how do I save the body of an email to ICloud?

    Save it to the place where? For what purpose? As long as you do not remove it, it should remain in your email. You can move it to a folder by tapping on the icon of the folder at the bottom of the screen as you watch the email. You may also copy and paste Notes, take only a screenshot that would be in your Photos. You could transfer to a remark like Evernote service.

  • Start-up of the menu for my 4th gen Apple TV came in Chinese, and I can't figure out how to save and restart the whole upward in English (so I can read it).  Anyone know how to restart the whole upward in English?

    Start of the menu for my fourth generation Apple TV came in Chinese, I can't read. Can someone tell me how to save the boot menu and start again in English?

    I think that this article should help you:

    https://support.Apple.com/en-us/HT202799

  • New feature: Save and load tab sets

    When firefox starts up it restore my tabs previously open, saved to the last exit. To extend facilities to restore tabs on startup, I would like the ability to save (and later) a tab by using, for example, file-> options in the menu name.
    This Installation extension would give the possibility to connect several different sets of tabs, for example when I'm working on 2 or 3 different projects and want to combine several web pages each, or for example to open a set of tab of my favorite related web-sites.
    Currently I remember sets of tabs by organizing Favorites in folders and file-> new_tab and open the contents of the folder one by one.

    It is possible with the Session Manager extension:
    https://addons.Mozilla.org/en-us/Firefox/addon/2324

  • Best way to save and load the MovieClips in As3?

    Hello I am trying to understand the best way to record multiple clips when the application closes and load them when the application opens? PLZ!

    Physically, you can't add content in a swf file that you go back and find what you have created still exists.  You need to store information related to these new content in external storage (cookie, database, xml file, etc.) and then use that information to reconstruct this content when you reopen the file.

  • Save and load the game

    Hi, how are you guys? I hope you all well...

    I just have a question about the SWF...

    I mean that, i.ve made flash game, but there is a small problem that is (load game) and (except the game)

    orders, because when the player close the SWF the game will restart

    This my only question and I hope you guys can help with this problem

    Thank you

    If you want a game to be able to be registered in order to open it later can resume playback, then you must store the data relating to the game somewhere so that it can be retrieved when requested.  If you create a game online, your options are either save game data to a server-side file usng script server to write the data file, or save it in a database-side server-side, or save it as a SharedObject (the Flash version of a cookie).

    If you make an AIR application, so you can have the data stored in the ApplicationStorageDirectory or some other designated locale ApplicationDirectory.

  • How to save and delete the file

    Hi, I'm really confused on how to use my computer. When I save the files that they disappear. Say if I record a song that it does not record the "music" file I only find under downloads. I also have a bunch of pictures I want to delete and I don't know how. Also open PDF files full screen and I don't want them that way. How can I fix it? :(

    When you delete a file from your computer, it is actually just moved to the trash, where it is temporarily stored until the Recycle Bin is empty. This gives you an opportunity to recover accidentally deleted files and bring back them to their original location.

  • Adding objects to an Image, and then save and load on the re-opening and closing

    Hey everyone, as some of you may or do not know, I am currently taking an Android and iOS game, using Flash and AS3. In the menu, you can customize what looks like your character by adjusting with a color slider and adding machines to the character by selecting the desired speed. When you click on a certain piece of equipment to add to your character, it puts 3 pieces of gear on your character: head, right foot and left foot, respectively. I do this using the code below:

    var head: Loader = new Loader();

    var RightLeg:Loader = new Loader();

    var LeftLeg:Loader = new Loader();

    Add.addEventListener (MouseEvent.CLICK, loadPic1);

    Remove.addEventListener (MouseEvent.CLICK, removePic1);

    function loadPic1 (MouseEvent): void {}

    var headRequest:URLRequest = new URLRequest ("TestHead.png");

    Head.Load (headRequest);

    Head.y = - 150;

    Sliders.Dino.Head.addChild (Head);

    var rightRequest:URLRequest = new URLRequest ("TestRightLeg.png");

    RightLeg.load (rightRequest);

    Sliders.Dino.RightLeg.addChild (RightLeg);

    var leftRequest:URLRequest = new URLRequest ("TestLeftLeg.png");

    LeftLeg.load (leftRequest);

    Sliders.Dino.LeftLeg.addChild (LeftLeg);

    }

    function removePic1 (MouseEvent): void {}

    Head.Unload ();

    RightLeg.unload ();

    LeftLeg.unload ();

    }

    This set works very well for test purposes. Is anyway to add the train directly to the image, save it in its current state, then when opened (or loaded into the game), it loads the image you previously saved with the machine on it?

    Thanks in advance!

    :

    var head: Loader = new Loader();

    var RightLeg:Loader = new Loader();

    var LeftLeg:Loader = new Loader();

    var so:SharedObject = SharedObject.getLocal ("myStuff", "/");

    the way your code is setup, if you add a part of the body, you added all three parts

    {if (SO. Data.Head)}

    loadPic1 (null);

    }

    Add.addEventListener (MouseEvent.CLICK, loadPic1);

    Remove.addEventListener (MouseEvent.CLICK, removePic1);

    function loadPic1 (MouseEvent): void {}

    var headRequest:URLRequest = new URLRequest ("TestHead.png");

    Head.Load (headRequest);

    Head.y = - 150;

    Sliders.Dino.Head.addChild (Head);

    var rightRequest:URLRequest = new URLRequest ("TestRightLeg.png");

    RightLeg.load (rightRequest);

    Sliders.Dino.RightLeg.addChild (RightLeg);

    var leftRequest:URLRequest = new URLRequest ("TestLeftLeg.png");

    LeftLeg.load (leftRequest);

    Sliders.Dino.LeftLeg.addChild (LeftLeg);

    so. Data .head = true;

    so. Flush();

    }

    function removePic1 (MouseEvent): void {}

    Head.Unload ();

    RightLeg.unload ();

    LeftLeg.unload ();

    so. Data .head = false;

    so. Flush();

    }

  • How to save and print after emailing

    I am working on a form where the company wants to the end user the opportunity to print or save after the email is sent. Is it possible to do, and how could you do that?

    Thank you

    MDawn

    Hello MDawn,

    You can write the following script in the event 'postSubmit' of the Email button

    app.execMenuItem ("SaveAs");  to save the form


    XFA. Host.Print (1, "0", (xfa.host.numPages - 1) m:System.NET.SocketAddress.ToString (), 0, 0, 0, 0, 0);
    / / print the form 

    Thank you

    Stéphane.

  • How to save and export the address book from thunderbird to MS Excel

    I need to save my address book content in a file in order to protect all my contacts in case of PC failure and be able to export it.

    Open the address book window.
    Select tools-export
    To open it in Excel and save it as a comma separated file

  • How to save and pass the variable to the BindingInfo resources xWebSite DSC setting.

    Let's say I want to share data and configuration and I would love to sites linking information in the DSCConfigurationdata file, separately from DSC configuration like this:

    xWebsite xWebsite1
    {
    Name = "site.name.com".
    ApplicationPool = "site.name.com."
    Ensure = 'Present '.
    PhysicalPath = "C:\Inetpub\wwwroot\site.name.com."
    State = "started".
    BindingInfo = $Node.BindingInfo
    }

    and DSCConfigurationdata file will contain something following:

    BindingInfo = @)
    @{
    Protocol = "HTTP".
    Port = 80
    IPAddress = "1.1.1.1".
    Hostname = "site.name.com."
    },
    @{
    Protocol = 'HTTPS '.
    Port = 443
    IPAddress = "1.1.1.1".
    Hostname = "site.name.com."
    CertificateThumbprint = "54634563456345."
    NomMagasinCertificat = "accommodation".
    }
    )

    [But since BindingInfo must be of type [CimInstance []]] and it's resource set instance specific ICD I can instantiate and create an array of items of CimInstance (actually MSFT_xWebBindingInformation class).

    So can anyone please can help me on how to do this.

    Thanks in advance.

    JK

    This issue is outside the scope of this site and must be placed on Technet or MSDN

Maybe you are looking for

  • stream hp factory reset 7

    How to get rid of the blue screen... Yes I pressed the power button and the volume upward and down key but I still have a blue screen that says TPM (trusted platform module module) WARNING: Compensation erase the information stored on the TPM module.

  • HP15-r005la: Bios locked, solicito ayuda

    Greetings, I have a laptop of this model, hp: 15-r005la, rev: 22 13 - 100, [personal information deleted] al encenderla me pide contrasena para entrar al bios there're no recuerdo cual, el código Québec me muestra are '69304144', solicito su ayuda is

  • The screen saver settings

    I recently replaced Windows XP with Windows 7 and was disappointed.  Previously, I would have my pictures slideshow as screensaver. Using the parameters, I could see the file/folder from any photo. I found this to be a very useful feature. Is it poss

  • NAT IPSEC site to site VPN ASA 8.4

    My goal is to create a VPN to me (61.227.106.64) to a seller (9.105.8.204) using an ASA 5510 with 8.4 on it. Local private networks of the seller is 10.134.115.0/24 and 10.135.115.0/24. My private LAN is 10.11.102.0/24 but I want NAT it to 61.227.106

  • IMPLEMENT A REDUNDANCY OF TMS

    I am configuring TMS 15.1 redundancy VM server to a different location other then the main server... It's about 2 clicks on the road. The only document of redundancy I found was the redundancy of CISCO's MSDS for 13.2 Guide?  Is there a newer version