KConfigDialog Class Reference
#include <kconfigdialog.h>
Inheritance diagram for KConfigDialog:

Signals | |
void | widgetModified () |
void | settingsChanged () |
void | settingsChanged (const char *dialogName) |
Public Member Functions | |
KConfigDialog (QWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false) | |
~KConfigDialog () | |
void | addPage (QWidget *page, const QString &itemName, const QString &pixmapName, const QString &header=QString::null, bool manage=true) |
virtual void | show () |
Static Public Member Functions | |
KConfigDialog * | exists (const char *name) |
bool | showDialog (const char *name) |
Protected Slots | |
virtual void | updateSettings () |
virtual void | updateWidgets () |
virtual void | updateWidgetsDefault () |
void | updateButtons () |
void | settingsChangedSlot () |
Protected Member Functions | |
virtual bool | hasChanged () |
virtual bool | isDefault () |
Detailed Description
- Author:
- Waldo Bastian <bastian@kde.org>
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(), KDialogBase::IconList); dialog->addPage(new General(0, "General"), i18n("General") ); dialog->addPage(new Appearance(0, "Style"), i18n("Appearance") ); connect(dialog, SIGNAL(settingsChanged()), mainWidget, SLOT(loadSettings())); connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); dialog->show(); }
Other then 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.
Please note that using the setMainWidgetmethod inherited from KDialogBase currently yields broken behaviour at runtime; use addPage instead.
- See also:
- KConfigSkeleton
- Since:
- 3.2
Definition at line 70 of file kconfigdialog.h.
Constructor & Destructor Documentation
|
Definition at line 48 of file kconfigdialog.cpp. References KDialogBase::applyClicked(), KDialogBase::defaultClicked(), KDialogBase::enableButton(), QAsciiDict< KConfigDialog >::insert(), KDialogBase::okClicked(), settingsChanged(), settingsChangedSlot(), QCString::sprintf(), updateButtons(), updateSettings(), updateWidgetsDefault(), and widgetModified(). |
|
Deconstructor, removes name from the list of open dialogs. Deletes private class.
Definition at line 88 of file kconfigdialog.cpp. References QAsciiDict< KConfigDialog >::remove(). |
Member Function Documentation
|
A widget in the dialog was modified.
Referenced by KConfigDialog(), and updateButtons(). |
|
One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button.
Referenced by KConfigDialog(), and settingsChangedSlot(). |
|
One or more of the settings have been permanently changed such as if the user clicked on the Apply or Ok button. This signal is useful when using KConfigDialog to configure items in a list. When emitted the main class would then know what item in the list was actually changed.
|
|
Adds page to the dialog and to KConfigDialogManager. When an application is done adding pages show() should be called to display the dialog. Note that after you call show() you can not add any more pages to the dialog.
Definition at line 94 of file kconfigdialog.cpp. References KDialogBase::addVBoxPage(), kdDebug(), KDialogBase::plainPage(), QWidget::reparent(), and KDialogBase::setMainWidget(). |
|
See if a dialog with the name 'name' already exists.
Definition at line 140 of file kconfigdialog.cpp. References QAsciiDict< KConfigDialog >::find(). Referenced by showDialog(). |
|
Attempts to show the dialog with the name 'name'.
Definition at line 145 of file kconfigdialog.cpp. |
|
Show the dialog.
Reimplemented from QDialog. Definition at line 171 of file kconfigdialog.cpp. References KDialogBase::enableButton(), hasChanged(), isDefault(), QDialog::show(), and updateWidgets(). Referenced by showDialog(). |
|
Update the settings from the dialog. Virtual function for custom additions. Example use: User clicks Ok or Apply button in a configure dialog. Definition at line 181 of file kconfigdialog.cpp. Referenced by KConfigDialog(). |
|
Update the dialog based on the settings. Virtual function for custom additions. Example use: Initialisation of dialog. Example use: User clicks Reset button in a configure dialog. Definition at line 185 of file kconfigdialog.cpp. Referenced by show(). |
|
Update the dialog based on the default settings. Virtual function for custom additions. Example use: User clicks Defaults button in a configure dialog. Definition at line 189 of file kconfigdialog.cpp. Referenced by KConfigDialog(). |
|
Returns whether the current state of the dialog is different from the current configutation. Virtual function for custom additions. Definition at line 207 of file kconfigdialog.h. Referenced by show(), and updateButtons(). |
|
Returns whether the current state of the dialog is the same as the default configuration.
Definition at line 213 of file kconfigdialog.h. Referenced by show(), and updateButtons(). |
|
Updates the Apply and Default buttons.
Definition at line 153 of file kconfigdialog.cpp. References KDialogBase::enableButton(), hasChanged(), isDefault(), and widgetModified(). Referenced by KConfigDialog(), and settingsChangedSlot(). |
|
Some setting was changed. Emit the signal with the dialogs name Definition at line 164 of file kconfigdialog.cpp. References settingsChanged(), and updateButtons(). Referenced by KConfigDialog(). |
The documentation for this class was generated from the following files: