• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.9.4 API Reference
  • KDE Home
  • Contact Us
 

KUtils

  • KSettings
  • Dialog
Signals | Public Member Functions | Protected Member Functions | List of all members
KSettings::Dialog Class Reference

#include <dialog.h>

Inheritance diagram for KSettings::Dialog:
Inheritance graph
[legend]

Signals

void pluginSelectionChanged ()
- Signals inherited from KCMultiDialog
void configCommitted ()
void configCommitted (const QByteArray &componentName)
- Signals inherited from KPageDialog
void aboutToShowDetails ()
void applyClicked ()
void buttonClicked (KDialog::ButtonCode button)
void cancelClicked ()
void closeClicked ()
void currentPageChanged (KPageWidgetItem *current, KPageWidgetItem *before)
void defaultClicked ()
void finished ()
void helpClicked ()
void hidden ()
void layoutHintChanged ()
void noClicked ()
void okClicked ()
void pageRemoved (KPageWidgetItem *page)
void resetClicked ()
void tryClicked ()
void user1Clicked ()
void user2Clicked ()
void user3Clicked ()
void yesClicked ()
- Signals inherited from KDialog
void aboutToShowDetails ()
void applyClicked ()
void buttonClicked (KDialog::ButtonCode button)
void cancelClicked ()
void closeClicked ()
void defaultClicked ()
void finished ()
void helpClicked ()
void hidden ()
void layoutHintChanged ()
void noClicked ()
void okClicked ()
void resetClicked ()
void tryClicked ()
void user1Clicked ()
void user2Clicked ()
void user3Clicked ()
void yesClicked ()

Public Member Functions

 Dialog (QWidget *parent=0)
 Dialog (const QStringList &components, QWidget *parent=0)
 ~Dialog ()
void addPluginInfos (const QList< KPluginInfo > &plugininfos)
bool allowComponentSelection () const
QList< KPluginInfo > pluginInfos () const
void setAllowComponentSelection (bool allowSelection)
void setComponentBlacklist (const QStringList &blacklist)
void setKCMArguments (const QStringList &arguments)
- Public Member Functions inherited from KCMultiDialog
 KCMultiDialog (QWidget *parent=0)
virtual ~KCMultiDialog ()
KPageWidgetItem * addModule (const QString &module, const QStringList &args=QStringList())
KPageWidgetItem * addModule (const KCModuleInfo &moduleinfo, KPageWidgetItem *parent=0, const QStringList &args=QStringList())
void clear ()
void setButtons (ButtonCodes buttonMask)
- Public Member Functions inherited from KPageDialog
 KPageDialog (QWidget *parent=0, Qt::WFlags flags=0)
 ~KDialog ()
 ~KPageDialog ()
void addPage (KPageWidgetItem *item)
KPageWidgetItem * addPage (QWidget *widget, const QString &name)
KPageWidgetItem * addSubPage (KPageWidgetItem *parent, QWidget *widget, const QString &name)
void addSubPage (KPageWidgetItem *parent, KPageWidgetItem *item)
KPushButton * button (ButtonCode id) const
KIcon buttonIcon (ButtonCode id) const
QString buttonText (ButtonCode id) const
QString buttonToolTip (ButtonCode id) const
QString buttonWhatsThis (ButtonCode id) const
KPageWidgetItem * currentPage () const
ButtonCode defaultButton () const
QString helpLinkText () const
void incrementInitialSize (const QSize &size)
KPageWidgetItem * insertPage (KPageWidgetItem *before, QWidget *widget, const QString &name)
void insertPage (KPageWidgetItem *before, KPageWidgetItem *item)
bool isButtonEnabled (ButtonCode id) const
 KDialog (QWidget *parent=0, Qt::WFlags flags=0)
QWidget * mainWidget ()
virtual QSize minimumSizeHint () const
void removePage (KPageWidgetItem *item)
void restoreDialogSize (const KConfigGroup &config)
void saveDialogSize (KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const
void setButtonFocus (ButtonCode id)
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
void setButtonIcon (ButtonCode id, const KIcon &icon)
void setButtonMenu (ButtonCode id, QMenu *menu, ButtonPopupMode popupmode=InstantPopup)
void setButtonsOrientation (Qt::Orientation orientation)
void setButtonText (ButtonCode id, const QString &text)
void setButtonToolTip (ButtonCode id, const QString &text)
void setButtonWhatsThis (ButtonCode id, const QString &text)
void setCurrentPage (KPageWidgetItem *item)
void setDefaultButton (ButtonCode id)
void setEscapeButton (ButtonCode id)
void setFaceType (FaceType faceType)
void setInitialSize (const QSize &size)
void setMainWidget (QWidget *widget)
void showButton (ButtonCode id, bool state)
void showButtonSeparator (bool state)
virtual QSize sizeHint () const

Protected Member Functions

void showEvent (QShowEvent *)
- Protected Member Functions inherited from KCMultiDialog
 KCMultiDialog (KPageWidget *pageWidget, QWidget *parent, Qt::WFlags flags=0)
 KCMultiDialog (KCMultiDialogPrivate &dd, KPageWidget *pageWidget, QWidget *parent, Qt::WFlags flags=0)
- Protected Member Functions inherited from KPageDialog
 KPageDialog (KPageWidget *widget, QWidget *parent, Qt::WFlags flags=0)
 KPageDialog (KPageDialogPrivate &dd, KPageWidget *widget, QWidget *parent, Qt::WFlags flags=0)
virtual void closeEvent (QCloseEvent *e)
virtual void hideEvent (QHideEvent *)
 KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WFlags flags=0)
virtual void keyPressEvent (QKeyEvent *)
const KPageWidget * pageWidget () const
KPageWidget * pageWidget ()
void setPageWidget (KPageWidget *widget)

Additional Inherited Members

- Public Types inherited from KPageDialog
enum  ButtonCode
enum  ButtonPopupMode
enum  CaptionFlag
enum  FaceType
- Public Slots inherited from KPageDialog
void delayedDestruct ()
void enableButton (ButtonCode id, bool state)
void enableButtonApply (bool state)
void enableButtonCancel (bool state)
void enableButtonOk (bool state)
void enableLinkedHelp (bool state)
bool isDetailsWidgetVisible () const
virtual void setCaption (const QString &caption)
virtual void setCaption (const QString &caption, bool modified)
void setDetailsWidget (QWidget *detailsWidget)
void setDetailsWidgetVisible (bool visible)
void setHelp (const QString &anchor, const QString &appname=QString())
void setHelpLinkText (const QString &text)
virtual void setPlainCaption (const QString &caption)
- Static Public Member Functions inherited from KPageDialog
static bool avoidArea (QWidget *widget, const QRect &area, int screen=-1)
static void centerOnScreen (QWidget *widget, int screen=-1)
static int groupSpacingHint ()
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
static int marginHint ()
static void resizeLayout (QLayout *lay, int margin, int spacing)
static void resizeLayout (QWidget *widget, int margin, int spacing)
static void setAllowEmbeddingInGraphicsView (bool allowEmbedding)
static int spacingHint ()
- Public Attributes inherited from KPageDialog
 Apply
 AppNameCaption
 Auto
 Cancel
 Close
 Default
 DelayedPopup
 Details
 Help
 HIGCompliantCaption
 InstantPopup
 List
 ModifiedCaption
 No
 NoCaptionFlags
 NoDefault
 None
 Ok
 Plain
 Reset
 Tabbed
 Tree
 Try
 User1
 User2
 User3
 Yes
- Protected Slots inherited from KCMultiDialog
void slotApplyClicked ()
void slotDefaultClicked ()
void slotHelpClicked ()
void slotOkClicked ()
void slotUser1Clicked ()
- Protected Attributes inherited from KPageDialog
KDialogPrivate *const d_ptr

Detailed Description

Generic configuration dialog that 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( 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->componentData().componentName();
m_cfgdlg = new Dialog( kpartslist, this );

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

KStandardAction::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

Definition at line 73 of file dialog.h.

Constructor & Destructor Documentation

KSettings::Dialog::Dialog ( QWidget *  parent = 0)
explicit

Construct a new Preferences Dialog for the application.

It uses all KCMs with X-KDE-ParentApp set to KGlobal::mainComponent().componentName().

Parameters
contentSelect whether you want a static or configurable config dialog.
parentThe parent is only used as the parent for the dialog - centering the dialog over the parent widget.

Definition at line 46 of file dialog.cpp.

KSettings::Dialog::Dialog ( const QStringList &  components,
QWidget *  parent = 0 
)
explicit

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
componentsA list of the names of the components that your config dialog should merge the config pages in.
parentThe parent is only used as the parent for the dialog - centering the dialog over the parent widget.

Definition at line 51 of file dialog.cpp.

KSettings::Dialog::~Dialog ( )

Definition at line 58 of file dialog.cpp.

Member Function Documentation

void KSettings::Dialog::addPluginInfos ( const QList< KPluginInfo > &  plugininfos)

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

Definition at line 84 of file dialog.cpp.

bool KSettings::Dialog::allowComponentSelection ( ) const

Definition at line 67 of file dialog.cpp.

KPluginInfo::List KSettings::Dialog::pluginInfos ( ) const

Returns a list of all KPluginInfo objects the dialog uses.

Definition at line 113 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::setAllowComponentSelection ( bool  allowSelection)

Tells the dialog whether the entries in the listview are all static or whether it should add checkboxes to select which parts of the optional functionality should be active or not.

Note that this function only works before showing the dialog for the first time.

Defaults to false.

Parameters
allowSelectiontrue The user can select what functionality he wants.
allowSelectionfalse While running no entries are added or deleted

Definition at line 62 of file dialog.cpp.

void KSettings::Dialog::setComponentBlacklist ( const QStringList &  blacklist)

Set the blacklisted component list.

Any KCM that lists one of the components in the given blacklist is not loaded even if it would fit otherwise. This is a way to explicitly prevent loading of certain KControlModules.

Note that this function only works before showing the KSettings::Dialog for the first time.

Parameters
blacklistthe list of components that prevent a KCM from being loaded

Definition at line 78 of file dialog.cpp.

void KSettings::Dialog::setKCMArguments ( const QStringList &  arguments)

Sets the argument list that is given to all the KControlModule's when they are created.

Use this if you have KControlModule's that need special arguments to work

Note that this function only works before showing the KSettings::Dialog for the first time.

Parameters
argumentsThe list of arguments passed to each KCM

Definition at line 72 of file dialog.cpp.

void KSettings::Dialog::showEvent ( QShowEvent *  )
protected

Reimplemented to lazy create the dialog on first show.

Definition at line 118 of file dialog.cpp.


The documentation for this class was generated from the following files:
  • dialog.h
  • dialog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Dec 10 2012 13:59:11 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.9.4 API Reference

Skip menu "kdelibs-4.9.4 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal