# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KDialogBase Class Reference

A dialog base class with standard buttons and predefined layouts. More...

`#include <kdialogbase.h>`

Inheritance diagram for KDialogBase:

[legend]
Collaboration diagram for KDialogBase:

[legend]
List of all members.

## Public Types

enum | ButtonCode { Help = 0x00000001, Default = 0x00000002, Ok = 0x00000004, Apply = 0x00000008, Try = 0x00000010, Cancel = 0x00000020, Close = 0x00000040, User1 = 0x00000080, User2 = 0x00000100, User3 = 0x00000200, No = 0x00000080, Yes = 0x00000100, Details = 0x00000400, Filler = 0x40000000, Stretch = 0x80000000, NoDefault }
enum | ActionButtonStyle { ActionStyle0 = 0, ActionStyle1, ActionStyle2, ActionStyle3, ActionStyle4, ActionStyleMAX }
enum | DialogType { TreeList = KJanusWidget::TreeList, Tabbed = KJanusWidget::Tabbed, Plain = KJanusWidget::Plain, Swallow = KJanusWidget::Swallow, IconList = KJanusWidget::IconList }

## Public Slots

void | enableButton (ButtonCode id, bool state)
void | enableButtonOK (bool state)
void | enableButtonApply (bool state)
void | enableButtonCancel (bool state)
void | enableLinkedHelp (bool state)
void | delayedDestruct ()
void | setHelpLinkText (const QString &text)
void | setHelp (const QString &anchor, const QString &appname=QString::null)
void | helpClickedSlot (const QString &)
void | setDetails (bool showDetails)
void | setDetailsWidget (QWidget *detailsWidget)
void | updateBackground ()
void | cancel ()

## Signals

void | helpClicked ()
void | defaultClicked ()
void | user3Clicked ()
void | user2Clicked ()
void | user1Clicked ()
void | applyClicked ()
void | tryClicked ()
void | okClicked ()
void | yesClicked ()
void | noClicked ()
void | cancelClicked ()
void | closeClicked ()
void | apply ()
void | backgroundChanged ()
void | hidden ()
void | finished ()
void | aboutToShowDetails ()
void | aboutToShowPage (QWidget *page)

## Public Member Functions

| KDialogBase (QWidget *parent=0, const char *name=0, bool modal=true, const QString &caption=QString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (int dialogFace, const QString &caption, int buttonMask, ButtonCode defaultButton, QWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, QWidget *parent=0, const char *name=0, bool modal=true, const QString &caption=QString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
| KDialogBase (const QString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, QWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel())
| ~KDialogBase ()
void | setButtonBoxOrientation (int orientation)
void | setEscapeButton (ButtonCode id)
virtual void | adjustSize ()
virtual QSize | sizeHint () const
virtual QSize | minimumSizeHint () const
QFrame * | plainPage ()
QFrame * | addPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QFrame * | addPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QVBox * | addVBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QVBox * | addVBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QHBox * | addHBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QHBox * | addHBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QGrid * | addGridPage (int n, Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
QGrid * | addGridPage (int n, Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap())
void | setFolderIcon (const QStringList &path, const QPixmap &pixmap)
QFrame * | makeMainWidget ()
QVBox * | makeVBoxMainWidget ()
QHBox * | makeHBoxMainWidget ()
QGrid * | makeGridMainWidget (int n, Orientation dir)
void | enableButtonSeparator (bool state)
void | showButton (ButtonCode id, bool state)
void | showButtonOK (bool state)
void | showButtonApply (bool state)
void | showButtonCancel (bool state)
bool | showPage (int index)
int | activePageIndex () const
int | pageIndex (QWidget *widget) const
void | setMainWidget (QWidget *widget)
QWidget * | mainWidget ()
void | disableResize ()
void | setInitialSize (const QSize &s, bool noResize=false)
void | incInitialSize (const QSize &s, bool noResize=false)
QSize | configDialogSize (const QString &groupName) const
QSize | configDialogSize (KConfig &config, const QString &groupName) const
void | saveDialogSize (const QString &groupName, bool global=false)
void | saveDialogSize (KConfig &config, const QString &groupName, bool global=false) const
void | setButtonOK (const KGuiItem &item=KStdGuiItem::ok())
void | setButtonOKText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonApply (const KGuiItem &item=KStdGuiItem::apply())
void | setButtonApplyText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel())
void | setButtonCancelText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) KDE_DEPRECATED
void | setButtonText (ButtonCode id, const QString &text)
void | setButtonTip (ButtonCode id, const QString &text)
void | setButtonWhatsThis (ButtonCode id, const QString &text)
void | setButtonGuiItem (ButtonCode id, const KGuiItem &item)
void | setTreeListAutoResize (bool state)
void | setShowIconsInTreeList (bool state)
void | setRootIsDecorated (bool state)
void | unfoldTreeList (bool persist=false)
void | addWidgetBelowList (QWidget *widget)
void | addButtonBelowList (const QString &text, QObject *recv, const char *slot)
void | addButtonBelowList (const KGuiItem &guiitem, QObject *recv, const char *slot)
void | setIconListAllVisible (bool state)
void | showTile (bool state)
void | getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const KDE_DEPRECATED
QRect | getContentsRect () const KDE_DEPRECATED
QSize | calculateSize (int w, int h) const
QString | helpLinkText () const
QPushButton * | actionButton (ButtonCode id)

## Static Public Member Functions

static bool | haveBackgroundTile ()
static const QPixmap * | backgroundTile ()
static const QPixmap * | getBackgroundTile () KDE_DEPRECATED
static void | setBackgroundTile (const QPixmap *pix)

## Protected Slots

virtual void | slotHelp ()
virtual void | slotDefault ()
virtual void | slotDetails ()
virtual void | slotUser3 ()
virtual void | slotUser2 ()
virtual void | slotUser1 ()
virtual void | slotOk ()
virtual void | slotApply ()
virtual void | slotTry ()
virtual void | slotYes ()
virtual void | slotNo ()
virtual void | slotCancel ()
virtual void | slotClose ()
virtual void | applyPressed ()
void | updateGeometry ()
void | slotDelayedDestruct ()

## Protected Member Functions

virtual void | keyPressEvent (QKeyEvent *e)
virtual void | hideEvent (QHideEvent *)
virtual void | closeEvent (QCloseEvent *e)
virtual void | virtual_hook (int id, void *data)

## Detailed Description

A dialog base class with standard buttons and predefined layouts.

Provides basic functionality needed by nearly all dialogs.

It offers the standard action buttons you'd expect to find in a dialog as well as the capability to define at most three configurable buttons. You can define a main widget that contains your specific dialog layout or you can use a predefined layout. Currently, `TreeList/Paged`, `Tabbed`, `Plain`, `Swallow` and `IconList` mode layouts (faces) are available.

The class takes care of the geometry management. You only need to define a minimum size for the widget you want to use as the main widget.

You can set a background tile (pixmap) for parts of the dialog. The tile you select is shared by all instances of this class in your application so that they all get the same look and feel.

There is a tutorial available on http://developer.kde.org/ (NOT YET) that contains copy/paste examples as well a screenshots on how to use this class.

Standard buttons (action buttons):

You select which buttons should be displayed, but you do not choose the order in which they are displayed. This ensures a standard interface in KDE. The button order can be changed, but this ability is only available for a central KDE control tool. The following buttons are available: OK, Cancel/Close, Apply/Try, Default, Help and three user definable buttons: User1, User2 and User3. You must specify the text of the UserN buttons. Each button has a virtual slot so you can overload the method when required. The default slots emit a signal as well, so you can choose to connect a signal instead of overriding the slot. The default implementation of slotHelp() will automatically enable the help system if you have provided a path to the help text. slotCancel() and slotClose() will run QDialog::reject() while slotOk() will run QDialog::accept(). You define a default button in the constructor.

If you don't want any buttons at all because your dialog is special in some way, then set the buttonMask argument in the constructor to zero (0). The optional button box separator line should not be enabled in this case. Note that the KDialogBase will animate a button press when the user press Escape. The button that is enabled is either Cancel, Close or the button that is defined by setEscapeButton() The animation will not take place when the buttonMask is zero. Your custom dialog code should reimplement the keyPressEvent and animate the cancel button so that the dialog behaves like regular dialogs. NOTE: None of the regular slots (like slotOk() ) or signals that are related to the standard action buttons will be used when you don't use these buttons.

sect Dialog shapes:

You can either use one of the prebuilt, easy to use, faces or define your own main widget. The dialog provides ready to use TreeList, Tabbed, Plain, Swallow and IconList faces. KDialogBase uses the KJanusWidget class internally to accomplish this. If you use TreeList, Tabbed or IconList mode, then add pages with addPage().

Pages that have been added can be removed again by simply deleting the page.

If you want complete control of how the dialog contents should look, then you can define a main widget by using setMainWidget(). You only need to set the minimum size of that widget and the dialog will resize itself to fit this minimum size. The dialog is resizeable, but cannot be made smaller than its minimum size.

Layout:

The dialog consists of a help area on top (becomes visible if you define a help path and use enableLinkedHelp()), the main area which is the built-in dialog face or your own widget in the middle and by default a button box at the bottom. The button box can also be placed at the right edge (to the right of the main widget). Use setButtonBoxOrientation() to control this behavior. A separator can be placed above the button box (or to the left when the button box is at the right edge). Normally you specify that you want a separator in the constructor, but you can use enableButtonSeparator() as well.

Standard compliance:

The class is derived from KDialog, so you get automatic access to the KDialog::marginHint(), KDialog::spacingHint() and the extended KDialog::setCaption() method. NOTE: The main widget you use will be positioned inside the dialog using a margin (or border) equal to KDialog::marginHint(). You should not add a margin yourself, since one will be added automatically. The example below (from kedit) shows how you use the top level widget and its layout. The second argument (the border) to QVBoxLayout is 0. This situation is valid for addPage , addVBoxPage , addHBoxPage , addGridPage , makeMainWidget , makeVBoxMainWidget , makeHBoxMainWidget and makeGridMainWidget as well.

Example:

     UrlDlg::UrlDlg( QWidget *parent, const QString& caption,
                     const QString& urltext)
       : KDialogBase( parent, "urldialog", true, caption,
                      KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
     {
       QWidget *page = new QWidget( this );
       setMainWidget(page);
       QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );

       QLabel *label = new QLabel( caption, page, "caption" );
       topLayout->addWidget( label );

       lineedit = new QLineEdit( urltext, page, "lineedit" );
       lineedit->setMinimumWidth(fontMetrics().maxWidth()*20);
       topLayout->addWidget( lineedit );

       topLayout->addStretch(10);
     }

If you use makeVBoxMainWidget(), then the dialog above can be made simpler but you lose the ability to add a stretchable area:

     UrlDlg::UrlDlg( QWidget *parent, const QString& caption,
                     const QString& urltext)
     : KDialogBase( parent, "urldialog", true, caption,
                    KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
     {
       QVBox *page = makeVBoxMainWidget();
       QLabel *label = new QLabel( caption, page, "caption" );

       lineedit = new QLineEdit( urltext, page, "lineedit" );
       lineedit->setMinimumWidth(fontMetrics().maxWidth()*20);
     }

This class can be used in many ways. Note that most KDE ui widgets and many of KDE core applications use the KDialogBase so for more inspiration you should study the code for these.

Author:
  Mirko Boehm (mirko@kde.org) and Espen Sand (espen@kde.org)

Definition at line 193 of file kdialogbase.h.

## Member Enumeration Documentation

enum KDialogBase::ButtonCode

- `Help` - Show Help button.

- `Default` - Show Default button.
- `Details` - Show Details button.
- `Ok` - Show Ok button.
- `Apply` - Show Apply button.
- `Try` - Show Try button.
- `Cancel` - Show Cancel button.
- `Close` - Show Close button.
- `User1` - Show User-defined button 1.
- `User2` - Show User-defined button 2.
- `User3` - Show User-defined button 3.
- `No` - Show No button.
- `Yes` - Show Yes button.
- `Stretch` - Used internally. Ignored when used in a constructor.
- `Filler` - Used internally. Ignored when used in a constructor.
- `NoDefault` - Used when specifying a default button; indicates that no button should be marked by default.

Enumeration values:

  NoDefault

  Since:
    3.3

Definition at line 218 of file kdialogbase.h.

enum KDialogBase::DialogType

- `TreeList` - A dialog with a tree on the left side and a representation of the contents on the right side.

- `Tabbed` - A dialog using a QTabWidget.
- `Plain` - A normal dialog. Use plainPage() as parent for widgets.
- `Swallow` - Simplifes the usage of existing widgets. You specify the widget to be displayed by setMainWidget().
- `IconList` - A dialog with an iconlist on the left side and a representation of the contents on the right side.

Definition at line 258 of file kdialogbase.h.

## Constructor & Destructor Documentation

KDialogBase::KDialogBase | ( | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | bool | modal = `true`,
|  | const QString & | caption = `QString::null`,
|  | int | buttonMask = `Ok|Apply|Cancel`,
|  | ButtonCode | defaultButton = `Ok`,
|  | bool | separator = `false`,
|  | const KGuiItem & | user1 = `KGuiItem()`,
|  | const KGuiItem & | user2 = `KGuiItem()`,
|  | const KGuiItem & | user3 = `KGuiItem()`
| ) |

Constructor for the standard mode where you must specify the main widget with setMainWidget() .

Parameters:

  | parent | Parent of the dialog.
  | name | Dialog name (for internal use only)
  | modal | Controls dialog modality. If `false`, the rest of the program interface (example: other dialogs) is accessible while the dialog is open.
  | caption | The dialog caption. Do not specify the application name here. The class will take care of that.
  | buttonMask | Specifies which buttons will be visible. If zero (0) no button box will be made.
  | defaultButton | Specifies which button will be marked as the default. Use ButtonCode::NoDefault to indicate that no button should be marked as the default button.
  | separator | If `true`, a separator line is drawn between the action buttons and the main widget.
  | user1 | User button1 item.
  | user2 | User button2 item.
  | user3 | User button3 item.

Definition at line 99 of file kdialogbase.cpp.

References enableButtonSeparator(), KDialog::layoutHintChanged(), KDialog::setCaption(), and updateGeometry().

KDialogBase::KDialogBase | ( | int | dialogFace,
|  | const QString & | caption,
|  | int | buttonMask,
|  | ButtonCode | defaultButton,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | bool | modal = `true`,
|  | bool | separator = `false`,
|  | const KGuiItem & | user1 = `KGuiItem()`,
|  | const KGuiItem & | user2 = `KGuiItem()`,
|  | const KGuiItem & | user3 = `KGuiItem()`
| ) |

In KDE4 a WFlag paramater should be added after modal and next function can be removed.

Constructor for the predefined layout mode where you specify the kind of layout (face).

Parameters:

  | dialogFace | You can use TreeList, Tabbed, Plain, Swallow or IconList.
  | caption | The dialog caption. Do not specify the application name here. The class will take care of that.
  | buttonMask | Specifies which buttons will be visible. If zero (0) no button box will be made.
  | defaultButton | Specifies which button will be marked as the default. Use ButtonCode::NoDefault to indicate that no button should be marked as the default button.
  | parent | Parent of the dialog.
  | name | Dialog name (for internal use only).
  | modal | Controls dialog modality. If `false`, the rest of the program interface (example: other dialogs) is accessible while the dialog is open.
  | separator | If `true`, a separator line is drawn between the action buttons and the main widget.
  | user1 | User button1 text item.
  | user2 | User button2 text item.
  | user3 | User button3 text item.

Definition at line 121 of file kdialogbase.cpp.

References aboutToShowPage(), enableButtonSeparator(), KJanusWidget::isValid(), KDialog::layoutHintChanged(), KDialog::setCaption(), and updateGeometry().

KDialogBase::KDialogBase | ( | KDialogBase::DialogType | dialogFace,
|  | WFlags | f,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | bool | modal = `true`,
|  | const QString & | caption = `QString::null`,
|  | int | buttonMask = `Ok|Apply|Cancel`,
|  | ButtonCode | defaultButton = `Ok`,
|  | bool | separator = `false`,
|  | const KGuiItem & | user1 = `KGuiItem()`,
|  | const KGuiItem & | user2 = `KGuiItem()`,
|  | const KGuiItem & | user3 = `KGuiItem()`
| ) |

Constructor for the predefined layout mode where you specify the kind of layout (face).

Parameters:

  | dialogFace | You can use TreeList, Tabbed, Plain, Swallow or IconList.
  | f | widget flags, by default it is just set to WStyle_DialogBorder.
  | caption | The dialog caption. Do not specify the application name here. The class will take care of that.
  | parent | Parent of the dialog.
  | name | Dialog name (for internal use only).
  | modal | Controls dialog modality. If `false`, the rest of the program interface (example: other dialogs) is accessible while the dialog is open.
  | buttonMask | Specifies which buttons will be visible. If zero (0) no button box will be made.
  | defaultButton | Specifies which button will be marked as the default. Use ButtonCode::NoDefault to indicate that no button should be marked as the default button.
  | separator | If `true`, a separator line is drawn between the action buttons and the main widget.
  | user1 | User button1 text item.
  | user2 | User button2 text item.
  | user3 | User button3 text item.

Since:
  : 3.2

Definition at line 149 of file kdialogbase.cpp.

References aboutToShowPage(), enableButtonSeparator(), KJanusWidget::isValid(), KDialog::layoutHintChanged(), KDialog::setCaption(), and updateGeometry().

KDialogBase::KDialogBase | ( | const QString & | caption,
|  | int | buttonMask = `Yes|No|Cancel`,
|  | ButtonCode | defaultButton = `Yes`,
|  | ButtonCode | escapeButton = `Cancel`,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | bool | modal = `true`,
|  | bool | separator = `false`,
|  | const KGuiItem & | yes = `KStdGuiItem::yes()`,
|  | const KGuiItem & | no = `KStdGuiItem::no()`,
|  | const KGuiItem & | cancel = `KStdGuiItem::cancel()`
| ) |

Constructor for a message box mode where the `buttonMask` can only contain Yes, No, or Cancel.

If you need other names you can rename the buttons with setButtonText(). The dialog box is not resizable by default but this can be changed by setInitialSize(). If you select 'modal' to be true, the dialog will return Yes, No, or Cancel when closed otherwise you can use the signals yesClicked(), noClicked(), or cancelClicked() to determine the state.

Parameters:

  | caption | The dialog caption. Do not specify the application name here. The class will take care of that.
  | buttonMask | Specifies which buttons will be visible. If zero (0) no button box will be made.
  | defaultButton | Specifies which button will be marked as the default. Use ButtonCode::NoDefault to indicate that no button should be marked as the default button.
  | escapeButton | Specifies which button will be activated by when the dialog receives a `Key_Escape` keypress.
  | parent | Parent of the dialog.
  | name | Dialog name (for internal use only).
  | modal | Controls dialog modality. If `false`, the rest of the program interface (example: other dialogs) is accessible while the dialog is open.
  | separator | If `true`, a separator line is drawn between the action buttons and the main widget.
  | yes | Text to use for the first button (defaults to i18n("Yes"))
  | no | Text to use for the second button (defaults to i18n("No"))
  | cancel | Text to use for the third button (defaults to i18n("Cancel"))

Definition at line 178 of file kdialogbase.cpp.

References cancel(), enableButtonSeparator(), QString::isEmpty(), KDialog::layoutHintChanged(), setButtonCancel(), KDialog::setCaption(), KGuiItem::text(), and updateGeometry().

KDialogBase::~KDialogBase | ( |  | ) |

| Destructor. Definition at line 211 of file kdialogbase.cpp.

## Member Function Documentation

void KDialogBase::setButtonBoxOrientation | ( | int | orientation | ) |

Sets the orientation of the button box.

It can be `Vertical` or `Horizontal`. If `Horizontal` (default), the button box is positioned at the bottom of the dialog. If `Vertical` it will be placed at the right edge of the dialog.

Parameters:

  | orientation | The button box orientation.

Definition at line 345 of file kdialogbase.cpp.

References enableLinkedHelp(), and KSeparator::setOrientation().

void KDialogBase::setEscapeButton | ( | ButtonCode | id | ) |

Sets the button that will be activated when the Escape key is pressed.

Normally you should not use this function. By default, the Escape key is mapped to either the Cancel or the Close button if one of these buttons are defined. The user expects that Escape will cancel an operation so use this function with caution.

Parameters:

  | id | The button code.

Definition at line 365 of file kdialogbase.cpp.

void KDialogBase::adjustSize | ( |  | ) | `[virtual]`

| Adjust the size of the dialog to fit the contents just before QDialog::exec() or QDialog::show() is called. This method will not be called if the dialog has been explicitly resized before showing it. Definition at line 427 of file kdialogbase.cpp. Referenced by incInitialSize(), setDetails(), and setInitialSize().

QFrame * KDialogBase::plainPage | ( |  | ) |

Retrieve the empty page when the predefined layout is used in `Plain` mode.

This widget must be used as the toplevel widget of your dialog code.

Returns:
  The widget or 0 if the predefined layout mode is not `Plain` or if you don't use any predefined layout.

Definition at line 420 of file kdialogbase.cpp.

References KJanusWidget::plainPage().

Referenced by KBugReport::KBugReport(), KLineEditDlg::KLineEditDlg(), and KProgressDialog::KProgressDialog().

QFrame * KDialogBase::addPage | ( | const QString & | itemName,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

Add a page to the dialog when the class is used in `TreeList` , `IconList` or `Tabbed` mode.

The returned widget must be used as the toplevel widget for this particular page. Note: The returned frame widget has no layout manager associated with it. In order to use it you must create a layout yourself as the example below illustrates:

     QFrame *page = addPage( i18n("Layout") );
     QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
     QLabel *label = new QLabel( i18n("Layout type"), page );
     topLayout->addWidget( label );
     ..

Parameters:

  | itemName | String used in the list or as tab item name.
  | header | Header text use in the list modes. Ignored in `Tabbed` mode. If empty, the item text is used instead.
  | pixmap | Used in `IconList` mode. You should prefer a pixmap with size 32x32 pixels.

Returns:
  The page widget which must be used as the toplevel widget for the page.

Definition at line 1296 of file kdialogbase.cpp.

References KJanusWidget::addPage().

QFrame * KDialogBase::addPage | ( | const QStringList & | items,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

This is like addPage() just above, with the difference that the first element is a list of strings.

These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the `TreeList` face. Later this may be added for the `IconList` face too. In other faces than the `TreeList`, all the strings except the last one is ignored.

Definition at line 1302 of file kdialogbase.cpp.

References KJanusWidget::addPage().

QVBox * KDialogBase::addVBoxPage | ( | const QString & | itemName,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

Add a page to the dialog when the class is used in `TreeList`, `IconList` or `Tabbed` mode.

The returned widget must be used as the toplevel widget for this particular page. The widget contains a QVBoxLayout layout so the widget children are lined up vertically. You can use it as follows:

     QVBox *page = addVBoxPage( i18n("Layout") );
     QLabel *label = new QLabel( i18n("Layout type"), page );
     ..

Parameters:

  | itemName | String used in the list or as tab item name.
  | header | Header text use in the list modes. Ignored in `Tabbed` mode. If empty, the item text is used instead.
  | pixmap | Used in `IconList` mode. You should prefer a pixmap with size 32x32 pixels.

Returns:
  The page widget which must be used as the toplevel widget for the page.

Definition at line 1309 of file kdialogbase.cpp.

References KJanusWidget::addVBoxPage().

QVBox * KDialogBase::addVBoxPage | ( | const QStringList & | items,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

This is like addVBoxPage() just above, with the difference that the first element is a list of strings.

These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the `TreeList` face. Later this may be added for the `IconList` face too. In other faces than the `TreeList`, all the strings except the last one is ignored.

Definition at line 1315 of file kdialogbase.cpp.

References KJanusWidget::addVBoxPage().

QHBox * KDialogBase::addHBoxPage | ( | const QString & | itemName,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

Add a page to the dialog when the class is used in `TreeList`, `IconList` or `Tabbed` mode.

The returned widget must be used as the toplevel widget for this particular page. The widget contains a QHBoxLayout layout so the widget children are lined up horizontally. You can use it as follows:

Parameters:

  | itemName | String used in the list or as tab item name.
  | header | Header text use in the list modes. Ignored in Tabbed mode. If empty, the item text is used instead.
  | pixmap | Used in IconList mode. You should prefer a pixmap with size 32x32 pixels.

Returns:
  The page widget which must be used as the toplevel widget for the page.

Definition at line 1322 of file kdialogbase.cpp.

References KJanusWidget::addHBoxPage().

QHBox * KDialogBase::addHBoxPage | ( | const QStringList & | items,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

This is like addHBoxPage() just above, with the difference that the first element is a list of strings.

These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the `TreeList` face. Later this may be added for the `IconList` face too. In other faces than the `TreeList`, all the strings except the last one is ignored.

Definition at line 1329 of file kdialogbase.cpp.

References KJanusWidget::addHBoxPage().

QGrid * KDialogBase::addGridPage | ( | int | n,
|  | Orientation | dir,
|  | const QString & | itemName,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

Add a page to the dialog when the class is used in `TreeList`, `IconList` or `Tabbed` mode.

The returned widget must be used as the toplevel widget for this particular page. The widget contains a QGridLayout layout so the widget children are positioned in a grid.

Parameters:

  | n | Specifies the number of columns if `dir` is Qt::Horizontal or the number of rows if `dir` is Qt::Vertical.
  | dir | Can be Qt::Horizontal or Qt::Vertical.
  | itemName | String used in the list or as tab item name.
  | header | Header text use in the list modes `Ignored` in `Tabbed` mode. If empty, the item text is used instead.
  | pixmap | Used in `IconList` mode. You should prefer a pixmap with size 32x32 pixels.

Returns:
  The page widget which must be used as the toplevel widget for the page.

Definition at line 1337 of file kdialogbase.cpp.

References KJanusWidget::addGridPage().

QGrid * KDialogBase::addGridPage | ( | int | n,
|  | Orientation | dir,
|  | const QStringList & | items,
|  | const QString & | header = `QString::null`,
|  | const QPixmap & | pixmap = `QPixmap()`
| ) |

This is like addGridPage() just above, with the difference that the first element is a list of strings.

These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the `TreeList` face. Later this may be added for the `IconList` face too. In other faces than the `TreeList`, all the strings except the last one is ignored.

Definition at line 1344 of file kdialogbase.cpp.

References KJanusWidget::addGridPage().

void KDialogBase::setFolderIcon | ( | const QStringList & | path,
|  | const QPixmap & | pixmap
| ) |

Sets the icon used in `TreeList` Mode for the given path.

Parameters:

  | path | The path for which this icon should be shown.
  | pixmap | The icon used.

Definition at line 1351 of file kdialogbase.cpp.

References KJanusWidget::setFolderIcon().

QFrame * KDialogBase::makeMainWidget | ( |  | ) |

Make a main widget.

The function will make a QFrame widget and use setMainWidget() to register it. You can not use this function more than once, not if you have already defined a main widget with setMainWidget() and not if you have used the constructor where you define the face (`Plain`, `Swallow`, `Tabbed`, `TreeList`).

Returns:
  The main widget or 0 if any of the rules described above were broken.

Definition at line 1359 of file kdialogbase.cpp.

References mainWidget(), and setMainWidget().

QVBox * KDialogBase::makeVBoxMainWidget | ( |  | ) |

Make a main widget.

The function will make a QVBox widget and use setMainWidget() to register it. You can use this function more than once, but not if you have already defined a main widget with setMainWidget() and not if you have used the constructor where you define the face (`Plain`, `Swallow`, `Tabbed`, `TreeList`, `IconList`).

Returns:
  The main widget or 0 if any of the rules described above were broken.

Definition at line 1373 of file kdialogbase.cpp.

References mainWidget(), setMainWidget(), and KDialog::spacingHint().

QHBox * KDialogBase::makeHBoxMainWidget | ( |  | ) |

Make a main widget.

The function will make a QHBox widget and use setMainWidget() to register it. You can not use this function more than once, not if you have already defined a main widget with setMainWidget() and `not` if you have used the constructor where you define the face (`Plain`, `Swallow`, `Tabbed`, `TreeList`, `IconList`).

Returns:
  The main widget or 0 if any of the rules described above were broken.

Definition at line 1388 of file kdialogbase.cpp.

References mainWidget(), setMainWidget(), QHBox::setSpacing(), and KDialog::spacingHint().

QGrid * KDialogBase::makeGridMainWidget | ( | int | n,
|  | Orientation | dir
| ) |

Make a main widget.

The function will make a QGrid widget and use setMainWidget() to register it. You can not use this function more than once, not if you have already defined a main widget with setMainWidget and not if you have used the constructor where you define the face (Plain, Swallow, Tabbed, TreeList, IconList).

Parameters:

  | n | Specifies the number of columns if 'dir' is Qt::Horizontal or the number of rows if 'dir' is Qt::Vertical.
  | dir | Can be Qt::Horizontal or Qt::Vertical.

Returns:
  The main widget or 0 if any of the rules described above were broken.

Definition at line 1403 of file kdialogbase.cpp.

References mainWidget(), setMainWidget(), QGrid::setSpacing(), and KDialog::spacingHint().

void KDialogBase::enableButtonSeparator | ( | bool | state | ) |

| Hide or display the a separator line drawn between the action buttons an the main widget. Definition at line 389 of file kdialogbase.cpp. References KSeparator::setOrientation(). Referenced by KDialogBase().

void KDialogBase::showButton | ( | ButtonCode | id,
|  | bool | state
| ) |

Hide or display a general action button.

Only buttons that have been created in the constructor can be displayed. This method will not create a new button.

Parameters:

  | id | Button identifier.
  | state | true display the button(s).

Definition at line 866 of file kdialogbase.cpp.

References actionButton().

Referenced by KProgressDialog::KProgressDialog(), showButtonApply(), showButtonCancel(), and showButtonOK().

void KDialogBase::showButtonOK | ( | bool | state | ) |

Hide or display the OK button.

The OK button must have been created in the constructor to be displayed.

Parameters:

  | state | If `true`, display the button(s).

Definition at line 876 of file kdialogbase.cpp.

References showButton().

Referenced by KBugReport::KBugReport().

void KDialogBase::showButtonApply | ( | bool | state | ) |

Hide or display the Apply button.

The Apply button must have been created in the constructor to be displayed.

Parameters:

  | state | true display the button(s).

Definition at line 882 of file kdialogbase.cpp.

References showButton().

void KDialogBase::showButtonCancel | ( | bool | state | ) |

Hide or display the Cancel button.

The Cancel button must have been created in the constructor to be displayed.

Parameters:

  | state | `true` display the button(s).

Definition at line 888 of file kdialogbase.cpp.

References showButton().

Referenced by KProgressDialog::showCancelButton().

bool KDialogBase::showPage | ( | int | index | ) |

Sets the page with `index` to be displayed.

This method will only work when the dialog is using the predefined shape of TreeList, IconList or Tabbed.

Parameters:

  | index | Index of the page to be shown.

Returns:
  `true` if the page is shown, `false` otherwise.

Definition at line 1470 of file kdialogbase.cpp.

References KJanusWidget::showPage().

int KDialogBase::activePageIndex | ( |  | ) | const

Returns the index of the active page.

This method will only work when the dialog is using the predefined shape of Tabbed, TreeList or IconList.

Returns:
  The page index or -1 if there is no active page.

Definition at line 1476 of file kdialogbase.cpp.

References KJanusWidget::activePageIndex().

int KDialogBase::pageIndex | ( | QWidget * | widget | ) | const

Returns the index of a page created with addPage(), addVBoxPage(), addHBoxPage() or addGridPage().

You can can compare this index with the value returned from activePageIndex() if you need to do some page specific actions in your code.

The returned index will never change so you can safely use this function once and save the value.

Parameters:

  | widget | The widget returned by addPage(), addVBoxPage(), addHBoxPage() or addGridPage().

Returns:
  The index or -1 if the face is not Tabbed, TreeList or IconList

Definition at line 1482 of file kdialogbase.cpp.

References KJanusWidget::pageIndex().

void KDialogBase::setMainWidget | ( | QWidget * | widget | ) |

Sets the main user definable widget.

If the dialog is using the predefined Swallow mode, the widget will be reparented to the internal swallow control widget. If the dialog is being used in the standard mode then the `widget` must have the dialog as parent.

Parameters:

  | widget | The widget to be displayed as main widget. If it is 0, then the dialog will show an empty space of 100x100 pixels instead.

Definition at line 1431 of file kdialogbase.cpp.

References QFocusData::last(), and KJanusWidget::setSwallowedWidget().

Referenced by KHelpMenu::aboutApplication(), KAboutDialog::KAboutDialog(), KColorDialog::KColorDialog(), KFontDialog::KFontDialog(), KKeyDialog::KKeyDialog(), KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(), makeGridMainWidget(), makeHBoxMainWidget(), makeMainWidget(), and makeVBoxMainWidget().

QWidget * KDialogBase::mainWidget | ( |  | ) |

Returns the main widget if any.

Returns:
  The current main widget. Can be 0 if no widget has been defined.

Definition at line 1464 of file kdialogbase.cpp.

Referenced by makeGridMainWidget(), makeHBoxMainWidget(), makeMainWidget(), makeVBoxMainWidget(), and KColorDialog::setDefaultColor().

void KDialogBase::disableResize | ( |  | ) |

| Convenience method. Freezes the dialog size using the minimum size of the dialog. This method should only be called right before show() or exec(). Definition at line 531 of file kdialogbase.cpp. Referenced by KHelpMenu::aboutApplication(), KColorDialog::KColorDialog(), and KColorDialog::setDefaultColor().

void KDialogBase::setInitialSize | ( | const QSize & | s,
|  | bool | noResize = `false`
| ) |

Convenience method.

Sets the initial dialog size.

This method should only be called right before show() or exec(). The initial size will be ignored if smaller than the dialog's minimum size.

Parameters:

  | s | Startup size.
  | noResize | If `true` the dialog cannot be resized.

Definition at line 537 of file kdialogbase.cpp.

References adjustSize().

void KDialogBase::incInitialSize | ( | const QSize & | s,
|  | bool | noResize = `false`
| ) |

Convenience method.

Add a size to the default minimum size of a dialog.

This method should only be called right before show() or exec().

Parameters:

  | s | Size added to minimum size.
  | noResize | If `true` the dialog cannot be resized.

Definition at line 545 of file kdialogbase.cpp.

References adjustSize().

QSize KDialogBase::configDialogSize | ( | const QString & | groupName | ) | const

read the dialogs size from the configuration according to the screen size.

If no size is saved for one dimension of the screen, sizeHint() is returned.

Parameters:

  | groupName | Name of the group to read from. The old group of KGlobal::config is preserved.

Definition at line 1741 of file kdialogbase.cpp.

QSize KDialogBase::configDialogSize | ( | KConfig & | config,
|  | const QString & | groupName
| ) | const

read the dialogs size from the configuration according to the screen size.

If no size is saved for one dimension of the screen, sizeHint() is returned.

Parameters:

  | config | The KConfig object to read from
  | groupName | Name of the group to read from. The old group of KGlobal::config is preserved.

Since:
  3.2

Definition at line 1747 of file kdialogbase.cpp.

References QApplication::desktop(), QRect::height(), QSize::height(), QRect::width(), and QSize::width().

void KDialogBase::saveDialogSize | ( | const QString & | groupName,
|  | bool | global = `false`
| ) |

save the dialogs size dependant on the screen dimension either to the global or application config file.

Parameters:

  | groupName | The group to which the dialogs size is saved. See configDialogSize to read the size.
  | global | Set to true if the entry should go to the global config rather than to the applications config. Default is false.

Definition at line 1765 of file kdialogbase.cpp.

void KDialogBase::saveDialogSize | ( | KConfig & | config,
|  | const QString & | groupName,
|  | bool | global = `false`
| ) | const

save the dialogs size dependant on the screen dimension.

Parameters:

  | config | The KConfig object to write to.
  | groupName | The group to which the dialogs size is saved. See configDialogSize to read the size.
  | global | Set to true if the entry should go to the global config. Default is false.

Since:
  3.2

Definition at line 1771 of file kdialogbase.cpp.

References QApplication::desktop(), QSize::height(), QRect::height(), QString::number(), QSize::width(), and QRect::width().

void KDialogBase::setButtonOK | ( | const KGuiItem & | item = `KStdGuiItem::ok()` | ) |

Sets the appearance of the OK button.

If the default parameters are used (that is, if no KGuiItem is given) KStdGuiItem::ok() is used.

Parameters:

  | item | KGuiItem.

Since:
  3.2

Definition at line 916 of file kdialogbase.cpp.

References setButtonGuiItem().

Referenced by KBugReport::KBugReport().

void KDialogBase::setButtonOKText | ( | const QString & | text = `QString::null`,
|  | const QString & | tooltip = `QString::null`,
|  | const QString & | quickhelp = `QString::null`
| ) |

Deprecated:
  . Use setButtonOk() instead.

Sets the text of the OK button.

If the default parameters are used (that is, if no parameters are given) the standard texts are set: The button shows "OK", the tooltip contains "Accept settings." (internationalized) and the quickhelp text explains the standard behavior of the OK button in settings dialogs.

Parameters:

  | text | Button text.
  | tooltip | Tooltip text.
  | quickhelp | Quick help text.

Definition at line 894 of file kdialogbase.cpp.

References actionButton(), QWhatsThis::add(), QToolTip::add(), QPushButton::setText(), and KDialog::spacingHint().

void KDialogBase::setButtonApply | ( | const KGuiItem & | item = `KStdGuiItem::apply()` | ) |

Sets the appearance of the Apply button.

If the default parameters are used (that is, if no KGuiItem is given) KStdGuiItem::apply() is used.

Parameters:

  | item | KGuiItem.

Since:
  3.2

Definition at line 946 of file kdialogbase.cpp.

References setButtonGuiItem().

void KDialogBase::setButtonApplyText | ( | const QString & | text = `QString::null`,
|  | const QString & | tooltip = `QString::null`,
|  | const QString & | quickhelp = `QString::null`
| ) |

Deprecated:
  . Use setButtonApply() instead.

Sets the text of the Apply button.

If the default parameters are used (that is, if no parameters are given) the standard texts are set: The button shows "Apply", the tooltip contains "Apply settings." (internationalized) and the quickhelp text explains the standard behavior of the apply button in settings dialogs.

Parameters:

  | text | Button text.
  | tooltip | Tooltip text.
  | quickhelp | Quick help text.

Definition at line 922 of file kdialogbase.cpp.

References actionButton(), QWhatsThis::add(), QToolTip::add(), QPushButton::setText(), and KDialog::spacingHint().

void KDialogBase::setButtonCancel | ( | const KGuiItem & | item = `KStdGuiItem::cancel()` | ) |

Sets the appearance of the Cancel button.

If the default parameters are used (that is, if no KGuiItem is given) KStdGuiItem::cancel() is used.

Parameters:

  | item | KGuiItem.

Since:
  3.2

Definition at line 970 of file kdialogbase.cpp.

References setButtonGuiItem().

Referenced by KBugReport::KBugReport(), KDialogBase(), and KProgressDialog::setButtonText().

void KDialogBase::setButtonCancelText | ( | const QString & | text = `QString::null`,
|  | const QString & | tooltip = `QString::null`,
|  | const QString & | quickhelp = `QString::null`
| ) |

Deprecated:
  . Use setButtonCancel() instead.

Sets the text of the Cancel button.

If the default parameters are used (that is, if no parameters are given) the standard texts are set: The button shows "Cancel", everything else will not be set.

Parameters:

  | text | Button text.
  | tooltip | Tooltip text.
  | quickhelp | Quick help text.

Definition at line 952 of file kdialogbase.cpp.

References actionButton(), QWhatsThis::add(), QToolTip::add(), QPushButton::setText(), and KDialog::spacingHint().

void KDialogBase::setButtonText | ( | ButtonCode | id,
|  | const QString & | text
| ) |

Sets the text of any button.

Parameters:

  | id | The button identifier.
  | text | Button text.

Definition at line 986 of file kdialogbase.cpp.

References actionButton(), setDetails(), QPushButton::setText(), and KDialog::spacingHint().

Referenced by setDetails().

void KDialogBase::setButtonTip | ( | ButtonCode | id,
|  | const QString & | text
| ) |

Sets the tooltip text of any button.

Parameters:

  | id | The button identifier.
  | text | Button text.

Definition at line 1003 of file kdialogbase.cpp.

References actionButton(), QToolTip::add(), and QToolTip::remove().

void KDialogBase::setButtonWhatsThis | ( | ButtonCode | id,
|  | const QString & | text
| ) |

Sets the "What's this?" text of any button.

Parameters:

  | id | The button identifier.
  | text | Button text.

Definition at line 1016 of file kdialogbase.cpp.

References actionButton(), QWhatsThis::add(), and QWhatsThis::remove().

void KDialogBase::setButtonGuiItem | ( | ButtonCode | id,
|  | const KGuiItem & | item
| ) |

Sets the KGuiItem directly for the button instead of using 3 methods to set the text, tooltip and whatsthis strings.

This also allows to set an icon for the button which is otherwise not possible for the extra buttons beside Ok, Cancel and Apply.

Parameters:

  | id | The button identifier.
  | item | The KGuiItem for the button.

Since:
  3.3

Definition at line 975 of file kdialogbase.cpp.

References actionButton(), KPushButton::setGuiItem(), and KDialog::spacingHint().

Referenced by setButtonApply(), setButtonCancel(), and setButtonOK().

void KDialogBase::setTreeListAutoResize | ( | bool | state | ) |

This function has only effect in TreeList mode.

Defines how the tree list widget is resized when the dialog is resized horizontally. By default the tree list keeps its width when the dialog becomes wider.

Parameters:

  | state | The resize mode. If false (default) the tree list keeps its current width when the dialog becomes wider.

Definition at line 1037 of file kdialogbase.cpp.

References KJanusWidget::setTreeListAutoResize().

void KDialogBase::setShowIconsInTreeList | ( | bool | state | ) |

This function has only effect in TreeList mode.

This tells the widgets whether the icons given in the addPage, addVBoxPage, addHBoxPage, or addGridPage methods should be shown in the TreeList.

Note: This method must be called before calling any of the methods which add icons to the page.

Parameters:

  | state | If true the icons are shown.

Definition at line 1045 of file kdialogbase.cpp.

References KJanusWidget::setShowIconsInTreeList().

void KDialogBase::setRootIsDecorated | ( | bool | state | ) |

This function has only effect in TreeList mode.

This tells the widgets whether the root should be decorated. For details see QListView::setRootIsDecorated

Parameters:

  | state | Root will be decorated if true.

Definition at line 1053 of file kdialogbase.cpp.

References KJanusWidget::setRootIsDecorated().

void KDialogBase::unfoldTreeList | ( | bool | persist = `false` | ) |

This function has only effect in TreeList mode.

This tells the TreeList to unfold the whole tree so that all entries are visible.

If the list is empty when you call this method newly created entries will not automatically be opened. If the `persist` flag is set opened entries cannot be closed again, though.

Parameters:

  | persist | If true the tree always stays unfolded.

Since:
  3.2

Definition at line 1061 of file kdialogbase.cpp.

References KJanusWidget::unfoldTreeList().

void KDialogBase::addWidgetBelowList | ( | QWidget * | widget | ) |

Add a widget at the bottom of the TreeList/IconList.

Parameters:

  | widget | The widget to be added. It will be reparented into the KJanusWidget, therefor it will be deleted with the KJanusWidget, too. To be on the save side just don't keep the pointer to this widget.

Definition at line 1067 of file kdialogbase.cpp.

References KJanusWidget::addWidgetBelowList().

void KDialogBase::addButtonBelowList | ( | const QString & | text,
|  | QObject * | recv,
|  | const char * | slot
| ) |

Add a button at the bottom of the TreeList/IconList.

Parameters:

  | text | The text on the PushButton.
  | recv | The object that is to receive the signal when the button is clicked.
  | slot | The slot to connect to the clicked signal of the button.

Since:
  3.2

Definition at line 1073 of file kdialogbase.cpp.

References KJanusWidget::addButtonBelowList().

void KDialogBase::addButtonBelowList | ( | const KGuiItem & | guiitem,
|  | QObject * | recv,
|  | const char * | slot
| ) |

The same as the above function, but with a KGuiItem providing the text and icon for the button at the bottom of the TreeList/IconList.

Parameters:

  | guiitem | The text and icon on the PushButton.
  | recv | The object that is to receive the signal when the button is clicked.
  | slot | The slot to connect to the clicked signal of the button.

Since:
  3.2

Definition at line 1079 of file kdialogbase.cpp.

References KJanusWidget::addButtonBelowList().

void KDialogBase::setIconListAllVisible | ( | bool | state | ) |

This function has only effect in IconList mode.

Defines how the icon list widget is displayed. By default it is the widgets in the dialog pages that decide the minimum height of the dialog. A vertical scrollbar can be used in the icon list area.

Parameters:

  | state | The visibility mode. If true, the minimum height is adjusted so that every icon in the list is visible at the same time. The vertical scrollbar will never be visible.

Definition at line 1085 of file kdialogbase.cpp.

References KJanusWidget::setIconListAllVisible().

bool KDialogBase::haveBackgroundTile | ( |  | ) | `[static]`

Check whether the background tile is set or not.

Returns:
  `true` if there is defined a background tile.

Definition at line 1662 of file kdialogbase.cpp.

References KDialogBaseTile::get().

const QPixmap * KDialogBase::backgroundTile | ( |  | ) | `[static]`

Returns a pointer to the background tile if there is one.

Returns:
  The tile pointer or 0 if no tile is defined.

Definition at line 1670 of file kdialogbase.cpp.

References KDialogBaseTile::get().

Referenced by getBackgroundTile().

const QPixmap * KDialogBase::getBackgroundTile | ( |  | ) | `[static]`

Deprecated:
  Use backgroundTile() instead.

Definition at line 1668 of file kdialogbase.cpp.

References backgroundTile().

void KDialogBase::setBackgroundTile | ( | const QPixmap * | pix | ) | `[static]`

Sets the background tile.

If it is Null (0), the background image is deleted.

Parameters:

  | pix | The background tile.

Definition at line 1676 of file kdialogbase.cpp.

References KDialogBaseTile::set().

void KDialogBase::showTile | ( | bool | state | ) |

Enable hiding of the background tile (if any).

Parameters:

  | state | `true` will make the tile visible.

Definition at line 1711 of file kdialogbase.cpp.

References KDialogBaseTile::get().

Referenced by updateBackground().

void KDialogBase::getBorderWidths | ( | int & | ulx,
|  | int & | uly,
|  | int & | lrx,
|  | int & | lry
| ) | const

Deprecated:
  Do not use this method. It is included for compatibility reasons.

This method returns the border widths in all directions the dialog needs for itself. Respect this, or get bad looking results. The references are upper left x (`ulx`), upper left y (`uly`), lower right x (`lrx`), and lower left y (`lly`). The results are differences in pixels from the dialogs corners.

Definition at line 1510 of file kdialogbase.cpp.

References KDialog::marginHint().

Referenced by calculateSize().

QRect KDialogBase::getContentsRect | ( |  | ) | const

Deprecated:
  Do not use this method. It is included for compatibility reasons.

This method returns the contents rectangle of the work area. Place your widgets inside this rectangle, and use it to set up their geometry. Be careful: The rectangle is only valid after resizing the dialog, as it is a result of the resizing process. If you need the "overhead" the dialog needs for its elements, use getBorderWidths().

Definition at line 1489 of file kdialogbase.cpp.

References KDialog::marginHint(), QRect::setBottom(), QRect::setLeft(), QRect::setRight(), and QRect::setTop().

QSize KDialogBase::calculateSize | ( | int | w,
|  | int | h
| ) | const

Calculate the size hint for the dialog.

With this method it is easy to calculate a size hint for a dialog derived from KDialogBase if you know the width and height of the elements you add to the widget. The rectangle returned is calculated so that all elements exactly fit into it. Thus, you may set it as a minimum size for the resulting dialog.

You should not need to use this method and never if you use one of the predefined shapes.

Parameters:

  | w | The width of you special widget.
  | h | The height of you special widget.

Returns:
  The minimum width and height of the dialog using `w` and `h` as the size of the main widget.

Definition at line 1528 of file kdialogbase.cpp.

References getBorderWidths().

QString KDialogBase::helpLinkText | ( |  | ) | const

Returns the help link text.

If no text has been defined, "Get help..." (internationalized) is returned.

Returns:
  The help link text.

Definition at line 1536 of file kdialogbase.cpp.

References QString::isNull().

Referenced by enableLinkedHelp(), and setHelpLinkText().

QPushButton * KDialogBase::actionButton | ( | ButtonCode | id | ) |

Returns the action button that corresponds to the `id`.

Normally you should not use this function. Never delete the object returned by this function. See also enableButton(), showButton(), setButtonTip(), setButtonWhatsThis(), and setButtonText().

Parameters:

  | id | Integer identifier of the button.

Returns:
  The action button or 0 if the button does not exists.

FIXME KDE 4: Return the actual KPushButton instead of QPushButton (Martijn)

Definition at line 832 of file kdialogbase.cpp.

Referenced by closeEvent(), enableButton(), keyPressEvent(), KProgressDialog::KProgressDialog(), setButtonApplyText(), setButtonCancelText(), setButtonGuiItem(), setButtonOKText(), setButtonText(), setButtonTip(), setButtonWhatsThis(), and showButton().

void KDialogBase::enableButton | ( | ButtonCode | id,
|  | bool | state
| ) | `[slot]`

Enable or disable (gray out) a general action button.

Parameters:

  | id | Button identifier.
  | state | `true` enables the button(s).

Definition at line 838 of file kdialogbase.cpp.

References actionButton().

Referenced by enableButtonApply(), enableButtonCancel(), enableButtonOK(), KConfigDialog::KConfigDialog(), KKeyDialog::KKeyDialog(), KLineEditDlg::KLineEditDlg(), KConfigDialog::show(), KLineEditDlg::slotTextChanged(), and KConfigDialog::updateButtons().

void KDialogBase::enableButtonOK | ( | bool | state | ) | `[slot]`

Enable or disable (gray out) the OK button.

Parameters:

  | state | `true` enables the button.

Definition at line 848 of file kdialogbase.cpp.

References enableButton().

Referenced by KEditToolbar::acceptOK(), KLineEditDlg::KLineEditDlg(), and KLineEditDlg::slotTextChanged().

void KDialogBase::enableButtonApply | ( | bool | state | ) | `[slot]`

Enable or disable (gray out) the Apply button.

Parameters:

  | state | true enables the button.

Definition at line 854 of file kdialogbase.cpp.

References enableButton().

Referenced by KEditToolbar::slotApply().

void KDialogBase::enableButtonCancel | ( | bool | state | ) | `[slot]`

Enable or disable (gray out) the Cancel button.

Parameters:

  | state | true enables the button.

Definition at line 860 of file kdialogbase.cpp.

References enableButton().

void KDialogBase::enableLinkedHelp | ( | bool | state | ) | `[slot]`

Display or hide the help link area on the top of the dialog.

Parameters:

  | state | `true` will display the area.

Definition at line 1241 of file kdialogbase.cpp.

References KDialogBaseTile::get(), helpClickedSlot(), helpLinkText(), KDialog::marginHint(), KURLLabel::setFloat(), QLabel::setText(), and KURLLabel::setUnderline().

Referenced by setButtonBoxOrientation().

void KDialogBase::delayedDestruct | ( |  | ) | `[slot]`

Destruct the Dialog delayed.

You can call this function from slots like closeClicked() and hidden(). You should not use the dialog any more after calling this function.

Since:
  3.1

Definition at line 280 of file kdialogbase.cpp.

References QTimer::singleShot(), and slotDelayedDestruct().

void KDialogBase::setHelpLinkText | ( | const QString & | text | ) | `[slot]`

Sets the text that is shown as the linked text.

If text is empty, the text "Get help..." (internationalized) is used instead.

Parameters:

  | text | The link text.

Definition at line 1286 of file kdialogbase.cpp.

References helpLinkText(), and QLabel::setText().

void KDialogBase::setHelp | ( | const QString & | anchor,
|  | const QString & | appname = `QString::null`
| ) | `[slot]`

Sets the help path and topic.

Parameters:

  | anchor | Defined anchor in your docbook sources
  | appname | Defines the appname the help belongs to If empty it's the current one

Note:
  The help button works differently for the class KCMultiDialog, so it does not make sense to call this function for Dialogs of that type. See KCMultiDialog::slotHelp() for more information.

Definition at line 1279 of file kdialogbase.cpp.

Referenced by KAboutKDE::KAboutKDE(), and KColorDialog::KColorDialog().

void KDialogBase::helpClickedSlot | ( | const QString & |  | ) | `[slot]`

| Connected to help link label. Definition at line 1229 of file kdialogbase.cpp. References slotHelp(). Referenced by enableLinkedHelp().

void KDialogBase::setDetails | ( | bool | showDetails | ) | `[slot]`

| Sets the status of the Details button. Definition at line 1127 of file kdialogbase.cpp. References aboutToShowDetails(), adjustSize(), QWidget::hide(), setButtonText(), QWidget::setEnabled(), and QWidget::show(). Referenced by setButtonText(), setDetailsWidget(), and slotDetails().

void KDialogBase::setDetailsWidget | ( | QWidget * | detailsWidget | ) | `[slot]`

| Sets the widget that gets shown when "Details" is enabled. The dialog takes over ownership of the widget. Any previously set widget gets deleted. Definition at line 1112 of file kdialogbase.cpp. References QWidget::hide(), QWidget::reparent(), and setDetails().

void KDialogBase::updateBackground | ( |  | ) | `[slot]`

| This method is called automatically whenever the background has changed. You do not need to use this method. Definition at line 1685 of file kdialogbase.cpp. References KDialogBaseTile::get(), and showTile().

void KDialogBase::cancel | ( |  | ) | `[slot]`

Force closing the dialog, setting its result code to the one Esc would set.

You shouldn't use this, generally (let the user make his choice!) but it can be useful when you need to make a choice after a timeout has happened, or when the parent widget has to go somewhere else (e.g. html redirections).

Since:
  3.1

Definition at line 1632 of file kdialogbase.cpp.

References slotCancel(), slotClose(), slotNo(), slotOk(), slotUser1(), slotUser2(), slotUser3(), and slotYes().

Referenced by KDialogBase().

void KDialogBase::helpClicked | ( |  | ) | `[signal]`

| The Help button was pressed. This signal is only emitted if slotHelp() is not replaced. Referenced by slotHelp().

void KDialogBase::defaultClicked | ( |  | ) | `[signal]`

| The Default button was pressed. This signal is only emitted if slotDefault() is not replaced. Referenced by KConfigDialog::KConfigDialog(), KKeyDialog::KKeyDialog(), and slotDefault().

void KDialogBase::user3Clicked | ( |  | ) | `[signal]`

| The User3 button was pressed. This signal is only emitted if slotUser3() is not replaced. Referenced by slotUser3().

void KDialogBase::user2Clicked | ( |  | ) | `[signal]`

| The User2 button was pressed. This signal is only emitted if slotUser2() is not replaced. Referenced by slotUser2().

void KDialogBase::user1Clicked | ( |  | ) | `[signal]`

| The User1 button was pressed. This signal is only emitted if slotUser1() is not replaced. Referenced by KLineEditDlg::KLineEditDlg(), and slotUser1().

void KDialogBase::applyClicked | ( |  | ) | `[signal]`

| The Apply button was pressed. This signal is only emitted if slotApply() is not replaced. Referenced by KConfigDialog::KConfigDialog(), and slotApply().

void KDialogBase::tryClicked | ( |  | ) | `[signal]`

| The Try button was pressed. This signal is only emitted if slotTry() is not replaced. Referenced by slotTry().

void KDialogBase::okClicked | ( |  | ) | `[signal]`

| The OK button was pressed. This signal is only emitted if slotOk() is not replaced. Referenced by KColorDialog::KColorDialog(), KConfigDialog::KConfigDialog(), and slotOk().

void KDialogBase::yesClicked | ( |  | ) | `[signal]`

| The Yes button was pressed. This signal is only emitted if slotYes() is not replaced. Referenced by slotYes().

void KDialogBase::noClicked | ( |  | ) | `[signal]`

| The No button was pressed. This signal is only emitted if slotNo() is not replaced. Referenced by slotNo().

void KDialogBase::cancelClicked | ( |  | ) | `[signal]`

| The Cancel button was pressed. This signal is only emitted if slotCancel() is not replaced. Referenced by slotCancel().

void KDialogBase::closeClicked | ( |  | ) | `[signal]`

| The Close button was pressed. This signal is only emitted if slotClose() is not replaced. Referenced by KColorDialog::KColorDialog(), and slotClose().

void KDialogBase::apply | ( |  | ) | `[signal]`

Do not use this signal.

Is is kept for compatibility reasons.

Deprecated:
  Use applyClicked() instead.

Referenced by applyPressed().

void KDialogBase::backgroundChanged | ( |  | ) | `[signal]`

| The background tile has changed.

void KDialogBase::hidden | ( |  | ) | `[signal]`

| The dialog is about to be hidden. A dialog is hidden after a user clicks a button that ends the dialog or when the user switches to another desktop or minimizes the dialog. Referenced by hideEvent().

void KDialogBase::finished | ( |  | ) | `[signal]`

| The dialog has finished. A dialog emits finished after a user clicks a button that ends the dialog. This signal is also emitted when you call hide() If you have stored a pointer to the dialog do not try to delete the pointer in the slot that is connected to this signal. You should use delayedDestruct() instead. Referenced by hideEvent().

void KDialogBase::aboutToShowDetails | ( |  | ) | `[signal]`

| The detailsWidget is about to get shown. This is your last chance to call setDetailsWidget if you haven't done so yet. Referenced by setDetails().

void KDialogBase::aboutToShowPage | ( | QWidget * | page | ) | `[signal]`

| A page is about to be shown. This signal is only emitted for the TreeList and IconList faces. Referenced by KDialogBase().

void KDialogBase::keyPressEvent | ( | QKeyEvent * | e | ) | `[protected, virtual]`

Maps some keys to the actions buttons.

F1 is mapped to the Help button if present and Escape to the Cancel or Close if present. The button action event is animated.

Reimplemented from KDialog.

Reimplemented in KFileDialog, and KColorDialog.

Definition at line 1553 of file kdialogbase.cpp.

References actionButton(), and QWhatsThis::enterWhatsThisMode().

Referenced by KColorDialog::keyPressEvent().

void KDialogBase::hideEvent | ( | QHideEvent * |  | ) | `[protected, virtual]`

| Emits the hidden signal. You can connect to that signal to detect when a dialog has been closed. Definition at line 1611 of file kdialogbase.cpp. References finished(), and hidden().

void KDialogBase::closeEvent | ( | QCloseEvent * | e | ) | `[protected, virtual]`

| Detects when a dialog is being closed from the window manager controls. If the Cancel or Close button is present then the button is activated. Otherwise standard QDialog behavior will take place. Definition at line 1622 of file kdialogbase.cpp. References actionButton().

void KDialogBase::slotHelp | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Help button has been clicked. If a help text has been defined, the help system will be activated. Reimplemented in KCMultiDialog. Definition at line 1094 of file kdialogbase.cpp. References helpClicked(). Referenced by helpClickedSlot().

void KDialogBase::slotDefault | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Default button has been clicked. Reimplemented in KCMultiDialog. Definition at line 1102 of file kdialogbase.cpp. References defaultClicked().

void KDialogBase::slotDetails | ( |  | ) | `[protected, virtual, slot]`

Activated when the Details button has been clicked.

See also:
  detailsClicked(bool)

Reimplemented in KShortcutDialog.

Definition at line 1107 of file kdialogbase.cpp.

References setDetails().

void KDialogBase::slotUser3 | ( |  | ) | `[protected, virtual, slot]`

| Activated when the User3 button has been clicked. Definition at line 1183 of file kdialogbase.cpp. References user3Clicked(). Referenced by cancel().

void KDialogBase::slotUser2 | ( |  | ) | `[protected, virtual, slot]`

| Activated when the User2 button has been clicked. Definition at line 1189 of file kdialogbase.cpp. References user2Clicked(). Referenced by cancel().

void KDialogBase::slotUser1 | ( |  | ) | `[protected, virtual, slot]`

| Activated when the User1 button has been clicked. Reimplemented in KCMultiDialog. Definition at line 1195 of file kdialogbase.cpp. References user1Clicked(). Referenced by cancel().

void KDialogBase::slotOk | ( |  | ) | `[protected, virtual, slot]`

Activated when the Ok button has been clicked.

The QDialog::accept() is activated.

Reimplemented in KFileDialog, KIconDialog, KPropertiesDialog, KCMultiDialog, KFindDialog, KReplaceDialog, KSettings::ComponentsDialog, KBugReport, KEditToolbar, and KPasswordDialog.

Definition at line 1164 of file kdialogbase.cpp.

References QDialog::accept(), and okClicked().

Referenced by cancel(), and KInputDialog::getItem().

void KDialogBase::slotApply | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Apply button has been clicked. Reimplemented in KCMultiDialog, KSettings::ComponentsDialog, and KEditToolbar. Definition at line 1171 of file kdialogbase.cpp. References applyClicked().

void KDialogBase::slotTry | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Try button has been clicked. Definition at line 1177 of file kdialogbase.cpp. References tryClicked().

void KDialogBase::slotYes | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Yes button has been clicked. The QDialog::done( Yes ) is activated. Definition at line 1201 of file kdialogbase.cpp. References QDialog::done(), and yesClicked(). Referenced by cancel().

void KDialogBase::slotNo | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Yes button has been clicked. The QDialog::done( No ) is activated. Definition at line 1208 of file kdialogbase.cpp. References QDialog::done(), and noClicked(). Referenced by cancel().

void KDialogBase::slotCancel | ( |  | ) | `[protected, virtual, slot]`

Activated when the Cancel button has been clicked.

The QDialog::reject() is activated in regular mode and QDialog::done( Cancel ) when in message box mode.

Reimplemented in KFileDialog, KPropertiesDialog, KBugReport, KPasswordDialog, and KProgressDialog.

Definition at line 1215 of file kdialogbase.cpp.

References cancelClicked(), and QDialog::done().

Referenced by cancel(), KProgressDialog::slotCancel(), KBugReport::slotCancel(), and KBugReport::slotUrlClicked().

void KDialogBase::slotClose | ( |  | ) | `[protected, virtual, slot]`

| Activated when the Close button has been clicked. The QDialog::reject() is activated. Definition at line 1222 of file kdialogbase.cpp. References closeClicked(), and QDialog::reject(). Referenced by cancel().

void KDialogBase::applyPressed | ( |  | ) | `[protected, virtual, slot]`

Deprecated:
  Do not use this slot. Is is kept for compatibility reasons. Activated when the Apply button has been clicked

Definition at line 1235 of file kdialogbase.cpp.

References apply().

void KDialogBase::updateGeometry | ( |  | ) | `[protected, slot]`

| Updates the margins and spacings. Definition at line 1542 of file kdialogbase.cpp. References KDialog::marginHint(), QBoxLayout::setMargin(), QBoxLayout::setSpacing(), and KDialog::spacingHint(). Referenced by KDialogBase().

void KDialogBase::slotDelayedDestruct | ( |  | ) | `[protected, slot]`

| Deletes the dialog immediately. If you want to delete the dialog delayed use delayedDestruct() or QObject::deleteLater(). Attention: Do no use connect this slot to signals from user actions! Definition at line 288 of file kdialogbase.cpp. Referenced by delayedDestruct().

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

- kdialogbase.h
- kdialogbase.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:57 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003