| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KDialog Class Reference

Dialog with extended nonmodal support and methods for KDE standard compliance. More...

`#include <kdialog.h>`

Inheritance diagram for KDialog:

[legend]
Collaboration diagram for KDialog:

[legend]
List of all members.

## Public Slots
virtual void | polish ()
virtual void | setCaption (const QString &caption)
| Make a KDE compliant caption.
virtual void | setPlainCaption (const QString &caption)
| Make a plain caption without any modifications.
## Signals
void | layoutHintChanged ()
| Emitted when the margin size and/or spacing size have changed.
## Public Member Functions
| KDialog (QWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)
| Constructor.
## Static Public Member Functions
int | marginHint ()
| Return the number of pixels you shall use between a dialog edge and the outermost widget(s) according to the KDE standard.
int | spacingHint ()
| Return the number of pixels you shall use between widgets inside a dialog according to the KDE standard.
void | resizeLayout (QWidget *widget, int margin, int spacing)
| Resize every layout manager used in `widget` and its nested children.
void | resizeLayout (QLayoutItem *lay, int margin, int spacing)
| Reszie every layout associated with `lay` and its children.
void | centerOnScreen (QWidget *widget, int screen=-1)
| Centers `widget` on the desktop, taking multi-head setups into account.
## Protected Member Functions
virtual void | keyPressEvent (QKeyEvent *)
virtual void | virtual_hook (int id, void *data)

## Detailed Description

Dialog with extended nonmodal support and methods for KDE standard compliance.

Generally, you should not use this class directly, but KDialogBase which inherits KDialog.

If the dialog is non-modal and has a parent, the default keybindings (`escape` = `reject()`, `enter` = `accept()`, etc.) are disabled.

The marginHint() and spacingHint() sizes shall be used whenever you layout the interior of a dialog. One special note. If you make your own action buttons (OK, Cancel etc), the space beteween the buttons shall be spacingHint(), whereas the space above, below, to the right and to the left shall be marginHint(). If you add a separator line above the buttons, there shall be a marginHint() between the buttons and the separator and a marginHint() above the separator as well.

See also:
  KDialogBase

Author:
  Thomas Tanghus <tanghus@earthling.net>, Espen Sand <espensa@online.no>

Version:
  0.1.2

Definition at line 51 of file kdialog.h.

## Constructor & Destructor Documentation

KDialog::KDialog | ( | QWidget * | parent = 0,
|  | const char * | name = 0,
|  | bool | modal = false,
|  | WFlags | f = 0
| ) |

| Constructor. Takes the same arguments as QDialog. Definition at line 39 of file kdialog.cpp. References KStdAccel::name().

## Member Function Documentation

int KDialog::marginHint | ( |  | ) | `[static]`

| Return the number of pixels you shall use between a dialog edge and the outermost widget(s) according to the KDE standard. Definition at line 92 of file kdialog.cpp. Referenced by KHelpMenu::aboutApplication(), KDialogBase::enableLinkedHelp(), KDialogBase::getBorderWidths(), KDialogBase::getContentsRect(), KFontChooser::KFontChooser(), KJanusWidget::KJanusWidget(), KTipDialog::KTipDialog(), KPassivePopup::setView(), and KDialogBase::updateGeometry().

int KDialog::spacingHint | ( |  | ) | `[static]`

| Return the number of pixels you shall use between widgets inside a dialog according to the KDE standard. Definition at line 98 of file kdialog.cpp. Referenced by KHelpMenu::aboutApplication(), KJanusWidget::addGridPage(), KJanusWidget::addHBoxPage(), KJanusWidget::addVBoxPage(), KBugReport::KBugReport(), KCharSelect::KCharSelect(), KFontChooser::KFontChooser(), KJanusWidget::KJanusWidget(), KLineEditDlg::KLineEditDlg(), KTipDialog::KTipDialog(), KDialogBase::makeGridMainWidget(), KDialogBase::makeHBoxMainWidget(), KDialogBase::makeVBoxMainWidget(), KJanusWidget::minimumSizeHint(), KDialogBase::setButtonApplyText(), KDialogBase::setButtonCancelText(), KDialogBase::setButtonOKText(), KDialogBase::setButtonText(), KPassivePopup::setView(), KPassivePopup::standardView(), and KDialogBase::updateGeometry().

void KDialog::resizeLayout | ( | QWidget * | widget,
|  | int | margin,
|  | int | spacing
| ) | `[static]`

  | Resize every layout manager used in `widget` and its nested children. Parameters:
  margin | The new layout margin.
  margin | The new layout spacing.
Definition at line 132 of file kdialog.cpp. References QObject::isWidgetType(), and QWidget::layout(). Referenced by resizeLayout().

void KDialog::resizeLayout | ( | QLayoutItem * | lay,
|  | int | margin,
|  | int | spacing
| ) | `[static]`

  | Reszie every layout associated with `lay` and its children. Parameters:
  margin | The new layout margin
  margin | The new layout spacing
Definition at line 154 of file kdialog.cpp. References QLayoutIterator::current(), QLayoutItem::iterator(), QLayoutItem::layout(), and resizeLayout().

void KDialog::centerOnScreen | ( | QWidget * | widget,
|  | int | screen = -1
| ) | `[static]`

| Centers `widget` on the desktop, taking multi-head setups into account. If `screen` is -1, `widget` will be centered on its current screen (if it was shown already) or on the primary screen. Since: 3.1 Definition at line 170 of file kdialog.cpp. References QRect::center(), QApplication::desktop(), QWidget::height(), QWidget::move(), QDesktopWidget::numScreens(), QDesktopWidget::primaryScreen(), QDesktopWidget::screenGeometry(), QDesktopWidget::screenNumber(), and QWidget::width().

void KDialog::setCaption | ( | const QString & | caption | ) | `[virtual, slot]`

  | Make a KDE compliant caption. Parameters:
  caption | Your caption. Do `not` include the application name in this string. It will be added automatically according to the KDE standard.
Definition at line 114 of file kdialog.cpp. References setPlainCaption(). Referenced by KLineEditDlg::getText(), KDialogBase::KDialogBase(), and KTipDialog::KTipDialog().

void KDialog::setPlainCaption | ( | const QString & | caption | ) | `[virtual, slot]`

  | Make a plain caption without any modifications. Parameters:
  caption | Your caption. This is the string that will be displayed in the window title.
Definition at line 121 of file kdialog.cpp. References QString::utf8(). Referenced by KHelpMenu::aboutApplication(), KAboutDialog::imageURL(), KAboutDialog::KAboutDialog(), and setCaption().

void KDialog::layoutHintChanged | ( |  | ) | `[signal]`

| Emitted when the margin size and/or spacing size have changed. Use marginHint() and spacingHint() in your slot to get the new values. Referenced by KDialogBase::KDialogBase().

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

- kdialog.h
- kdialog.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:59:43 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001