#include#include int main() { KSharedConfigPtr config = KSharedConfig::openConfig(); // open the kglobalconfig.ini file KConfigGroup group(config, "MyAppSettings"); // create a group named MyAppSettings QString value = "Hello World!"; group.writeEntry("WelcomeMessage", value); // set the key WelcomeMessage to the value "Hello World!" }
#includeThese code examples demonstrate how to use the writeEntry() function of KConfigGroup to set configuration values for a particular key in a group. The package library for this module is likely the KDE Frameworks library.#include int main() { KSharedConfigPtr config = KSharedConfig::openConfig(); // open the kglobalconfig.ini file KConfigGroup group(config, "MyAppSettings"); // create a group named MyAppSettings bool value = true; group.writeEntry("ShowWelcomeMessage", value); // set the key ShowWelcomeMessage to the boolean value true }