KSharedConfigPtr config = KSharedConfig::openConfig(); QString mySetting = config->group("myApp").readEntry("mySetting", "defaultValue");
KSharedConfigPtr config = KSharedConfig::openConfig(); config->group("myApp").writeEntry("mySetting", "newValue"); config->sync();This code opens the default configuration file and writes a new value to the "mySetting" setting in the "myApp" group. The sync() method saves the changes to disk. The ksharedconfig Ptr is part of the KDE Frameworks package.