PDA

View Full Version : QSettings setPath Scope



philwinder
6th May 2008, 15:12
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.

QString programPath = QCoreApplication::applicationDirPath();
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, programPath + "/config");
This sets the path to %PROGRAM DIR%\config\USER NAME\
I would like to save files to just %PROGRAM DIR%\config.

Cheers,
Phil Winder

jpn
12th May 2008, 19:45
Try this:


QString programPath = QCoreApplication::applicationDirPath();
QSettings settings(programPath + "/config", QSettings::IniFormat);
...

philwinder
12th May 2008, 21:09
Missed that one!
As always, Thanks.

Phil Winder
www.philwinder.com