https://www.copperspice.com/docs/cs_api/class_qsettings.html#acd273b6e9d88af199eb278231a5bd24a
Code: Select all
QStringList configLocations = QStandardPaths::standardLocations( QStandardPaths::AppConfigLocation );
qDebug() << "AppConfigLocation: " << configLocations << "\n";
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configLocations[0] );
Code: Select all
AppConfigLocation: (/home/roland/.config/LogikalSolutions/RedDiamond, /etc/xdg/xdg-ubuntu/LogikalSolutions/RedDiamond, /etc/xdg/LogikalSolutions/RedDiamond)
when
Code: Select all
m_settings = new QSettings( m_configName, QSettings::IniFormat, this );
Code: Select all
roland@roland-HP-EliteDesk-800-G2-SFF:~/.config$ ls LogikalSolutions
RedDiamondDefault.conf RedDiamondLastUsed.conf
roland@roland-HP-EliteDesk-800-G2-SFF:~/.config$
The deprecated setUserIniPath() works perfectly.