class KConfigDialog


Table of contents
Modules
kdeui Classes
All Classes
Module kdeui
Namespace global
Class KConfigDialog
Inherits KPageDialog

Standard %KDE configuration dialog class

The KConfigDialog class provides an easy and uniform means of displaying a settings dialog using KPageDialog, KConfigDialogManager and a KConfigSkeleton derived settings class.

KConfigDialog handles the enabling and disabling of buttons, creation of the dialog, and deletion of the widgets. Because of KConfigDialogManager, this class also manages: restoring the settings, reseting them to the default values, and saving them. This requires that the names of the widgets corresponding to configuration entries have to have the same name plus an additional "kcfg_" prefix. For example the widget named "kcfg_MyOption" would be associated with the configuration entry "MyOption".

Here is an example usage of KConfigDialog:

void KCoolApp.showSettings(){
if(KConfigDialog.showDialog("settings"))
return;
KConfigDialog *dialog = new KConfigDialog(this, "settings", MySettings.self());
dialog->setFaceType(KPageDialog.IconList);
dialog->addPage(new General(0, "General"), i18n("General") );
dialog->addPage(new Appearance(0, "Style"), i18n("Appearance") );
connect(dialog, SIGNAL(settingsChanged(const QString&)), mainWidget, SLOT(loadSettings()));
connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(loadSettings()));
dialog->show();
}

Other than the above code, each class that has settings in the dialog should have a loadSettings() type slot to read settings and perform any necessary changes.

For dialog appearance options (like buttons, default button, ...) please see

See also KPageDialog

See also KConfigSkeleton Author Waldo Bastian



methods