Results 1 to 3 of 3

Thread: QSettings setPath Scope

  1. #1
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QSettings setPath Scope

    Hi,
    Is it possible to have no scope somehow, since I would like to use a QSettings path that points to the directory of my program.
    Qt Code:
    1. QString programPath = QCoreApplication::applicationDirPath();
    2. QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, programPath + "/config");
    To copy to clipboard, switch view to plain text mode 
    This sets the path to %PROGRAM DIR%\config\USER NAME\
    I would like to save files to just %PROGRAM DIR%\config.

    Cheers,
    Phil Winder

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QSettings setPath Scope

    Try this:
    Qt Code:
    1. QString programPath = QCoreApplication::applicationDirPath();
    2. QSettings settings(programPath + "/config", QSettings::IniFormat);
    3. ...
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    philwinder (12th May 2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    73
    Thanks
    11
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Talking Re: QSettings setPath Scope

    Missed that one!
    As always, Thanks.

    Phil Winder
    www.philwinder.com

Similar Threads

  1. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 21:52
  2. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  3. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12: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.