Results 1 to 6 of 6

Thread: change path of settings ini file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    247
    Thanks
    29
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default change path of settings ini file

    hi,

    I want to portably (both as in inter-os as well as in portable software) store the settings for my application.
    To do that, i decided to save them in the INIformat to the same directory as the executable.


    Qt Code:
    1. QSettings::setDefaultFormat(QSettings::IniFormat);
    2. QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, a.applicationDirPath());
    3.  
    4.  
    5.  
    6. st.setValue("test", 1234);
    7. st.sync();
    To copy to clipboard, switch view to plain text mode 

    This works well, but creates an unnecessary folder:

    ./mycompany/myapp.ini

    I`d like it to be

    ./myapp.ini

    is taht possible?


    edit:
    removed original post. Turns out setPath() is a static method, even though my IDE lead me to believe differently..
    Last edited by tuli; 20th October 2012 at 11:44.

Similar Threads

  1. Replies: 1
    Last Post: 17th February 2012, 02:28
  2. Replies: 2
    Last Post: 16th November 2011, 11:18
  3. Qt Creator 1.0.0 - LIB & PATH settings in Ubuntu
    By qoo in forum Installation and Deployment
    Replies: 1
    Last Post: 20th April 2009, 08:35
  4. How to change Path
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2007, 08:29
  5. Replies: 3
    Last Post: 31st March 2006, 18:38

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
  •  
Qt is a trademark of The Qt Company.