Results 1 to 3 of 3

Thread: Problem with QSettings

  1. #1
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with QSettings

    hi,
    i am trying to use QSettings for storing som config info.

    i am using IniFormat with a specific path. I can't get my inifile created.

    to simplify the case, i wrote the simplest code below. even that does not seem to work. This is so simple and I guess i am missing something. but what?
    Qt Code:
    1. QSettings s("test.ini", QSettings::IniFormat);
    2. int stat = s.status(); // this returns 0
    3. s.setValue("someconfig","somevalue");
    4. stat = s.status(); // this returns 0
    To copy to clipboard, switch view to plain text mode 

    after running the above code without errors , i am looking for "test.ini"
    there is no such file.

    is there something more i must add into my code?

    thanks..

  2. #2
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with QSettings

    the problem somehow disappeared.. now it works although i dont know what i changed.

    anyway. its gone..

  3. #3
    Join Date
    Jan 2008
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with QSettings

    I don't think the ini file is saved until the object is destroyed or when you call QSettings::sync()

    Pierre

  4. The following user says thank you to bleucanard for this useful post:

    arbi (24th September 2008)

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. QSettings problem?
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2008, 21:14
  4. problem with paint and erase in frame
    By M.A.M in forum Qt Programming
    Replies: 9
    Last Post: 4th May 2008, 20:17
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.