KDialogBase Class Reference
Provides basic functionality needed by nearly all dialogs. A dialog base class with standard buttons and predefined layouts. More...
#include <kdialogbase.h>
Inheritance diagram for KDialogBase:

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 } |
| |
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) |
Enable or disable (gray out) a general action button. | |
void | enableButtonOK (bool state) |
Enable or disable (gray out) the OK button. | |
void | enableButtonApply (bool state) |
Enable or disable (gray out) the Apply button. | |
void | enableButtonCancel (bool state) |
Enable or disable (gray out) the Cancel button. | |
void | enableLinkedHelp (bool state) |
Display or hide the help link area on the top of the dialog. | |
void | delayedDestruct () |
Destruct the Dialog delayed. | |
void | setHelpLinkText (const QString &text) |
Sets the text that is shown as the linked text. | |
void | setHelp (const QString &anchor, const QString &appname=QString::null) |
Sets the help path and topic. | |
void | helpClickedSlot (const QString &) |
Connected to help link label. | |
void | setDetails (bool showDetails) |
Sets the status of the Details button. | |
void | setDetailsWidget (QWidget *detailsWidget) |
Sets the widget that gets shown when "Details" is enabled. | |
void | updateBackground () |
This method is called automatically whenever the background has changed. | |
void | cancel () |
Force closing the dialog, setting its result code to the one Esc would set. | |
Signals | |
void | helpClicked () |
The Help button was pressed. | |
void | defaultClicked () |
The Default button was pressed. | |
void | user3Clicked () |
The User3 button was pressed. | |
void | user2Clicked () |
The User2 button was pressed. | |
void | user1Clicked () |
The User1 button was pressed. | |
void | applyClicked () |
The Apply button was pressed. | |
void | tryClicked () |
The Try button was pressed. | |
void | okClicked () |
The OK button was pressed. | |
void | yesClicked () |
The Yes button was pressed. | |
void | noClicked () |
The No button was pressed. | |
void | cancelClicked () |
The Cancel button was pressed. | |
void | closeClicked () |
The Close button was pressed. | |
void | apply () |
Do not use this signal. | |
void | backgroundChanged () |
The background tile has changed. | |
void | hidden () |
The dialog is about to be hidden. | |
void | finished () |
The dialog has finished. | |
void | aboutToShowDetails () |
The detailsWidget is about to get shown. | |
void | aboutToShowPage (QWidget *page) |
A page is about to be shown. | |
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()) | |
Constructor for the standard mode where you must specify the main widget with setMainWidget() . | |
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()) | |
Constructor for the predefined layout mode where you specify the kind of layout (face). | |
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. | |
~KDialogBase () | |
Destructor. | |
void | setButtonBoxOrientation (int orientation) |
Sets the orientation of the button box. | |
void | setEscapeButton (ButtonCode id) |
Sets the button that will be activated when the Escape key is pressed. | |
virtual void | adjustSize () |
Adjust the size of the dialog to fit the contents just before QDialog::exec() or QDialog::show() is called. | |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
QFrame * | plainPage () |
Retrieve the empty page when the predefined layout is used in Plain mode. | |
QFrame * | 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. | |
QFrame * | 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. | |
QVBox * | 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. | |
QVBox * | 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. | |
QHBox * | 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. | |
QHBox * | 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. | |
QGrid * | 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. | |
QGrid * | 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. | |
void | setFolderIcon (const QStringList &path, const QPixmap &pixmap) |
Sets the icon used in TreeList Mode for the given path. | |
QFrame * | makeMainWidget () |
Make a main widget. | |
QVBox * | makeVBoxMainWidget () |
Make a main widget. | |
QHBox * | makeHBoxMainWidget () |
Make a main widget. | |
QGrid * | makeGridMainWidget (int n, Orientation dir) |
Make a main widget. | |
void | enableButtonSeparator (bool state) |
Hide or display the a separator line drawn between the action buttons an the main widget. | |
void | showButton (ButtonCode id, bool state) |
Hide or display a general action button. | |
void | showButtonOK (bool state) |
Hide or display the OK button. | |
void | showButtonApply (bool state) |
Hide or display the Apply button. | |
void | showButtonCancel (bool state) |
Hide or display the Cancel button. | |
bool | showPage (int index) |
Sets the page with index to be displayed. | |
int | activePageIndex () const |
Returns the index of the active page. | |
int | pageIndex (QWidget *widget) const |
Returns the index of a page created with addPage(), addVBoxPage(), addHBoxPage() or addGridPage(). | |
void | setMainWidget (QWidget *widget) |
Sets the main user definable widget. | |
QWidget * | mainWidget () |
Returns the main widget if any. | |
void | disableResize () |
Convenience method. | |
void | setInitialSize (const QSize &s, bool noResize=false) |
Convenience method. | |
void | incInitialSize (const QSize &s, bool noResize=false) |
Convenience method. | |
QSize | configDialogSize (const QString &groupName) const |
read the dialogs size from the configuration according to the screen size. | |
void | saveDialogSize (const QString &groupName, bool global=false) |
save the dialogs size dependant on the screen dimension either to the global or application config file. | |
void | setButtonOKText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) |
Sets the text of the OK button. | |
void | setButtonApplyText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) |
Sets the text of the Apply button. | |
void | setButtonCancelText (const QString &text=QString::null, const QString &tooltip=QString::null, const QString &quickhelp=QString::null) |
Sets the text of the Cancel button. | |
void | setButtonText (ButtonCode id, const QString &text) |
Sets the text of any button. | |
void | setButtonTip (ButtonCode id, const QString &text) |
Sets the tooltip text of any button. | |
void | setButtonWhatsThis (ButtonCode id, const QString &text) |
Sets the "What's this?" text of any button. | |
void | setTreeListAutoResize (bool state) |
This function has only effect in TreeList mode. | |
void | setShowIconsInTreeList (bool state) |
This function has only effect in TreeList mode. | |
void | setRootIsDecorated (bool state) |
This function has only effect in TreeList mode. | |
void | setIconListAllVisible (bool state) |
This function has only effect in IconList mode. | |
void | showTile (bool state) |
Enable hiding of the background tile (if any). | |
void | getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const |
This class or method is obsolete, it is provided for compatibility only. Do not use this method. | |
QRect | getContentsRect () const |
This class or method is obsolete, it is provided for compatibility only. Do not use this method. | |
QSize | calculateSize (int w, int h) const |
Calculate the size hint for the dialog. | |
QString | helpLinkText () const |
Returns the help link text. | |
QPushButton * | actionButton (ButtonCode id) |
Returns the action button that corresponds to the id . | |
Static Public Member Functions | |
bool | haveBackgroundTile () |
Check whether the background tile is set or not. | |
const QPixmap * | backgroundTile () |
Returns a pointer to the background tile if there is one. | |
const QPixmap * | getBackgroundTile () |
This class or method is obsolete, it is provided for compatibility only. Use backgroundTile() instead. | |
void | setBackgroundTile (const QPixmap *pix) |
Sets the background tile. | |
Protected Slots | |
virtual void | slotHelp () |
Activated when the Help button has been clicked. | |
virtual void | slotDefault () |
Activated when the Default button has been clicked. | |
virtual void | slotDetails () |
Activated when the Details button has been clicked. | |
virtual void | slotUser3 () |
Activated when the User3 button has been clicked. | |
virtual void | slotUser2 () |
Activated when the User2 button has been clicked. | |
virtual void | slotUser1 () |
Activated when the User1 button has been clicked. | |
virtual void | slotOk () |
Activated when the Ok button has been clicked. | |
virtual void | slotApply () |
Activated when the Apply button has been clicked. | |
virtual void | slotTry () |
Activated when the Try button has been clicked. | |
virtual void | slotYes () |
Activated when the Yes button has been clicked. | |
virtual void | slotNo () |
Activated when the Yes button has been clicked. | |
virtual void | slotCancel () |
Activated when the Cancel button has been clicked. | |
virtual void | slotClose () |
Activated when the Close button has been clicked. | |
virtual void | applyPressed () |
Do not use this slot. | |
void | updateGeometry () |
Updates the margins and spacings. | |
void | slotDelayedDestruct () |
Deletes the dialog immediately. | |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *e) |
Maps some keys to the actions buttons. | |
virtual void | hideEvent (QHideEvent *) |
Emits the hidden signal. | |
virtual void | closeEvent (QCloseEvent *e) |
Detects when a dialog is being closed from the window manager controls. | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
Provides basic functionality needed by nearly all dialogs. A dialog base class with standard buttons and predefined layouts.
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, User1 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.
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 shall not add a margin yourself. 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:
If you use makeVBoxMainWidget(), then the dialog above can be made simpler but you lose the ability to add a stretchable area:
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.
Definition at line 191 of file kdialogbase.h.
Member Enumeration Documentation
|
Definition at line 214 of file kdialogbase.h. |
|
Definition at line 252 of file kdialogbase.h. |
Constructor & Destructor Documentation
|
Constructor for the standard mode where you must specify the main widget with setMainWidget() .
Definition at line 94 of file kdialogbase.cpp. References enableButtonSeparator(), KDialog::layoutHintChanged(), KStdAccel::name(), KDialog::setCaption(), and updateGeometry(). |
|
Constructor for the predefined layout mode where you specify the kind of layout (face).
Definition at line 117 of file kdialogbase.cpp. References aboutToShowPage(), enableButtonSeparator(), KJanusWidget::isValid(), KDialog::layoutHintChanged(), KStdAccel::name(), KDialog::setCaption(), and updateGeometry(). |
|
Constructor for a message box mode where the 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.
Definition at line 146 of file kdialogbase.cpp. References cancel(), enableButtonSeparator(), KDialog::layoutHintChanged(), KStdAccel::name(), setButtonCancelText(), KDialog::setCaption(), and updateGeometry(). |
|
Destructor.
Definition at line 180 of file kdialogbase.cpp. |
Member Function Documentation
|
Sets the orientation of the button box.
It can be
Definition at line 312 of file kdialogbase.cpp. References enableLinkedHelp(), and KSeparator::setOrientation(). |
|
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.
Definition at line 332 of file kdialogbase.cpp. |
|
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 394 of file kdialogbase.cpp. Referenced by incInitialSize(), setDetails(), and setInitialSize(). |
|
Retrieve the empty page when the predefined layout is used in This widget must used as the toplevel widget of your dialog code.
Definition at line 387 of file kdialogbase.cpp. References KJanusWidget::plainPage(). Referenced by KBugReport::KBugReport(), KLineEditDlg::KLineEditDlg(), and KProgressDialog::KProgressDialog(). |
|
Add a page to the dialog when the class is used in 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:
Definition at line 1208 of file kdialogbase.cpp. References KJanusWidget::addPage(). |
|
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 Definition at line 1214 of file kdialogbase.cpp. References KJanusWidget::addPage(). |
|
Add a page to the dialog when the class is used in 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:
Definition at line 1221 of file kdialogbase.cpp. References KJanusWidget::addVBoxPage(). |
|
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 Definition at line 1227 of file kdialogbase.cpp. References KJanusWidget::addVBoxPage(). |
|
Add a page to the dialog when the class is used in 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:
Definition at line 1234 of file kdialogbase.cpp. References KJanusWidget::addHBoxPage(). |
|
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 Definition at line 1241 of file kdialogbase.cpp. References KJanusWidget::addHBoxPage(). |
|
Add a page to the dialog when the class is used in 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.
Definition at line 1249 of file kdialogbase.cpp. References KJanusWidget::addGridPage(). |
|
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 Definition at line 1257 of file kdialogbase.cpp. References KJanusWidget::addGridPage(). |
|
Sets the icon used in
Definition at line 1265 of file kdialogbase.cpp. References KJanusWidget::setFolderIcon(). |
|
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 (
Definition at line 1273 of file kdialogbase.cpp. References mainWidget(), and setMainWidget(). |
|
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, not if you have already defined a main widget with setMainWidget() and not if you have used the constructor where you define the face (
Definition at line 1287 of file kdialogbase.cpp. References mainWidget(), setMainWidget(), and KDialog::spacingHint(). |
|
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
Definition at line 1302 of file kdialogbase.cpp. References mainWidget(), setMainWidget(), QHBox::setSpacing(), and KDialog::spacingHint(). |
|
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).
Definition at line 1317 of file kdialogbase.cpp. References mainWidget(), setMainWidget(), QGrid::setSpacing(), and KDialog::spacingHint(). |
|
Hide or display the a separator line drawn between the action buttons an the main widget.
Definition at line 356 of file kdialogbase.cpp. References KSeparator::setOrientation(). Referenced by KDialogBase(). |
|
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.
Definition at line 828 of file kdialogbase.cpp. References actionButton(). Referenced by KProgressDialog::KProgressDialog(), showButtonApply(), showButtonCancel(), and showButtonOK(). |
|
Hide or display the OK button. The OK button must have been created in the constructor to be displayed.
Definition at line 838 of file kdialogbase.cpp. References showButton(). Referenced by KBugReport::KBugReport(). |
|
Hide or display the Apply button. The Apply button must have been created in the constructor to be displayed.
Definition at line 844 of file kdialogbase.cpp. References showButton(). |
|
Hide or display the Cancel button. The Cancel button must have been created in the constructor to be displayed.
Definition at line 850 of file kdialogbase.cpp. References showButton(). Referenced by KProgressDialog::showCancelButton(). |
|
Sets the page with This method will only work when the dialog is using the predefined shape of TreeList, IconList or Tabbed.
Definition at line 1371 of file kdialogbase.cpp. References KJanusWidget::showPage(). |
|
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.
Definition at line 1377 of file kdialogbase.cpp. References KJanusWidget::activePageIndex(). |
|
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.
Definition at line 1383 of file kdialogbase.cpp. References KJanusWidget::pageIndex(). |
|
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
Definition at line 1345 of file kdialogbase.cpp. References KJanusWidget::setSwallowedWidget(). Referenced by KHelpMenu::aboutApplication(), KAboutDialog::KAboutDialog(), KFontDialog::KFontDialog(), KKeyDialog::KKeyDialog(), makeGridMainWidget(), makeHBoxMainWidget(), makeMainWidget(), and makeVBoxMainWidget(). |
|
Returns the main widget if any.
Definition at line 1365 of file kdialogbase.cpp. Referenced by KProgressDialog::KProgressDialog(), makeGridMainWidget(), makeHBoxMainWidget(), makeMainWidget(), and makeVBoxMainWidget(). |
|
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 496 of file kdialogbase.cpp. Referenced by KHelpMenu::aboutApplication(). |
|
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.
Definition at line 502 of file kdialogbase.cpp. References adjustSize(). |
|
Convenience method. Add a size to the default minimum size of a dialog. This method should only be called right before show() or exec().
Definition at line 510 of file kdialogbase.cpp. References adjustSize(). |
|
read the dialogs size from the configuration according to the screen size. If no size is saved for one dimension of the screen, a default size is choosed. The default width is 50 percent of the screen width, the default height is 40 percent of the screen height.
Definition at line 1645 of file kdialogbase.cpp. References KGlobal::config(), QApplication::desktop(), QString::fromLatin1(), QRect::height(), KConfigBase::readNumEntry(), and QRect::width(). |
|
save the dialogs size dependant on the screen dimension either to the global or application config file.
Definition at line 1665 of file kdialogbase.cpp. References KGlobal::config(), QApplication::desktop(), QString::fromLatin1(), QSize::height(), QRect::height(), QString::number(), QSize::width(), QRect::width(), and KConfigBase::writeEntry(). |
|
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.
Definition at line 856 of file kdialogbase.cpp. References actionButton(), QWhatsThis::add(), QToolTip::add(), QString::isEmpty(), QPushButton::setText(), KDialog::spacingHint(), and KStdAccel::whatsThis. Referenced by KBugReport::KBugReport(). |
|
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.
Definition at line 879 of file kdialogbase.cpp. References actionButton(), QWhatsThis::add(), QToolTip::add(), QString::isEmpty(), QPushButton::setText(), KDialog::spacingHint(), and KStdAccel::whatsThis. |
|
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.
Definition at line 903 of file kdialogbase.cpp. References actionButton(), QWhatsThis::add(), QToolTip::add(), QString::isEmpty(), QPushButton::setText(), and KDialog::spacingHint(). Referenced by KBugReport::KBugReport(), KDialogBase(), and KProgressDialog::setButtonText(). |
|
Sets the text of any button.
Definition at line 921 of file kdialogbase.cpp. References actionButton(), setDetails(), QPushButton::setText(), and KDialog::spacingHint(). Referenced by setDetails(). |
|
Sets the tooltip text of any button.
Definition at line 938 of file kdialogbase.cpp. References actionButton(), QToolTip::add(), QString::isEmpty(), and QToolTip::remove(). |
|
Sets the "What's this?" text of any button.
Definition at line 951 of file kdialogbase.cpp. References actionButton(), QWhatsThis::add(), QString::isEmpty(), and QWhatsThis::remove(). |
|
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.
Definition at line 971 of file kdialogbase.cpp. References KJanusWidget::setTreeListAutoResize(). |
|
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.
Definition at line 979 of file kdialogbase.cpp. References KJanusWidget::setShowIconsInTreeList(). |
|
This function has only effect in TreeList mode. This tells the widgets whether the root should be decorated. For details see QListView::setRootIsDecorated
Definition at line 987 of file kdialogbase.cpp. References KJanusWidget::setRootIsDecorated(). |
|
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.
Definition at line 997 of file kdialogbase.cpp. References KJanusWidget::setIconListAllVisible(). |
|
Check whether the background tile is set or not.
Definition at line 1566 of file kdialogbase.cpp. References KDialogBaseTile::get(). |
|
Returns a pointer to the background tile if there is one.
Definition at line 1574 of file kdialogbase.cpp. References KDialogBaseTile::get(). Referenced by getBackgroundTile(). |
|
This class or method is obsolete, it is provided for compatibility only. Use backgroundTile() instead.
Definition at line 1572 of file kdialogbase.cpp. References backgroundTile(). |
|
Sets the background tile. If it is Null (0), the background image is deleted.
Definition at line 1580 of file kdialogbase.cpp. References KDialogBaseTile::set(). |
|
Enable hiding of the background tile (if any).
Definition at line 1615 of file kdialogbase.cpp. References KDialogBaseTile::get(). Referenced by updateBackground(). |
|
This class or method is obsolete, it is provided for compatibility only. 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 ( Definition at line 1411 of file kdialogbase.cpp. References KDialog::marginHint(). Referenced by calculateSize(). |
|
This class or method is obsolete, it is provided for compatibility only. 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 1390 of file kdialogbase.cpp. References KDialog::marginHint(), QRect::setBottom(), QRect::setLeft(), QRect::setRight(), and QRect::setTop(). |
|
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.
Definition at line 1429 of file kdialogbase.cpp. References getBorderWidths(). |
|
Returns the help link text. If no text has been defined, "Get help..." (internationalized) is returned.
Definition at line 1437 of file kdialogbase.cpp. Referenced by enableLinkedHelp(), and setHelpLinkText(). |
|
Returns the action button that corresponds to the Normally you should not use this function. Never delete the object returned by this function. See also enableButton(), showButton(), setButtonTip(), setButtonWhatsThis(), and setButtonText().
Definition at line 794 of file kdialogbase.cpp. Referenced by closeEvent(), enableButton(), keyPressEvent(), KProgressDialog::KProgressDialog(), setButtonApplyText(), setButtonCancelText(), setButtonOKText(), setButtonText(), setButtonTip(), setButtonWhatsThis(), and showButton(). |
|
Enable or disable (gray out) a general action button.
Definition at line 800 of file kdialogbase.cpp. References actionButton(). Referenced by enableButtonApply(), enableButtonCancel(), enableButtonOK(), KKeyDialog::KKeyDialog(), KLineEditDlg::KLineEditDlg(), and KLineEditDlg::slotTextChanged(). |
|
Enable or disable (gray out) the OK button.
Definition at line 810 of file kdialogbase.cpp. References enableButton(). Referenced by KEditToolbar::acceptOK(), KLineEditDlg::KLineEditDlg(), and KLineEditDlg::slotTextChanged(). |
|
Enable or disable (gray out) the Apply button.
Definition at line 816 of file kdialogbase.cpp. References enableButton(). Referenced by KEditToolbar::slotApply(). |
|
Enable or disable (gray out) the Cancel button.
Definition at line 822 of file kdialogbase.cpp. References enableButton(). |
|
Display or hide the help link area on the top of the dialog.
Definition at line 1153 of file kdialogbase.cpp. References KDialogBaseTile::get(), helpClickedSlot(), helpLinkText(), KDialog::marginHint(), KURLLabel::setFloat(), QLabel::setText(), and KURLLabel::setUnderline(). Referenced by setButtonBoxOrientation(). |
|
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.
Definition at line 247 of file kdialogbase.cpp. References QTimer::singleShot(), and slotDelayedDestruct(). |
|
Sets the text that is shown as the linked text. If text is empty, the text "Get help..." (internationalized) is used instead.
Definition at line 1198 of file kdialogbase.cpp. References helpLinkText(), and QLabel::setText(). |
|
Sets the help path and topic.
Definition at line 1191 of file kdialogbase.cpp. Referenced by KAboutKDE::KAboutKDE(). |
|
Connected to help link label.
Definition at line 1141 of file kdialogbase.cpp. References slotHelp(). Referenced by enableLinkedHelp(). |
|
Sets the status of the Details button.
Definition at line 1039 of file kdialogbase.cpp. References aboutToShowDetails(), adjustSize(), and setButtonText(). Referenced by setButtonText(), setDetailsWidget(), and slotDetails(). |
|
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 1024 of file kdialogbase.cpp. References setDetails(). |
|
This method is called automatically whenever the background has changed. You do not need to use this method. Definition at line 1589 of file kdialogbase.cpp. References KDialogBaseTile::get(), and showTile(). |
|
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).
Definition at line 1536 of file kdialogbase.cpp. References slotCancel(), slotClose(), slotNo(), slotOk(), slotUser1(), slotUser2(), slotUser3(), and slotYes(). Referenced by KDialogBase(). |
|
The Help button was pressed. This signal is only emitted if slotHelp() is not replaced. Referenced by slotHelp(). |
|
The Default button was pressed. This signal is only emitted if slotDefault() is not replaced. Referenced by KKeyDialog::KKeyDialog(), and slotDefault(). |
|
The User3 button was pressed. This signal is only emitted if slotUser3() is not replaced. Referenced by slotUser3(). |
|
The User2 button was pressed. This signal is only emitted if slotUser2() is not replaced. Referenced by slotUser2(). |
|
The User1 button was pressed. This signal is only emitted if slotUser1() is not replaced. Referenced by KLineEditDlg::KLineEditDlg(), and slotUser1(). |
|
The Apply button was pressed. This signal is only emitted if slotApply() is not replaced. Referenced by slotApply(). |
|
The Try button was pressed. This signal is only emitted if slotTry() is not replaced. Referenced by slotTry(). |
|
The OK button was pressed. This signal is only emitted if slotOk() is not replaced. Referenced by slotOk(). |
|
The Yes button was pressed. This signal is only emitted if slotYes() is not replaced. Referenced by slotYes(). |
|
The No button was pressed. This signal is only emitted if slotNo() is not replaced. Referenced by slotNo(). |
|
The Cancel button was pressed. This signal is only emitted if slotCancel() is not replaced. Referenced by slotCancel(). |
|
The Close button was pressed. This signal is only emitted if slotClose() is not replaced. Referenced by slotClose(). |
|
Do not use this signal. Is is kept for compatibility reasons. Use applyClicked() instead. Referenced by applyPressed(). |
|
The background tile has changed.
|
|
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(). |
|
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(). |
|
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(). |
|
A page is about to be shown.
Referenced by KDialogBase(). |
|
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 KColorDialog. Definition at line 1454 of file kdialogbase.cpp. References QKeyEvent::accept(), actionButton(), QWhatsThis::enterWhatsThisMode(), QKeyEvent::key(), and QKeyEvent::state(). |
|
Emits the hidden signal. You can connect to that signal to detect when a dialog has been closed. Definition at line 1515 of file kdialogbase.cpp. References finished(), and hidden(). |
|
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 1526 of file kdialogbase.cpp. References actionButton(). |
|
Activated when the Help button has been clicked. If a help text has been defined, the help system will be activated. Definition at line 1006 of file kdialogbase.cpp. References helpClicked(). Referenced by helpClickedSlot(). |
|
Activated when the Default button has been clicked.
Definition at line 1014 of file kdialogbase.cpp. References defaultClicked(). |
|
Activated when the Details button has been clicked.
Definition at line 1019 of file kdialogbase.cpp. References setDetails(). |
|
Activated when the User3 button has been clicked.
Definition at line 1095 of file kdialogbase.cpp. References user3Clicked(). Referenced by cancel(). |
|
Activated when the User2 button has been clicked.
Definition at line 1101 of file kdialogbase.cpp. References user2Clicked(). Referenced by cancel(). |
|
Activated when the User1 button has been clicked.
Definition at line 1107 of file kdialogbase.cpp. References user1Clicked(). Referenced by cancel(). |
|
Activated when the Ok button has been clicked. The QDialog::accept() is activated. Reimplemented in KFileDialog, KPropertiesDialog, KBugReport, KEditToolbar, and KPasswordDialog. Definition at line 1076 of file kdialogbase.cpp. References QDialog::accept(), and okClicked(). Referenced by cancel(). |
|
Activated when the Apply button has been clicked.
Reimplemented in KEditToolbar. Definition at line 1083 of file kdialogbase.cpp. References applyClicked(). |
|
Activated when the Try button has been clicked.
Definition at line 1089 of file kdialogbase.cpp. References tryClicked(). |
|
Activated when the Yes button has been clicked. The QDialog::done( Yes ) is activated. Definition at line 1113 of file kdialogbase.cpp. References QDialog::done(), and yesClicked(). Referenced by cancel(). |
|
Activated when the Yes button has been clicked. The QDialog::done( No ) is activated. Definition at line 1120 of file kdialogbase.cpp. References QDialog::done(), and noClicked(). Referenced by cancel(). |
|
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 1127 of file kdialogbase.cpp. References cancelClicked(), and QDialog::done(). Referenced by cancel(), KProgressDialog::slotCancel(), KBugReport::slotCancel(), and KBugReport::slotUrlClicked(). |
|
Activated when the Close button has been clicked. The QDialog::reject() is activated. Definition at line 1134 of file kdialogbase.cpp. References closeClicked(), and QDialog::reject(). Referenced by cancel(). |
|
Do not use this slot. Is is kept for compatibility reasons. Activated when the Apply button has been clicked Definition at line 1147 of file kdialogbase.cpp. References apply(). |
|
Updates the margins and spacings.
Definition at line 1443 of file kdialogbase.cpp. References KDialog::marginHint(), QBoxLayout::setMargin(), QBoxLayout::setSpacing(), and KDialog::spacingHint(). Referenced by KDialogBase(). |
|
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 255 of file kdialogbase.cpp. Referenced by delayedDestruct(). |
The documentation for this class was generated from the following files: