35#include <QtGui/QDialog>
156 Q_DECLARE_FLAGS(ButtonCodes, ButtonCode)
163 Q_DECLARE_FLAGS(ButtonPopupModes, ButtonPopupMode)
172 explicit KDialog(
QWidget *parent = 0, Qt::WindowFlags flags = 0 );
192 void setButtons( ButtonCodes buttonMask );
204 void setButtonsOrientation( Qt::Orientation orientation );
216 void setEscapeButton( ButtonCode
id );
226 void setDefaultButton( ButtonCode
id );
232 ButtonCode defaultButton()
const;
238 void showButtonSeparator(
bool state );
250 void showButton( ButtonCode
id,
bool state );
258 void setButtonText( ButtonCode
id,
const QString &text );
263 QString buttonText( ButtonCode
id )
const;
271 void setButtonIcon( ButtonCode
id,
const KIcon &icon );
276 KIcon buttonIcon( ButtonCode
id )
const;
284 void setButtonToolTip( ButtonCode
id,
const QString &text );
289 QString buttonToolTip( ButtonCode
id )
const;
297 void setButtonWhatsThis( ButtonCode
id,
const QString &text );
302 QString buttonWhatsThis( ButtonCode
id )
const;
313 void setButtonGuiItem( ButtonCode
id,
const KGuiItem &item );
322 void setButtonMenu( ButtonCode
id,
QMenu *menu, ButtonPopupMode popupmode=InstantPopup);
327 void setButtonFocus( ButtonCode
id );
338 void setInitialSize(
const QSize &size );
348 void incrementInitialSize(
const QSize &size );
383 QString helpLinkText()
const;
388 bool isButtonEnabled( ButtonCode
id )
const;
409 static int marginHint();
418 static int spacingHint();
426 static int groupSpacingHint();
447 Q_DECLARE_FLAGS(CaptionFlags, CaptionFlag)
469 static QString makeStandardCaption(
const QString &userCaption,
471 CaptionFlags flags = HIGCompliantCaption );
484 static void resizeLayout(
QWidget *widget,
int margin,
int spacing );
497 static void resizeLayout( QLayout *lay,
int margin,
int spacing );
508 static void centerOnScreen(
QWidget *widget,
int screen = -1 );
518 static bool avoidArea(
QWidget *widget,
const QRect& area,
int screen = -1 );
523 void setMainWidget(
QWidget *widget );
538 virtual QSize sizeHint()
const;
543 virtual QSize minimumSizeHint()
const;
550 static void setAllowEmbeddingInGraphicsView(
bool allowEmbedding );
560 virtual void setCaption(
const QString &caption );
571 virtual void setCaption(
const QString &caption,
bool modified );
579 virtual void setPlainCaption(
const QString &caption );
587 void enableButton( ButtonCode
id,
bool state );
594 void enableButtonOk(
bool state );
601 void enableButtonApply(
bool state );
608 void enableButtonCancel(
bool state );
619 void enableLinkedHelp(
bool state );
633 void setHelpLinkText(
const QString &text );
647 void setHelp(
const QString &anchor,
const QString &appname = QString() );
652 bool isDetailsWidgetVisible()
const;
657 void setDetailsWidgetVisible(
bool visible );
665 void setDetailsWidget(
QWidget *detailsWidget );
673 void delayedDestruct();
854 KDialog(KDialogPrivate &dd,
QWidget *parent, Qt::WindowFlags flags = 0);
859 Q_PRIVATE_SLOT(
d_ptr,
void queuedLayoutUpdate())
860 Q_PRIVATE_SLOT(
d_ptr,
void helpLinkClicked())
863Q_DECLARE_OPERATORS_FOR_FLAGS(
KDialog::ButtonCodes)
864Q_DECLARE_OPERATORS_FOR_FLAGS(
KDialog::CaptionFlags)
A dialog base class with standard buttons and predefined layouts.
void defaultClicked()
The Default button was pressed.
virtual void closeEvent(QCloseEvent *e)
Detects when a dialog is being closed from the window manager controls.
KPushButton * button(ButtonCode id) const
Returns the button that corresponds to the id.
void aboutToShowDetails()
The detailsWidget is about to get shown.
virtual void hideEvent(QHideEvent *)
Emits the hidden signal.
void closeClicked()
The Close button was pressed.
virtual void slotButtonClicked(int button)
Activated when the button button is clicked.
virtual void keyPressEvent(QKeyEvent *)
void user3Clicked()
The User3 button was pressed.
void tryClicked()
The Try button was pressed.
void updateGeometry()
Updates the margins and spacings.
void user2Clicked()
The User2 button was pressed.
void resetClicked()
The Reset button was pressed.
@ NoDefault
Used when specifying a default button; indicates that no button should be marked by default.
@ Help
Show Help button. (this button will run the help set with setHelp)
@ Details
Show Details button. (this button will show the detail widget set with setDetailsWidget)
@ Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)
@ Default
Show Default button.
@ Reset
Show Reset button.
@ Yes
Show Yes button. (this button closes the dialog and sets the result to KDialog::Yes)
@ User1
Show User defined button 1.
@ Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)
@ Apply
Show Apply button.
@ Close
Show Close-button. (this button closes the dialog)
@ User3
Show User defined button 3.
@ No
Show No button. (this button closes the dialog and sets the result to KDialog::No)
@ User2
Show User defined button 2.
KDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
Creates a dialog.
KDialogPrivate *const d_ptr
void buttonClicked(KDialog::ButtonCode button)
A button has been pressed.
void yesClicked()
The Yes button was pressed.
void okClicked()
The OK button was pressed.
void hidden()
The dialog is about to be hidden.
void noClicked()
The No button was pressed.
void applyClicked()
The Apply button was pressed.
void cancelClicked()
The Cancel button was pressed.
void helpClicked()
The Help button was pressed.
void layoutHintChanged()
Emitted when the margin size and/or spacing size have changed.
void user1Clicked()
The User1 button was pressed.
void finished()
The dialog has finished.
An abstract class for GUI data such as ToolTip and Icon.
A wrapper around QIcon that provides KDE icon features.