Results 1 to 3 of 3

Thread: [SOLVED] Recreate .ini file

  1. #1
    Join Date
    Nov 2009
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default [SOLVED] Recreate .ini file

    Hi,

    i am working on a small application which stores some values in an .ini file. That is realized using QSettings & iniFormat.

    While launching the app i check if the file exists - and read the informations if possible.

    Right now i am wondering about one case

    What happens if there is no .ini at all ?

    What is the best way to create (in the background) a new file (with some example data) on a defined location after asking the user if the file should be re-created ?


    Any idea or help is appreciated
    Best regards
    el
    Last edited by el; 3rd December 2009 at 12:20.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Recreate .ini file

    Just add data to the settings object. The file will be created for you if it doesn't exist.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    el (3rd December 2009)

  4. #3
    Join Date
    Nov 2009
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Recreate .ini file

    That was too simple - thanks wysota for the quick reply & brain-freeing input

Similar Threads

  1. Double Clicking Pro File
    By BalaQT in forum Installation and Deployment
    Replies: 2
    Last Post: 18th November 2009, 05:23
  2. Read binary from file
    By weldpua2008 in forum Newbie
    Replies: 2
    Last Post: 3rd April 2009, 23:50
  3. How to Update in .ini file?
    By phillip_Qt in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2008, 13:40
  4. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.