KSettings::Dialog Class Reference
Main classes | Settings UI classes

`#include <dialog.h>`

Inherits QObject.

## Public Types

enum | ContentInListView { Static, Configurable }

## Public Slots

void | show ()

## Signals

void | pluginSelectionChanged ()

## Public Member Functions

| Dialog (QWidget *parent=0, const char *name=0)
| Dialog (ContentInListView content=Static, QWidget *parent=0, const char *name=0)
| Dialog (const QStringList &components, QWidget *parent=0, const char *name=0)
| Dialog (const QStringList &components, ContentInListView content, QWidget *parent=0, const char *name=0)
void | addPluginInfos (const QValueList< KPluginInfo * > &plugininfos)
KCMultiDialog * | dialog ()

## Protected Slots

void | configureTree ()
void | updateTreeList ()

## Friends

class | PageNode

## Detailed Description

Generic configuration dialog that even works over component boundaries.

For more information see KSettings.

This class aims to standardize the use of configuration dialogs in KDE applications. Especially when using KParts and/or Plugins you face problems creating a consistent config dialog.

To show a configuration dialog you only have to call the show method and be done with it. A code example:

You initialize `m_cfgdlg` with

m_cfgdlg = new Dialog( Dialog::Static, this );

If you use a KPart that was not especially designed for your app you can use the second constructor:

QStringList kpartslist;
for( all my kparts )
kpartslist += m_mypart->instance().instanceName();
m_cfgdlg = new Dialog( kpartslist, this );

and the action for the config dialog is connected to the show slot:

KStdAction::preferences( m_cfgdlg, SLOT( show() ), actionCollection() );

If you need to be informed when the config was changed and applied in the dialog you might want to take a look at Dispatcher.

For more information see KSettings.

Author
  Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Since
  3.2

Definition at line 73 of file dialog.h.

## Member Enumeration Documentation

enum KSettings::Dialog::ContentInListView

Tells the dialog whether the entries in the listview are all static or whether it should add a Configure...

button to select which parts of the optional functionality should be active or not.

Enumerator
Static | Static listview, while running no entries are added or deleted.
Configurable | Configurable listview. The user can select what functionality he wants.

Definition at line 83 of file dialog.h.

## Constructor & Destructor Documentation

KSettings::Dialog::Dialog | ( | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |  |

Construct a new Preferences Dialog for the application.

It uses all KCMs with X-KDE-ParentApp set to KGlobal::instance()->instanceName().

Parameters

  parent | The parent is only used as the parent for the dialog - centering the dialog over the parent widget.
  name | name

Definition at line 358 of file dialog.cpp.

KSettings::Dialog::Dialog | ( | ContentInListView | content = `Static`,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |  |

Construct a new Preferences Dialog for the application.

It uses all KCMs with X-KDE-ParentApp set to KGlobal::instance()->instanceName().

Parameters

  content | Select whether you want a static or configurable config dialog.
  parent | The parent is only used as the parent for the dialog - centering the dialog over the parent widget.
  name | name

Definition at line 367 of file dialog.cpp.

KSettings::Dialog::Dialog | ( | const QStringList & | components,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |  |

Construct a new Preferences Dialog with the pages for the selected instance names.

For example if you want to have the configuration pages for the kviewviewer KPart you would pass a QStringList consisting of only the name of the part "kviewviewer".

Parameters

  components | A list of the names of the components that your config dialog should merge the config pages in.
  parent | The parent is only used as the parent for the dialog - centering the dialog over the parent widget.
  name | name

Definition at line 377 of file dialog.cpp.

KSettings::Dialog::Dialog | ( | const QStringList & | components,
|  | ContentInListView | content,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |  |

Construct a new Preferences Dialog with the pages for the selected instance names.

For example if you want to have the configuration pages for the kviewviewer KPart you would pass a QStringList consisting of only the name of the part "kviewviewer".

Parameters

  components | A list of the names of the components that your config dialog should merge the config pages in.
  content | Select whether you want a static or configurable config dialog.
  parent | The parent is only used as the parent for the dialog - centering the dialog over the parent widget.
  name | name

Definition at line 387 of file dialog.cpp.

## Member Function Documentation

void KSettings::Dialog::addPluginInfos | ( | const QValueList< KPluginInfo * > & | plugininfos | ) |

If you use a Configurable dialog you need to pass KPluginInfo objects that the dialog should configure.

Definition at line 402 of file dialog.cpp.

void KSettings::Dialog::pluginSelectionChanged | ( |  | ) |

signal

If you use the dialog in Configurable mode and want to be notified when the user changes the plugin selections use this signal.

It's emitted if the selection has changed and the user pressed Apply or Ok. In the slot you would then load and unload the plugins as requested.

void KSettings::Dialog::show | ( | void |  | ) |

slot

Show the config dialog.

The slot immediatly returns since the dialog is non-modal.

Definition at line 413 of file dialog.cpp.

The documentation for this class was generated from the following files:

- dialog.h
- dialog.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys